diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-03 22:38:27 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-03 22:38:27 -0700 |
commit | 53bcbfbdc1eed45cc6615e59d36baf018ab43d96 (patch) | |
tree | 691441d50ef7e49b5317ce279329bcaa1d135744 /railties | |
parent | f55ad960d22337d0d92a93724f1cc3ad45200836 (diff) | |
parent | 82e96eb294ae21528c3e05e91c05c7ee5222afbd (diff) | |
download | rails-53bcbfbdc1eed45cc6615e59d36baf018ab43d96.tar.gz rails-53bcbfbdc1eed45cc6615e59d36baf018ab43d96.tar.bz2 rails-53bcbfbdc1eed45cc6615e59d36baf018ab43d96.zip |
Merge branch 'master' into erbout
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/initializer.rb | 16 | ||||
-rw-r--r-- | railties/lib/rails/plugin/loader.rb | 4 |
3 files changed, 12 insertions, 10 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 4d1c86e643..abadeb693f 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *Edge* +* Wrapped Rails.env in StringQuestioneer so you can do Rails.env.development? [DHH] + * Fixed that RailsInfoController wasn't considering all requests local in development mode (Edgard Castro) [#310 state:resolved] diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb index 9e6e02e8e0..dd6a0c66f5 100644 --- a/railties/lib/initializer.rb +++ b/railties/lib/initializer.rb @@ -37,7 +37,7 @@ module Rails end def env - RAILS_ENV + StringQuestioneer.new(RAILS_ENV) end def cache @@ -204,10 +204,10 @@ module Rails # Set the paths from which Rails will automatically load source files, and # the load_once paths. def set_autoload_paths - Dependencies.load_paths = configuration.load_paths.uniq - Dependencies.load_once_paths = configuration.load_once_paths.uniq + ActiveSupport::Dependencies.load_paths = configuration.load_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? abort <<-end_error load_once_paths must be a subset of the load_paths. @@ -234,7 +234,7 @@ module Rails end # 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 plugin_loader.add_plugin_load_paths end @@ -416,7 +416,7 @@ module Rails # Sets the dependency loading mechanism based on the value of # Configuration#cache_classes. def initialize_dependency_mechanism - Dependencies.mechanism = configuration.cache_classes ? :require : :load + ActiveSupport::Dependencies.mechanism = configuration.cache_classes ? :require : :load end # Loads support for "whiny nil" (noisy warnings when methods are invoked @@ -602,12 +602,12 @@ module Rails # If <tt>reload_plugins?</tt> is false, add this to your plugin's <tt>init.rb</tt> # 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> # to only load it once: # - # Dependencies.load_once_paths << lib_path + # ActiveSupport::Dependencies.load_once_paths << lib_path # attr_accessor :reload_plugins diff --git a/railties/lib/rails/plugin/loader.rb b/railties/lib/rails/plugin/loader.rb index 1e542dd038..948d497007 100644 --- a/railties/lib/rails/plugin/loader.rb +++ b/railties/lib/rails/plugin/loader.rb @@ -45,9 +45,9 @@ module Rails plugins.each do |plugin| plugin.load_paths.each do |path| $LOAD_PATH.insert(application_lib_index + 1, path) - Dependencies.load_paths << path + ActiveSupport::Dependencies.load_paths << path unless Rails.configuration.reload_plugins? - Dependencies.load_once_paths << path + ActiveSupport::Dependencies.load_once_paths << path end end end |