Skip to content

Commit cc20103

Browse files
committed
Fix rubocop warning
1 parent 31e314c commit cc20103

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Rakefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
require 'yaml'
44
require 'bundler'
55

6-
SOURCE_DIR = "src"
6+
SOURCE_DIR = 'src'
77
INDEX_HTML = 'files/railties/RDOC_MAIN_rdoc.html'
88

9-
desc "Build railsdoc"
9+
desc 'Build railsdoc'
1010
task :build do
1111
generate_rails_rdoc
1212
generate_src
1313

1414
sh 'bundle exec jekyll build'
1515
end
1616

17-
desc "Switch to default Rails version"
17+
desc 'Switch to default Rails version'
1818
task :switch_default_rails do
19-
switch_rails(config["default_rails_version"])
19+
switch_rails(config['default_rails_version'])
2020
end
2121

2222
desc "Build another version's railsdoc"
2323
task :build_multi do
24-
config["rails_versions"].each do |version, detail|
24+
config['rails_versions'].each do |version, detail|
2525
dir = "#{SOURCE_DIR}/#{version}"
2626
mkdir dir unless Dir.exist?(dir)
2727

28-
bulid_version = detail["specific_version"]
28+
bulid_version = detail['specific_version']
2929
switch_rails(bulid_version)
3030
generate_rails_rdoc
3131
generate_src(target_version: version)
@@ -38,7 +38,7 @@ end
3838

3939
def switch_rails(version)
4040
cd 'rails' do
41-
sh "git reset --hard"
41+
sh 'git reset --hard'
4242
sh "git switch refs/tags/v#{version} -C v#{version}"
4343
end
4444
end
@@ -47,9 +47,9 @@ def generate_rails_rdoc
4747
cd 'rails' do
4848
Bundler.with_unbundled_env do
4949
# replace sdoc gem
50-
gemfile = File.read("Gemfile")
50+
gemfile = File.read('Gemfile')
5151
gemfile.gsub!(/"sdoc.*$/, '"sdoc", github: "toshimaru/sdoc", branch: "railsdoc"')
52-
File.write("Gemfile", gemfile)
52+
File.write('Gemfile', gemfile)
5353

5454
sh 'bundle install && bundle update sdoc'
5555
rm_rf 'doc'
@@ -59,7 +59,7 @@ def generate_rails_rdoc
5959
end
6060

6161
def generate_src(target_version: nil)
62-
copy_sources = Dir.glob('rails/doc/rdoc/*').reject { |path| path.end_with?("panel", "js", "created.rid") }
62+
copy_sources = Dir.glob('rails/doc/rdoc/*').reject { |path| path.end_with?('panel', 'js', 'created.rid') }
6363
target_dir = "#{SOURCE_DIR}/#{target_version}"
6464
cp_r copy_sources, target_dir
6565

@@ -69,8 +69,8 @@ def generate_src(target_version: nil)
6969
return if target_version.nil?
7070

7171
# Replace absolute path in navigation.html
72-
content = File.read("navigation.html")
73-
content.gsub!("<a href=\"/", "<a href=\"/#{target_version}/")
74-
File.write("navigation.html", content)
72+
content = File.read('navigation.html')
73+
content.gsub!('<a href=\"/', "<a href=\"/#{target_version}/")
74+
File.write('navigation.html', content)
7575
end
7676
end

0 commit comments

Comments
 (0)