aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/template.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/template.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/template.rb')
-rw-r--r--actionview/lib/action_view/template.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/actionview/lib/action_view/template.rb b/actionview/lib/action_view/template.rb
index 169ee55fdc..1f90cae75b 100644
--- a/actionview/lib/action_view/template.rb
+++ b/actionview/lib/action_view/template.rb
@@ -1,6 +1,6 @@
-require 'active_support/core_ext/object/try'
-require 'active_support/core_ext/kernel/singleton_class'
-require 'thread'
+require "active_support/core_ext/object/try"
+require "active_support/core_ext/kernel/singleton_class"
+require "thread"
module ActionView
# = Action View Template
@@ -180,12 +180,12 @@ module ActionView
name = pieces.pop
partial = !!name.sub!(/^_/, "")
lookup.disable_cache do
- lookup.find_template(name, [ pieces.join('/') ], partial, @locals)
+ lookup.find_template(name, [ pieces.join("/") ], partial, @locals)
end
end
def inspect
- @inspect ||= defined?(Rails.root) ? identifier.sub("#{Rails.root}/", ''.freeze) : identifier
+ @inspect ||= defined?(Rails.root) ? identifier.sub("#{Rails.root}/", "".freeze) : identifier
end
# This method is responsible for properly setting the encoding of the
@@ -204,7 +204,7 @@ module ActionView
# Look for # encoding: *. If we find one, we'll encode the
# String in that encoding, otherwise, we'll use the
# default external encoding.
- if source.sub!(/\A#{ENCODING_FLAG}/, '')
+ if source.sub!(/\A#{ENCODING_FLAG}/, "")
encoding = magic_encoding = $1
else
encoding = Encoding.default_external
@@ -326,19 +326,19 @@ module ActionView
def locals_code #:nodoc:
# Double assign to suppress the dreaded 'assigned but unused variable' warning
- @locals.each_with_object('') { |key, code| code << "#{key} = #{key} = local_assigns[:#{key}];" }
+ @locals.each_with_object("") { |key, code| code << "#{key} = #{key} = local_assigns[:#{key}];" }
end
def method_name #:nodoc:
@method_name ||= begin
m = "_#{identifier_method_name}__#{@identifier.hash}_#{__id__}"
- m.tr!('-'.freeze, '_'.freeze)
+ m.tr!("-".freeze, "_".freeze)
m
end
end
def identifier_method_name #:nodoc:
- inspect.tr('^a-z_'.freeze, '_'.freeze)
+ inspect.tr("^a-z_".freeze, "_".freeze)
end
def instrument(action, &block)