Permalink
Browse files

If not running in Rails, we will log deprecations to $stderr

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4939 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
dhh committed Sep 3, 2006
1 parent 761f1f1 commit eb90b94afdc4358793647b08d28e29af34d45ff8
Showing with 6 additions and 2 deletions.
  1. +6 −2 activesupport/lib/active_support/deprecation.rb
@@ -9,11 +9,15 @@ module Deprecation
class << self
def warn(message = nil, callstack = caller)
- behavior.call(deprecation_message(callstack, message)) if behavior && ! silenced?
+ behavior.call(deprecation_message(callstack, message)) if behavior && !silenced?
end
def default_behavior
- DEFAULT_BEHAVIORS[RAILS_ENV.to_s] if defined?(RAILS_ENV)
+ if defined?(RAILS_ENV)
+ DEFAULT_BEHAVIORS[RAILS_ENV.to_s]
+ else
+ DEFAULT_BEHAVIORS['test']
+ end
end
# Have deprecations been silenced?

0 comments on commit eb90b94

Please sign in to comment.