Permalink
Browse files

Silenced warnings from reloading files

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@28 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Nov 30, 2004
1 parent ac3c8a5 commit bcfd649de8850e3bfc9584eb12be8fe136ca6985
@@ -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'
@@ -257,7 +257,7 @@ def controller_name
# 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
@@ -0,0 +1,6 @@
def silence_warnings
old_verbose, $VERBOSE = $VERBOSE, nil
result = yield
$VERBOSE = old_verbose
return result
end

0 comments on commit bcfd649

Please sign in to comment.