aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/dependencies.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 17:58:50 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:10:53 +0200
commitd66e7835bea9505f7003e5038aa19b6ea95ceea1 (patch)
tree9846f86c6d130595f54c389c83b66d57101563c5 /activesupport/lib/active_support/dependencies.rb
parent77eb40dab64e1fe2a759044d4f122dc0ef833141 (diff)
downloadrails-d66e7835bea9505f7003e5038aa19b6ea95ceea1.tar.gz
rails-d66e7835bea9505f7003e5038aa19b6ea95ceea1.tar.bz2
rails-d66e7835bea9505f7003e5038aa19b6ea95ceea1.zip
applies new string literal convention in activesupport/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'activesupport/lib/active_support/dependencies.rb')
-rw-r--r--activesupport/lib/active_support/dependencies.rb48
1 files changed, 24 insertions, 24 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb
index 57f6286de3..73ca737c82 100644
--- a/activesupport/lib/active_support/dependencies.rb
+++ b/activesupport/lib/active_support/dependencies.rb
@@ -1,19 +1,19 @@
-require 'set'
-require 'thread'
-require 'concurrent/map'
-require 'pathname'
-require 'active_support/core_ext/module/aliasing'
-require 'active_support/core_ext/module/attribute_accessors'
-require 'active_support/core_ext/module/introspection'
-require 'active_support/core_ext/module/anonymous'
-require 'active_support/core_ext/module/qualified_const'
-require 'active_support/core_ext/object/blank'
-require 'active_support/core_ext/kernel/reporting'
-require 'active_support/core_ext/load_error'
-require 'active_support/core_ext/name_error'
-require 'active_support/core_ext/string/starts_ends_with'
+require "set"
+require "thread"
+require "concurrent/map"
+require "pathname"
+require "active_support/core_ext/module/aliasing"
+require "active_support/core_ext/module/attribute_accessors"
+require "active_support/core_ext/module/introspection"
+require "active_support/core_ext/module/anonymous"
+require "active_support/core_ext/module/qualified_const"
+require "active_support/core_ext/object/blank"
+require "active_support/core_ext/kernel/reporting"
+require "active_support/core_ext/load_error"
+require "active_support/core_ext/name_error"
+require "active_support/core_ext/string/starts_ends_with"
require "active_support/dependencies/interlock"
-require 'active_support/inflector'
+require "active_support/inflector"
module ActiveSupport #:nodoc:
module Dependencies #:nodoc:
@@ -64,7 +64,7 @@ module ActiveSupport #:nodoc:
# Should we load files or require them?
mattr_accessor :mechanism
- self.mechanism = ENV['NO_RELOAD'] ? :require : :load
+ self.mechanism = ENV["NO_RELOAD"] ? :require : :load
# The set of directories from which we may automatically load files. Files
# under these directories will be reloaded on each request in development mode,
@@ -503,7 +503,7 @@ module ActiveSupport #:nodoc:
if file_path
expanded = File.expand_path(file_path)
- expanded.sub!(/\.rb\z/, ''.freeze)
+ expanded.sub!(/\.rb\z/, "".freeze)
if loading.include?(expanded)
raise "Circular dependency detected while autoloading constant #{qualified_name}"
@@ -591,7 +591,7 @@ module ActiveSupport #:nodoc:
def store(klass)
return self unless klass.respond_to?(:name)
- raise(ArgumentError, 'anonymous classes cannot be cached') if klass.name.empty?
+ raise(ArgumentError, "anonymous classes cannot be cached") if klass.name.empty?
@store[klass.name] = klass
self
end
@@ -675,7 +675,7 @@ module ActiveSupport #:nodoc:
# A module, class, symbol, or string may be provided.
def to_constant_name(desc) #:nodoc:
case desc
- when String then desc.sub(/^::/, '')
+ when String then desc.sub(/^::/, "")
when Symbol then desc.to_s
when Module
desc.name ||
@@ -686,17 +686,17 @@ module ActiveSupport #:nodoc:
def remove_constant(const) #:nodoc:
# Normalize ::Foo, ::Object::Foo, Object::Foo, Object::Object::Foo, etc. as Foo.
- normalized = const.to_s.sub(/\A::/, '')
- normalized.sub!(/\A(Object::)+/, '')
+ normalized = const.to_s.sub(/\A::/, "")
+ normalized.sub!(/\A(Object::)+/, "")
- constants = normalized.split('::')
+ constants = normalized.split("::")
to_remove = constants.pop
# Remove the file path from the loaded list.
file_path = search_for_file(const.underscore)
if file_path
expanded = File.expand_path(file_path)
- expanded.sub!(/\.rb\z/, '')
+ expanded.sub!(/\.rb\z/, "")
self.loaded.delete(expanded)
end
@@ -710,7 +710,7 @@ module ActiveSupport #:nodoc:
# here than require the caller to be clever. We check the parent
# rather than the very const argument because we do not want to
# trigger Kernel#autoloads, see the comment below.
- parent_name = constants.join('::')
+ parent_name = constants.join("::")
return unless qualified_const_defined?(parent_name)
parent = constantize(parent_name)
end