aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/atom_feed_helper.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:48:35 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:48:35 +0200
commit66a7cfa91045e05f134efc9ac0e226e66161e2e6 (patch)
tree39b8554cfe4e27a30be3eed905bc2afcc26cfe89 /actionview/lib/action_view/helpers/atom_feed_helper.rb
parentbde6547bb6a8ddf18fb687bf20893d3dc87e0358 (diff)
downloadrails-66a7cfa91045e05f134efc9ac0e226e66161e2e6.tar.gz
rails-66a7cfa91045e05f134efc9ac0e226e66161e2e6.tar.bz2
rails-66a7cfa91045e05f134efc9ac0e226e66161e2e6.zip
applies new string literal convention in actionview/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'actionview/lib/action_view/helpers/atom_feed_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/atom_feed_helper.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/actionview/lib/action_view/helpers/atom_feed_helper.rb b/actionview/lib/action_view/helpers/atom_feed_helper.rb
index c875f5870f..9a713d573e 100644
--- a/actionview/lib/action_view/helpers/atom_feed_helper.rb
+++ b/actionview/lib/action_view/helpers/atom_feed_helper.rb
@@ -1,4 +1,4 @@
-require 'set'
+require "set"
module ActionView
# = Action View Atom Feed Helpers
@@ -112,13 +112,13 @@ module ActionView
end
end
- feed_opts = {"xml:lang" => options[:language] || "en-US", "xmlns" => 'http://www.w3.org/2005/Atom'}
+ feed_opts = {"xml:lang" => options[:language] || "en-US", "xmlns" => "http://www.w3.org/2005/Atom"}
feed_opts.merge!(options).reject!{|k,v| !k.to_s.match(/^xml/)}
xml.feed(feed_opts) do
xml.id(options[:id] || "tag:#{request.host},#{options[:schema_date]}:#{request.fullpath.split(".")[0]}")
- xml.link(:rel => 'alternate', :type => 'text/html', :href => options[:root_url] || (request.protocol + request.host_with_port))
- xml.link(:rel => 'self', :type => 'application/atom+xml', :href => options[:url] || request.url)
+ xml.link(:rel => "alternate", :type => "text/html", :href => options[:root_url] || (request.protocol + request.host_with_port))
+ xml.link(:rel => "self", :type => "application/atom+xml", :href => options[:url] || request.url)
yield AtomFeedBuilder.new(xml, self, options)
end
@@ -138,7 +138,7 @@ module ActionView
def method_missing(method, *arguments, &block)
if xhtml_block?(method, arguments)
@xml.__send__(method, *arguments) do
- @xml.div(:xmlns => 'http://www.w3.org/1999/xhtml') do |xhtml|
+ @xml.div(:xmlns => "http://www.w3.org/1999/xhtml") do |xhtml|
block.call(xhtml)
end
end
@@ -153,7 +153,7 @@ module ActionView
def xhtml_block?(method, arguments)
if XHTML_TAG_NAMES.include?(method.to_s)
last = arguments.last
- last.is_a?(Hash) && last[:type].to_s == 'xhtml'
+ last.is_a?(Hash) && last[:type].to_s == "xhtml"
end
end
end
@@ -189,10 +189,10 @@ module ActionView
@xml.updated((options[:updated] || record.updated_at).xmlschema)
end
- type = options.fetch(:type, 'text/html')
+ type = options.fetch(:type, "text/html")
url = options.fetch(:url) { @view.polymorphic_url(record) }
- @xml.link(:rel => 'alternate', :type => type, :href => url) if url
+ @xml.link(:rel => "alternate", :type => type, :href => url) if url
yield AtomBuilder.new(@xml)
end