diff options
Diffstat (limited to 'guides')
-rw-r--r-- | guides/bug_report_templates/active_record_migrations_gem.rb | 2 | ||||
-rw-r--r-- | guides/bug_report_templates/active_record_migrations_master.rb | 2 | ||||
-rw-r--r-- | guides/bug_report_templates/benchmark.rb | 4 | ||||
-rw-r--r-- | guides/rails_guides/generator.rb | 2 | ||||
-rw-r--r-- | guides/rails_guides/helpers.rb | 2 | ||||
-rw-r--r-- | guides/rails_guides/indexer.rb | 2 | ||||
-rw-r--r-- | guides/rails_guides/kindle.rb | 4 | ||||
-rw-r--r-- | guides/rails_guides/levenshtein.rb | 4 | ||||
-rw-r--r-- | guides/rails_guides/markdown/renderer.rb | 2 | ||||
-rw-r--r-- | guides/w3c_validator.rb | 2 |
10 files changed, 13 insertions, 13 deletions
diff --git a/guides/bug_report_templates/active_record_migrations_gem.rb b/guides/bug_report_templates/active_record_migrations_gem.rb index f568a111f6..ba80e6b4ad 100644 --- a/guides/bug_report_templates/active_record_migrations_gem.rb +++ b/guides/bug_report_templates/active_record_migrations_gem.rb @@ -62,4 +62,4 @@ class BugTest < Minitest::Test assert_equal "decimal(10,0)", Payment.columns.last.sql_type end -end
\ No newline at end of file +end diff --git a/guides/bug_report_templates/active_record_migrations_master.rb b/guides/bug_report_templates/active_record_migrations_master.rb index ef7b42e0a6..13a375d1ba 100644 --- a/guides/bug_report_templates/active_record_migrations_master.rb +++ b/guides/bug_report_templates/active_record_migrations_master.rb @@ -61,4 +61,4 @@ class BugTest < Minitest::Test assert_equal "decimal(10,0)", Payment.columns.last.sql_type end -end
\ No newline at end of file +end diff --git a/guides/bug_report_templates/benchmark.rb b/guides/bug_report_templates/benchmark.rb index ae51d7027f..54433b34dd 100644 --- a/guides/bug_report_templates/benchmark.rb +++ b/guides/bug_report_templates/benchmark.rb @@ -42,8 +42,8 @@ SCENARIOS.each_pair do |name, value| puts Benchmark.ips do |x| - x.report('blank?') { value.blank? } - x.report('fast_blank?') { value.fast_blank? } + x.report("blank?") { value.blank? } + x.report("fast_blank?") { value.fast_blank? } x.compare! end end diff --git a/guides/rails_guides/generator.rb b/guides/rails_guides/generator.rb index 39a57191eb..a818ca9d72 100644 --- a/guides/rails_guides/generator.rb +++ b/guides/rails_guides/generator.rb @@ -68,7 +68,7 @@ module RailsGuides GUIDES_RE = /\.(?:erb|md)\z/ - def initialize(output=nil) + def initialize(output = nil) set_flags_from_environment if kindle? diff --git a/guides/rails_guides/helpers.rb b/guides/rails_guides/helpers.rb index 888b51b1ef..6f4b0b492c 100644 --- a/guides/rails_guides/helpers.rb +++ b/guides/rails_guides/helpers.rb @@ -26,7 +26,7 @@ module RailsGuides documents.reject { |document| document["work_in_progress"] } end - def docs_for_menu(position=nil) + def docs_for_menu(position = nil) if position.nil? documents_by_section elsif position == "L" diff --git a/guides/rails_guides/indexer.rb b/guides/rails_guides/indexer.rb index 56df6a5842..c58b6b85a2 100644 --- a/guides/rails_guides/indexer.rb +++ b/guides/rails_guides/indexer.rb @@ -17,7 +17,7 @@ module RailsGuides private - def process(string, current_level=3, counters=[1]) + def process(string, current_level = 3, counters = [1]) s = StringScanner.new(string) level_hash = {} diff --git a/guides/rails_guides/kindle.rb b/guides/rails_guides/kindle.rb index 6fb8183cb1..4b73ae9518 100644 --- a/guides/rails_guides/kindle.rb +++ b/guides/rails_guides/kindle.rb @@ -56,7 +56,7 @@ module Kindle h2["id"] = h2.inner_text.gsub(/\s/, "-") end add_head_section fdoc, "Front Matter" - File.open("frontmatter.html","w") { |f| f.puts fdoc.to_html } + File.open("frontmatter.html", "w") { |f| f.puts fdoc.to_html } html_pages.unshift "frontmatter.html" end @@ -68,7 +68,7 @@ module Kindle title = doc.at("title").inner_text.gsub("Ruby on Rails Guides: ", "") title = page.capitalize.gsub(".html", "") if title.strip == "" File.open("sections/%03d/_section.txt" % section_idx, "w") { |f| f.puts title } - doc.xpath("//h3[@id]").each_with_index do |h3,item_idx| + doc.xpath("//h3[@id]").each_with_index do |h3, item_idx| subsection = h3.inner_text content = h3.xpath("./following-sibling::*").take_while { |x| x.name != "h3" }.map(&:to_html) item = Nokogiri::HTML(h3.to_html + content.join("\n")) diff --git a/guides/rails_guides/levenshtein.rb b/guides/rails_guides/levenshtein.rb index e947150364..40c6a5c372 100644 --- a/guides/rails_guides/levenshtein.rb +++ b/guides/rails_guides/levenshtein.rb @@ -20,12 +20,12 @@ module RailsGuides str2_codepoint_enumerable = str2.each_codepoint str1.each_codepoint.with_index do |char1, i| - e = i+1 + e = i + 1 str2_codepoint_enumerable.with_index do |char2, j| cost = (char1 == char2) ? 0 : 1 x = [ - d[j+1] + 1, # insertion + d[j + 1] + 1, # insertion e + 1, # deletion d[j] + cost # substitution ].min diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb index eebd9ac730..deab741023 100644 --- a/guides/rails_guides/markdown/renderer.rb +++ b/guides/rails_guides/markdown/renderer.rb @@ -1,7 +1,7 @@ module RailsGuides class Markdown class Renderer < Redcarpet::Render::HTML - def initialize(options={}) + def initialize(options = {}) super end diff --git a/guides/w3c_validator.rb b/guides/w3c_validator.rb index 2ce27e2e16..c0a32c6b91 100644 --- a/guides/w3c_validator.rb +++ b/guides/w3c_validator.rb @@ -81,7 +81,7 @@ module RailsGuides error_summary += "\n #{name}" error_detail += "\n\n #{name} has #{errors.size} validation error(s):\n" errors.each do |error| - error_detail += "\n "+error.to_s.delete("\n") + error_detail += "\n " + error.to_s.delete("\n") end end |