aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2017-04-19 20:02:03 -0400
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-04-19 20:13:42 -0400
commit0871e5e5c1e6151a7ed3bdf7b22209ac11532b31 (patch)
tree2936e12b4d940a2ac69d3b4f81a1adf15a02c423
parentd862cb89837d78f2c0f59caa9541383c6a0314b9 (diff)
downloadrails-0871e5e5c1e6151a7ed3bdf7b22209ac11532b31.tar.gz
rails-0871e5e5c1e6151a7ed3bdf7b22209ac11532b31.tar.bz2
rails-0871e5e5c1e6151a7ed3bdf7b22209ac11532b31.zip
Fix all style guides violations
Closes #28382 Closes #28651
-rw-r--r--Gemfile.lock4
-rw-r--r--actionpack/test/fixtures/layouts/builder.builder2
-rw-r--r--actionpack/test/fixtures/old_content_type/render_default_for_builder.builder2
-rw-r--r--actionpack/test/fixtures/respond_to/using_defaults.xml.builder2
-rw-r--r--actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder2
-rw-r--r--actionpack/test/fixtures/test/formatted_xml_erb.builder2
-rw-r--r--actionpack/test/fixtures/test/hello_xml_world.builder2
-rw-r--r--actionview/test/fixtures/actionpack/layouts/builder.builder2
-rw-r--r--actionview/test/fixtures/actionpack/test/_hello.builder2
-rw-r--r--actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder2
-rw-r--r--actionview/test/fixtures/actionpack/test/hello.builder4
-rw-r--r--actionview/test/fixtures/actionpack/test/hello_world_container.builder4
-rw-r--r--actionview/test/fixtures/actionpack/test/hello_xml_world.builder2
-rw-r--r--actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder2
-rw-r--r--actionview/test/fixtures/comments/empty.html.builder2
-rw-r--r--actionview/test/fixtures/test/hello.builder4
-rw-r--r--guides/Rakefile6
-rw-r--r--guides/rails_guides/markdown.rb2
-rw-r--r--guides/rails_guides/markdown/renderer.rb18
19 files changed, 33 insertions, 33 deletions
diff --git a/Gemfile.lock b/Gemfile.lock
index 84ab3a01ca..da7e5a8cab 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -280,7 +280,7 @@ GEM
redis (~> 3.3)
resque (~> 1.26)
rufus-scheduler (~> 3.2)
- rubocop (0.47.1)
+ rubocop (0.48.1)
parser (>= 2.3.3.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
@@ -352,7 +352,7 @@ GEM
tzinfo (>= 1.0.0)
uglifier (3.0.4)
execjs (>= 0.3.0, < 3)
- unicode-display_width (1.1.3)
+ unicode-display_width (1.2.1)
useragent (0.16.8)
vegas (0.1.11)
rack (>= 1.0.0)
diff --git a/actionpack/test/fixtures/layouts/builder.builder b/actionpack/test/fixtures/layouts/builder.builder
index 7c7d4b2dd1..c55488edd0 100644
--- a/actionpack/test/fixtures/layouts/builder.builder
+++ b/actionpack/test/fixtures/layouts/builder.builder
@@ -1,3 +1,3 @@
xml.wrapper do
xml << yield
-end \ No newline at end of file
+end
diff --git a/actionpack/test/fixtures/old_content_type/render_default_for_builder.builder b/actionpack/test/fixtures/old_content_type/render_default_for_builder.builder
index 598d62e2fc..15c8a7f5cf 100644
--- a/actionpack/test/fixtures/old_content_type/render_default_for_builder.builder
+++ b/actionpack/test/fixtures/old_content_type/render_default_for_builder.builder
@@ -1 +1 @@
-xml.p "Hello world!" \ No newline at end of file
+xml.p "Hello world!"
diff --git a/actionpack/test/fixtures/respond_to/using_defaults.xml.builder b/actionpack/test/fixtures/respond_to/using_defaults.xml.builder
index 598d62e2fc..15c8a7f5cf 100644
--- a/actionpack/test/fixtures/respond_to/using_defaults.xml.builder
+++ b/actionpack/test/fixtures/respond_to/using_defaults.xml.builder
@@ -1 +1 @@
-xml.p "Hello world!" \ No newline at end of file
+xml.p "Hello world!"
diff --git a/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder b/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder
index 598d62e2fc..15c8a7f5cf 100644
--- a/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder
+++ b/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder
@@ -1 +1 @@
-xml.p "Hello world!" \ No newline at end of file
+xml.p "Hello world!"
diff --git a/actionpack/test/fixtures/test/formatted_xml_erb.builder b/actionpack/test/fixtures/test/formatted_xml_erb.builder
index 14fd3549fb..f98aaa34a5 100644
--- a/actionpack/test/fixtures/test/formatted_xml_erb.builder
+++ b/actionpack/test/fixtures/test/formatted_xml_erb.builder
@@ -1 +1 @@
-xml.test 'failed' \ No newline at end of file
+xml.test "failed"
diff --git a/actionpack/test/fixtures/test/hello_xml_world.builder b/actionpack/test/fixtures/test/hello_xml_world.builder
index e7081b89fe..d16bb6b5cb 100644
--- a/actionpack/test/fixtures/test/hello_xml_world.builder
+++ b/actionpack/test/fixtures/test/hello_xml_world.builder
@@ -8,4 +8,4 @@ xml.html do
xml.p "monks"
xml.p "wiseguys"
end
-end \ No newline at end of file
+end
diff --git a/actionview/test/fixtures/actionpack/layouts/builder.builder b/actionview/test/fixtures/actionpack/layouts/builder.builder
index 7c7d4b2dd1..c55488edd0 100644
--- a/actionview/test/fixtures/actionpack/layouts/builder.builder
+++ b/actionview/test/fixtures/actionpack/layouts/builder.builder
@@ -1,3 +1,3 @@
xml.wrapper do
xml << yield
-end \ No newline at end of file
+end
diff --git a/actionview/test/fixtures/actionpack/test/_hello.builder b/actionview/test/fixtures/actionpack/test/_hello.builder
index ef52f632d1..fc72df16d0 100644
--- a/actionview/test/fixtures/actionpack/test/_hello.builder
+++ b/actionview/test/fixtures/actionpack/test/_hello.builder
@@ -1 +1 @@
-xm.hello \ No newline at end of file
+xm.hello
diff --git a/actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder b/actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder
index 14fd3549fb..f98aaa34a5 100644
--- a/actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder
+++ b/actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder
@@ -1 +1 @@
-xml.test 'failed' \ No newline at end of file
+xml.test "failed"
diff --git a/actionview/test/fixtures/actionpack/test/hello.builder b/actionview/test/fixtures/actionpack/test/hello.builder
index a471553941..b8ab17ad5b 100644
--- a/actionview/test/fixtures/actionpack/test/hello.builder
+++ b/actionview/test/fixtures/actionpack/test/hello.builder
@@ -1,4 +1,4 @@
xml.html do
xml.p "Hello #{@name}"
- xml << render(:file => "test/greeting")
-end \ No newline at end of file
+ xml << render(file: "test/greeting")
+end
diff --git a/actionview/test/fixtures/actionpack/test/hello_world_container.builder b/actionview/test/fixtures/actionpack/test/hello_world_container.builder
index e48d75c405..24032ab5e0 100644
--- a/actionview/test/fixtures/actionpack/test/hello_world_container.builder
+++ b/actionview/test/fixtures/actionpack/test/hello_world_container.builder
@@ -1,3 +1,3 @@
xml.test do
- render :partial => 'hello', :locals => { :xm => xml }
-end \ No newline at end of file
+ render partial: "hello", locals: { xm: xml }
+end
diff --git a/actionview/test/fixtures/actionpack/test/hello_xml_world.builder b/actionview/test/fixtures/actionpack/test/hello_xml_world.builder
index e7081b89fe..d16bb6b5cb 100644
--- a/actionview/test/fixtures/actionpack/test/hello_xml_world.builder
+++ b/actionview/test/fixtures/actionpack/test/hello_xml_world.builder
@@ -8,4 +8,4 @@ xml.html do
xml.p "monks"
xml.p "wiseguys"
end
-end \ No newline at end of file
+end
diff --git a/actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder b/actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder
index d539a425a4..cd65da751b 100644
--- a/actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder
+++ b/actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder
@@ -1,4 +1,4 @@
content_for :title do
- 'Putting stuff in the title!'
+ "Putting stuff in the title!"
end
xml << "Great stuff!"
diff --git a/actionview/test/fixtures/comments/empty.html.builder b/actionview/test/fixtures/comments/empty.html.builder
index 2b0c7207a3..12d6fdd9a5 100644
--- a/actionview/test/fixtures/comments/empty.html.builder
+++ b/actionview/test/fixtures/comments/empty.html.builder
@@ -1 +1 @@
-xml.h1 'No Comment' \ No newline at end of file
+xml.h1 "No Comment"
diff --git a/actionview/test/fixtures/test/hello.builder b/actionview/test/fixtures/test/hello.builder
index a471553941..b8ab17ad5b 100644
--- a/actionview/test/fixtures/test/hello.builder
+++ b/actionview/test/fixtures/test/hello.builder
@@ -1,4 +1,4 @@
xml.html do
xml.p "Hello #{@name}"
- xml << render(:file => "test/greeting")
-end \ No newline at end of file
+ xml << render(file: "test/greeting")
+end
diff --git a/guides/Rakefile b/guides/Rakefile
index 0a591558e1..3a6f10040f 100644
--- a/guides/Rakefile
+++ b/guides/Rakefile
@@ -17,13 +17,13 @@ namespace :guides do
namespace :generate do
desc "Generate HTML guides"
- task :html => :encoding do
+ task html: :encoding do
ENV["WARNINGS"] = "1" # authors can't disable this
ruby "rails_guides.rb"
end
desc "Generate .mobi file. The kindlegen executable must be in your PATH. You can get it for free from http://www.amazon.com/gp/feature.html?docId=1000765211"
- task :kindle => :encoding do
+ task kindle: :encoding do
require "kindlerb"
unless Kindlerb.kindlegen_available?
abort "Please run `setupkindlerb` to install kindlegen"
@@ -38,7 +38,7 @@ namespace :guides do
# Validate guides -------------------------------------------------------------------------
desc 'Validate guides, use ONLY=foo to process just "foo.html"'
- task :validate => :encoding do
+ task validate: :encoding do
ruby "w3c_validator.rb"
end
diff --git a/guides/rails_guides/markdown.rb b/guides/rails_guides/markdown.rb
index 16aaa7d1eb..02d58601c4 100644
--- a/guides/rails_guides/markdown.rb
+++ b/guides/rails_guides/markdown.rb
@@ -106,7 +106,7 @@ module RailsGuides
end
end
- doc.css('h3, h4, h5, h6').each do |node|
+ doc.css("h3, h4, h5, h6").each do |node|
node.inner_html = "<a class='anchorlink' href='##{node[:id]}'>#{node.inner_html}</a>"
end
end.to_html
diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb
index 20cbd568c9..9d43c10be6 100644
--- a/guides/rails_guides/markdown/renderer.rb
+++ b/guides/rails_guides/markdown/renderer.rb
@@ -94,15 +94,15 @@ HTML
tree = version || edge
root = file_path[%r{(.+)/}, 1]
- path = case root
- when "abstract_controller", "action_controller", "action_dispatch"
- "actionpack/lib/#{file_path}"
- when /\A(action|active)_/
- "#{root.sub("_", "")}/lib/#{file_path}"
- else
- file_path
- end
-
+ path = \
+ case root
+ when "abstract_controller", "action_controller", "action_dispatch"
+ "actionpack/lib/#{file_path}"
+ when /\A(action|active)_/
+ "#{root.sub("_", "")}/lib/#{file_path}"
+ else
+ file_path
+ end
"https://github.com/rails/rails/tree/#{tree}/#{path}"
end