Skip to content

Commit

Permalink
Dependencies move to ActiveSupport::Dependencies missed a few spots
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Jun 4, 2008
1 parent e7947e0 commit cce30f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions railties/lib/initializer.rb
Expand Up @@ -203,10 +203,10 @@ def set_load_path
# Set the paths from which Rails will automatically load source files, and # Set the paths from which Rails will automatically load source files, and
# the load_once paths. # the load_once paths.
def set_autoload_paths def set_autoload_paths
Dependencies.load_paths = configuration.load_paths.uniq ActiveSupport::Dependencies.load_paths = configuration.load_paths.uniq
Dependencies.load_once_paths = configuration.load_once_paths.uniq ActiveSupport::Dependencies.load_once_paths = configuration.load_once_paths.uniq


extra = Dependencies.load_once_paths - Dependencies.load_paths extra = ActiveSupport::Dependencies.load_once_paths - ActiveSupport::Dependencies.load_paths
unless extra.empty? unless extra.empty?
abort <<-end_error abort <<-end_error
load_once_paths must be a subset of the load_paths. load_once_paths must be a subset of the load_paths.
Expand All @@ -233,7 +233,7 @@ def add_support_load_paths
end end


# Adds all load paths from plugins to the global set of load paths, so that # Adds all load paths from plugins to the global set of load paths, so that
# code from plugins can be required (explicitly or automatically via Dependencies). # code from plugins can be required (explicitly or automatically via ActiveSupport::Dependencies).
def add_plugin_load_paths def add_plugin_load_paths
plugin_loader.add_plugin_load_paths plugin_loader.add_plugin_load_paths
end end
Expand Down Expand Up @@ -415,7 +415,7 @@ def initialize_routing
# Sets the dependency loading mechanism based on the value of # Sets the dependency loading mechanism based on the value of
# Configuration#cache_classes. # Configuration#cache_classes.
def initialize_dependency_mechanism def initialize_dependency_mechanism
Dependencies.mechanism = configuration.cache_classes ? :require : :load ActiveSupport::Dependencies.mechanism = configuration.cache_classes ? :require : :load
end end


# Loads support for "whiny nil" (noisy warnings when methods are invoked # Loads support for "whiny nil" (noisy warnings when methods are invoked
Expand Down Expand Up @@ -601,12 +601,12 @@ def plugins=(plugins)
# If <tt>reload_plugins?</tt> is false, add this to your plugin's <tt>init.rb</tt> # If <tt>reload_plugins?</tt> is false, add this to your plugin's <tt>init.rb</tt>
# to make it reloadable: # to make it reloadable:
# #
# Dependencies.load_once_paths.delete lib_path # ActiveSupport::Dependencies.load_once_paths.delete lib_path
# #
# If <tt>reload_plugins?</tt> is true, add this to your plugin's <tt>init.rb</tt> # If <tt>reload_plugins?</tt> is true, add this to your plugin's <tt>init.rb</tt>
# to only load it once: # to only load it once:
# #
# Dependencies.load_once_paths << lib_path # ActiveSupport::Dependencies.load_once_paths << lib_path
# #
attr_accessor :reload_plugins attr_accessor :reload_plugins


Expand Down
4 changes: 2 additions & 2 deletions railties/lib/rails/plugin/loader.rb
Expand Up @@ -45,9 +45,9 @@ def add_plugin_load_paths
plugins.each do |plugin| plugins.each do |plugin|
plugin.load_paths.each do |path| plugin.load_paths.each do |path|
$LOAD_PATH.insert(application_lib_index + 1, path) $LOAD_PATH.insert(application_lib_index + 1, path)
Dependencies.load_paths << path ActiveSupport::Dependencies.load_paths << path
unless Rails.configuration.reload_plugins? unless Rails.configuration.reload_plugins?
Dependencies.load_once_paths << path ActiveSupport::Dependencies.load_once_paths << path
end end
end end
end end
Expand Down

0 comments on commit cce30f7

Please sign in to comment.