mirror of
https://github.com/github/rails.git
synced 2026-01-13 16:48:06 -05:00
Compare commits
6 Commits
activesupp
...
github31
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0124ba8f3 | ||
|
|
455cd8c060 | ||
|
|
5d322ad957 | ||
|
|
3b6b4578c4 | ||
|
|
981016be60 | ||
|
|
3c1e01068b |
@@ -1 +1 @@
|
||||
2.3.14.github30
|
||||
2.3.14.github31
|
||||
|
||||
@@ -79,12 +79,6 @@ module ActiveSupport
|
||||
constants(false)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the names of the constants defined locally rather than the
|
||||
# constants themselves. See <tt>local_constants</tt>.
|
||||
def local_constant_names
|
||||
local_constants.map { |c| c.to_s }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -82,7 +82,7 @@ class String
|
||||
|
||||
# 1.8 does not takes [:space:] properly
|
||||
if encoding_aware?
|
||||
self !~ /[^[:space:]]/
|
||||
self =~ /\A[[:space:]]*\z/
|
||||
else
|
||||
self !~ NON_WHITESPACE_REGEXP
|
||||
end
|
||||
|
||||
@@ -172,6 +172,7 @@ module ActiveSupport #:nodoc:
|
||||
else
|
||||
load_without_new_constant_marking(file, *extras)
|
||||
end
|
||||
nil
|
||||
rescue Exception => exception # errors from loading file
|
||||
exception.blame_file! file
|
||||
raise
|
||||
@@ -180,6 +181,7 @@ module ActiveSupport #:nodoc:
|
||||
def require(file, *extras) #:nodoc:
|
||||
if Dependencies.load?
|
||||
Dependencies.new_constants_in(Object) { super }
|
||||
true
|
||||
else
|
||||
super
|
||||
end
|
||||
@@ -521,13 +523,13 @@ module ActiveSupport #:nodoc:
|
||||
watch_frames = descs.collect do |desc|
|
||||
if desc.is_a? Module
|
||||
mod_name = desc.name
|
||||
initial_constants = desc.local_constant_names
|
||||
initial_constants = desc.local_constants
|
||||
elsif desc.is_a?(String) || desc.is_a?(Symbol)
|
||||
mod_name = desc.to_s
|
||||
|
||||
# Handle the case where the module has yet to be defined.
|
||||
initial_constants = if qualified_const_defined?(mod_name)
|
||||
mod_name.constantize.local_constant_names
|
||||
mod_name.constantize.local_constants
|
||||
else
|
||||
[]
|
||||
end
|
||||
@@ -554,7 +556,7 @@ module ActiveSupport #:nodoc:
|
||||
|
||||
mod = mod_name.constantize
|
||||
next [] unless mod.is_a? Module
|
||||
new_constants = mod.local_constant_names - prior_constants
|
||||
new_constants = mod.local_constants - prior_constants
|
||||
|
||||
# Make sure no other frames takes credit for these constants.
|
||||
constant_watch_stack_mutex.synchronize do
|
||||
@@ -577,7 +579,9 @@ module ActiveSupport #:nodoc:
|
||||
end
|
||||
end
|
||||
|
||||
return new_constants
|
||||
# XXX trace callers to this method and make them expect an array of
|
||||
# symbols instead of strings and remove this to_s - charliesome
|
||||
return new_constants.map(&:to_s)
|
||||
ensure
|
||||
# Remove the stack frames that we added.
|
||||
if defined?(watch_frames) && ! watch_frames.blank?
|
||||
|
||||
Reference in New Issue
Block a user