diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-11-30 17:10:32 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-11-30 17:10:32 +0000 |
commit | bcfd649de8850e3bfc9584eb12be8fe136ca6985 (patch) | |
tree | 4dc2e1755d41103e135f59bbd3ba691f240206f6 /actionpack | |
parent | ac3c8a54f83418b5cac4b093fc1bae29f59f3a1f (diff) | |
download | rails-bcfd649de8850e3bfc9584eb12be8fe136ca6985.tar.gz rails-bcfd649de8850e3bfc9584eb12be8fe136ca6985.tar.bz2 rails-bcfd649de8850e3bfc9584eb12be8fe136ca6985.zip |
Silenced warnings from reloading files
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@28 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rwxr-xr-x | actionpack/lib/action_controller.rb | 1 | ||||
-rwxr-xr-x | actionpack/lib/action_controller/base.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/support/misc.rb | 6 |
3 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb index 9cc31cd90c..af33d5fcff 100755 --- a/actionpack/lib/action_controller.rb +++ b/actionpack/lib/action_controller.rb @@ -24,6 +24,7 @@ $:.unshift(File.dirname(__FILE__)) require 'action_controller/support/clean_logger' +require 'action_controller/support/misc' require 'action_controller/base' require 'action_controller/rescue' diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index a794272a9a..22eb7dc0a3 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -257,7 +257,7 @@ module ActionController #:nodoc: # Loads the <tt>file_name</tt> if reload_dependencies is true or requires if it's false. def require_or_load(file_name) - reload_dependencies ? load("#{file_name}.rb") : require(file_name) + reload_dependencies ? silence_warnings { load("#{file_name}.rb") } : require(file_name) end end diff --git a/actionpack/lib/action_controller/support/misc.rb b/actionpack/lib/action_controller/support/misc.rb new file mode 100644 index 0000000000..db842f6061 --- /dev/null +++ b/actionpack/lib/action_controller/support/misc.rb @@ -0,0 +1,6 @@ +def silence_warnings + old_verbose, $VERBOSE = $VERBOSE, nil + result = yield + $VERBOSE = old_verbose + return result +end |