diff options
Diffstat (limited to 'guides')
-rw-r--r-- | guides/Rakefile | 2 | ||||
-rw-r--r-- | guides/rails_guides/kindle.rb | 2 | ||||
-rw-r--r-- | guides/rails_guides/markdown.rb | 4 | ||||
-rw-r--r-- | guides/rails_guides/markdown/renderer.rb | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/guides/Rakefile b/guides/Rakefile index 84e18e0972..4116e6f9cc 100644 --- a/guides/Rakefile +++ b/guides/Rakefile @@ -30,7 +30,7 @@ namespace :guides do unless Kindlerb.kindlegen_available? abort "Please run `setupkindlerb` to install kindlegen" end - unless `convert` =~ /convert/ + unless /convert/.match?(`convert`) abort "Please install ImageMagick" end ENV["KINDLE"] = "1" diff --git a/guides/rails_guides/kindle.rb b/guides/rails_guides/kindle.rb index d370541d2e..8a0361ff4c 100644 --- a/guides/rails_guides/kindle.rb +++ b/guides/rails_guides/kindle.rb @@ -35,7 +35,7 @@ module Kindle def generate_front_matter(html_pages) frontmatter = [] html_pages.delete_if { |x| - if x =~ /(toc|welcome|copyright).html/ + if /(toc|welcome|copyright).html/.match?(x) frontmatter << x unless x =~ /toc/ true end diff --git a/guides/rails_guides/markdown.rb b/guides/rails_guides/markdown.rb index 84f95eec68..61b371363e 100644 --- a/guides/rails_guides/markdown.rb +++ b/guides/rails_guides/markdown.rb @@ -69,7 +69,7 @@ module RailsGuides end def extract_raw_header_and_body - if @raw_body =~ /^\-{40,}$/ + if /^\-{40,}$/.match?(@raw_body) @raw_header, _, @raw_body = @raw_body.partition(/^\-{40,}$/).map(&:strip) end end @@ -89,7 +89,7 @@ module RailsGuides hierarchy = [] doc.children.each do |node| - if node.name =~ /^h[3-6]$/ + if /^h[3-6]$/.match?(node.name) case node.name when "h3" hierarchy = [node] diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb index 78820a7856..8095b8c898 100644 --- a/guides/rails_guides/markdown/renderer.rb +++ b/guides/rails_guides/markdown/renderer.rb @@ -35,7 +35,7 @@ HTML def paragraph(text) if text =~ %r{^NOTE:\s+Defined\s+in\s+<code>(.*?)</code>\.?$} %(<div class="note"><p>Defined in <code><a href="#{github_file_url($1)}">#{$1}</a></code>.</p></div>) - elsif text =~ /^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:]/ + elsif /^(TIP|IMPORTANT|CAUTION|WARNING|NOTE|INFO|TODO)[.:]/.match?(text) convert_notes(text) elsif text.include?("DO NOT READ THIS FILE ON GITHUB") elsif text =~ /^\[<sup>(\d+)\]:<\/sup> (.+)$/ @@ -110,7 +110,7 @@ HTML end def api_link(url) - if url =~ %r{http://api\.rubyonrails\.org/v\d+\.} + if %r{http://api\.rubyonrails\.org/v\d+\.}.match?(url) url elsif edge url.sub("api", "edgeapi") |