lib/active_support/dependencies.rb in activesupport-4.2.0.beta4 vs lib/active_support/dependencies.rb in activesupport-4.2.0.rc1
- old
+ new
@@ -203,11 +203,14 @@
end
# Object includes this module.
module Loadable #:nodoc:
def self.exclude_from(base)
- base.class_eval { define_method(:load, Kernel.instance_method(:load)) }
+ base.class_eval do
+ define_method(:load, Kernel.instance_method(:load))
+ private :load
+ end
end
def require_or_load(file_name)
Dependencies.require_or_load(file_name)
end
@@ -239,22 +242,10 @@
rescue Exception => exception # errors from loading file
exception.blame_file! file if exception.respond_to? :blame_file!
raise
end
- def load(file, wrap = false)
- result = false
- load_dependency(file) { result = super }
- result
- end
-
- def require(file)
- result = false
- load_dependency(file) { result = super }
- result
- end
-
# Mark the given constant as unloadable. Unloadable constants are removed
# each time dependencies are cleared.
#
# Note that marking a constant for unloading need only be done once. Setup
# or init scripts may list each unloadable constant that may need unloading;
@@ -266,9 +257,23 @@
#
# Returns +true+ if the constant was not previously marked for unloading,
# +false+ otherwise.
def unloadable(const_desc)
Dependencies.mark_for_unload const_desc
+ end
+
+ private
+
+ def load(file, wrap = false)
+ result = false
+ load_dependency(file) { result = super }
+ result
+ end
+
+ def require(file)
+ result = false
+ load_dependency(file) { result = super }
+ result
end
end
# Exception file-blaming.
module Blamable #:nodoc: