diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:51:43 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:51:43 +0200 |
commit | 628e51ff109334223094e30ad1365188bbd7f9c6 (patch) | |
tree | 6bf28936ffa0fb4fe2390b933958053daeffbc90 /actionpack/lib/abstract_controller | |
parent | 4b6c68dfb810c836f87587a16353317d1a180805 (diff) | |
download | rails-628e51ff109334223094e30ad1365188bbd7f9c6.tar.gz rails-628e51ff109334223094e30ad1365188bbd7f9c6.tar.bz2 rails-628e51ff109334223094e30ad1365188bbd7f9c6.zip |
applies new string literal convention in actionpack/lib
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
Diffstat (limited to 'actionpack/lib/abstract_controller')
-rw-r--r-- | actionpack/lib/abstract_controller/base.rb | 14 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/caching.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/callbacks.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/helpers.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/rendering.rb | 12 | ||||
-rw-r--r-- | actionpack/lib/abstract_controller/translation.rb | 4 |
6 files changed, 19 insertions, 19 deletions
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb index aa06f70433..8e588812f8 100644 --- a/actionpack/lib/abstract_controller/base.rb +++ b/actionpack/lib/abstract_controller/base.rb @@ -1,9 +1,9 @@ -require 'erubis' -require 'abstract_controller/error' -require 'active_support/configurable' -require 'active_support/descendants_tracker' -require 'active_support/core_ext/module/anonymous' -require 'active_support/core_ext/module/attr_internal' +require "erubis" +require "abstract_controller/error" +require "active_support/configurable" +require "active_support/descendants_tracker" +require "active_support/core_ext/module/anonymous" +require "active_support/core_ext/module/attr_internal" module AbstractController # Raised when a non-existing controller action is triggered. @@ -94,7 +94,7 @@ module AbstractController # ==== Returns # * <tt>String</tt> def controller_path - @controller_path ||= name.sub(/Controller$/, ''.freeze).underscore unless anonymous? + @controller_path ||= name.sub(/Controller$/, "".freeze).underscore unless anonymous? end # Refresh the cached action_methods when a new action_method is added. diff --git a/actionpack/lib/abstract_controller/caching.rb b/actionpack/lib/abstract_controller/caching.rb index 0dea50889a..a37ee9ec97 100644 --- a/actionpack/lib/abstract_controller/caching.rb +++ b/actionpack/lib/abstract_controller/caching.rb @@ -29,7 +29,7 @@ module AbstractController extend ConfigMethods config_accessor :default_static_extension - self.default_static_extension ||= '.html' + self.default_static_extension ||= ".html" config_accessor :perform_caching self.perform_caching = true if perform_caching.nil? diff --git a/actionpack/lib/abstract_controller/callbacks.rb b/actionpack/lib/abstract_controller/callbacks.rb index 3ef8da86fa..0a5c39dac6 100644 --- a/actionpack/lib/abstract_controller/callbacks.rb +++ b/actionpack/lib/abstract_controller/callbacks.rb @@ -62,7 +62,7 @@ module AbstractController # impossible to skip a callback defined using an anonymous proc # using #skip_action_callback. def skip_action_callback(*names) - ActiveSupport::Deprecation.warn('`skip_action_callback` is deprecated and will be removed in Rails 5.1. Please use skip_before_action, skip_after_action or skip_around_action instead.') + ActiveSupport::Deprecation.warn("`skip_action_callback` is deprecated and will be removed in Rails 5.1. Please use skip_before_action, skip_after_action or skip_around_action instead.") skip_before_action(*names, raise: false) skip_after_action(*names, raise: false) skip_around_action(*names, raise: false) diff --git a/actionpack/lib/abstract_controller/helpers.rb b/actionpack/lib/abstract_controller/helpers.rb index ab4355296b..e7f5863f1c 100644 --- a/actionpack/lib/abstract_controller/helpers.rb +++ b/actionpack/lib/abstract_controller/helpers.rb @@ -1,4 +1,4 @@ -require 'active_support/dependencies' +require "active_support/dependencies" module AbstractController module Helpers @@ -182,7 +182,7 @@ module AbstractController end def default_helper_module! - module_name = name.sub(/Controller$/, ''.freeze) + module_name = name.sub(/Controller$/, "".freeze) module_path = module_name.underscore helper module_path rescue LoadError => e diff --git a/actionpack/lib/abstract_controller/rendering.rb b/actionpack/lib/abstract_controller/rendering.rb index 4ba2c26949..2cb22cb53d 100644 --- a/actionpack/lib/abstract_controller/rendering.rb +++ b/actionpack/lib/abstract_controller/rendering.rb @@ -1,9 +1,9 @@ -require 'abstract_controller/error' -require 'active_support/concern' -require 'active_support/core_ext/class/attribute' -require 'action_view' -require 'action_view/view_paths' -require 'set' +require "abstract_controller/error" +require "active_support/concern" +require "active_support/core_ext/class/attribute" +require "action_view" +require "action_view/view_paths" +require "set" module AbstractController class DoubleRenderError < Error diff --git a/actionpack/lib/abstract_controller/translation.rb b/actionpack/lib/abstract_controller/translation.rb index 56b8ce895e..9e3858802a 100644 --- a/actionpack/lib/abstract_controller/translation.rb +++ b/actionpack/lib/abstract_controller/translation.rb @@ -9,8 +9,8 @@ module AbstractController # to translate many keys within the same controller / action and gives you a # simple framework for scoping them consistently. def translate(key, options = {}) - if key.to_s.first == '.' - path = controller_path.tr('/', '.') + if key.to_s.first == "." + path = controller_path.tr("/", ".") defaults = [:"#{path}#{key}"] defaults << options[:default] if options[:default] options[:default] = defaults |