From f04a49b033e3da54a52f76289863ec87a3c30438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 9 Feb 2017 23:13:41 -0300 Subject: Fix rubocop violations --- guides/rails_guides/markdown/renderer.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'guides/rails_guides/markdown') diff --git a/guides/rails_guides/markdown/renderer.rb b/guides/rails_guides/markdown/renderer.rb index 97df6f0559..8723ee0b4e 100644 --- a/guides/rails_guides/markdown/renderer.rb +++ b/guides/rails_guides/markdown/renderer.rb @@ -16,7 +16,7 @@ HTML end def link(url, title, content) - if url.start_with?('http://api.rubyonrails.org') + if url.start_with?("http://api.rubyonrails.org") %(#{content}) elsif title %(#{content}) @@ -93,29 +93,29 @@ HTML end def github_file_url(file_path) - root, rest = file_path.split('/', 2) + root, rest = file_path.split("/", 2) case root - when 'abstract_controller', 'action_controller', 'action_dispatch' - path = ['actionpack', 'lib', root, rest].join('/') - when 'active_support', 'active_record', 'active_model', 'action_view', - 'action_cable', 'action_mailer', 'action_pack', 'active_job' - path = [root.sub('_', ''), 'lib', root, rest].join('/') + when "abstract_controller", "action_controller", "action_dispatch" + path = ["actionpack", "lib", root, rest].join("/") + when "active_support", "active_record", "active_model", "action_view", + "action_cable", "action_mailer", "action_pack", "active_job" + path = [root.sub("_", ""), "lib", root, rest].join("/") else path = file_path end - ["https://github.com/rails/rails/tree", version || 'master', path].join('/') + ["https://github.com/rails/rails/tree", version || "master", path].join("/") end def version - ENV['RAILS_VERSION'] + ENV["RAILS_VERSION"] end def api_link(url) if version && !url.match(/v\d\.\d\.\d/) - url.insert(url.index('.org')+4, "/#{version}") - url.sub('http://edgeapi', 'http://api') if url.include?('edgeapi') + url.insert(url.index(".org") + 4, "/#{version}") + url.sub("http://edgeapi", "http://api") if url.include?("edgeapi") end url -- cgit v1.2.3