diff options
author | Xavier Noria <fxn@hashref.com> | 2014-11-10 14:17:01 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2014-11-10 14:29:29 -0800 |
commit | 0ed6ebcf9095c65330d3950cfb6b75ba7ea78853 (patch) | |
tree | cecf2d28bedbbe45d36b224a751c75b0867ad7d1 /activesupport/lib | |
parent | 19067582104e8fc0e98a977f5f0e6a4cd06d8c1a (diff) | |
download | rails-0ed6ebcf9095c65330d3950cfb6b75ba7ea78853.tar.gz rails-0ed6ebcf9095c65330d3950cfb6b75ba7ea78853.tar.bz2 rails-0ed6ebcf9095c65330d3950cfb6b75ba7ea78853.zip |
dependencies.rb: keep the decorated #load and #require private [closes #17553]
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index a89c769e34..65a370dd30 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -205,7 +205,10 @@ module ActiveSupport #:nodoc: # 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) @@ -241,18 +244,6 @@ module ActiveSupport #:nodoc: 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. # @@ -269,6 +260,20 @@ module ActiveSupport #:nodoc: 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. |