Deletes AS::Dependencies::Reference
This is an internal class which is no longer needed.
This commit is contained in:
parent
0d523d8365
commit
14d4edd7c3
@ -614,7 +614,6 @@ def remove_unloadable_constants!
|
||||
log("removing unloadable constants")
|
||||
autoloaded_constants.each { |const| remove_constant const }
|
||||
autoloaded_constants.clear
|
||||
Reference.clear!
|
||||
explicitly_unloadable_constants.each { |const| remove_constant const }
|
||||
end
|
||||
|
||||
@ -654,23 +653,16 @@ def clear!
|
||||
end
|
||||
end
|
||||
|
||||
Reference = ClassCache.new
|
||||
|
||||
# Store a reference to a class +klass+.
|
||||
def reference(klass)
|
||||
Reference.store klass
|
||||
end
|
||||
|
||||
# Get the reference for class named +name+.
|
||||
# Raises an exception if referenced class does not exist.
|
||||
def constantize(name)
|
||||
Reference.get(name)
|
||||
Inflector.constantize(name)
|
||||
end
|
||||
|
||||
# Get the reference for class named +name+ if one exists.
|
||||
# Otherwise returns +nil+.
|
||||
def safe_constantize(name)
|
||||
Reference.safe_get(name)
|
||||
Inflector.safe_constantize(name)
|
||||
end
|
||||
|
||||
# Determine if the given constant has been automatically loaded.
|
||||
|
@ -708,21 +708,6 @@ def test_removal_from_tree_should_be_detected
|
||||
remove_constants(:ServiceOne)
|
||||
end
|
||||
|
||||
def test_references_should_work
|
||||
with_loading "dependencies" do
|
||||
c = ActiveSupport::Dependencies.reference("ServiceOne")
|
||||
service_one_first = ServiceOne
|
||||
assert_equal service_one_first, c.get("ServiceOne")
|
||||
ActiveSupport::Dependencies.clear
|
||||
assert_not defined?(ServiceOne)
|
||||
service_one_second = ServiceOne
|
||||
assert_not_equal service_one_first, c.get("ServiceOne")
|
||||
assert_equal service_one_second, c.get("ServiceOne")
|
||||
end
|
||||
ensure
|
||||
remove_constants(:ServiceOne)
|
||||
end
|
||||
|
||||
def test_constantize_shortcut_for_cached_constant_lookups
|
||||
with_loading "dependencies" do
|
||||
assert_equal ServiceOne, ActiveSupport::Dependencies.constantize("ServiceOne")
|
||||
|
Loading…
Reference in New Issue
Block a user