Skip to content

Commit

Permalink
Silenced warnings from reloading files
Browse files Browse the repository at this point in the history
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 bcfd649
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions actionpack/lib/action_controller.rb
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/base.rb
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions 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

0 comments on commit bcfd649

Please sign in to comment.