aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/benchmarkable.rb3
-rw-r--r--activesupport/lib/active_support/callbacks.rb7
-rw-r--r--activesupport/lib/active_support/json/variable.rb5
-rw-r--r--activesupport/lib/active_support/test_case.rb3
4 files changed, 12 insertions, 6 deletions
diff --git a/activesupport/lib/active_support/benchmarkable.rb b/activesupport/lib/active_support/benchmarkable.rb
index 3d8bb13c49..4c7a694c52 100644
--- a/activesupport/lib/active_support/benchmarkable.rb
+++ b/activesupport/lib/active_support/benchmarkable.rb
@@ -48,7 +48,8 @@ module ActiveSupport
# Silence the logger during the execution of the block.
def silence
- ActiveSupport::Deprecation.warn "ActiveSupport::Benchmarkable#silence is deprecated. It will be removed from Rails 4.1."
+ message = "ActiveSupport::Benchmarkable#silence is deprecated. It will be removed from Rails 4.1."
+ ActiveSupport::Deprecation.warn(message, caller)
old_logger_level, logger.level = logger.level, ::Logger::ERROR if logger
yield
ensure
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index a02793bde9..a4ea6748f9 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -282,12 +282,15 @@ module ActiveSupport
def _normalize_legacy_filter(kind, filter)
if !filter.respond_to?(kind) && filter.respond_to?(:filter)
- ActiveSupport::Deprecation.warn("Filter object with #filter method is deprecated. Define method corresponding to filter type (#before, #after or #around).")
+ message = "Filter object with #filter method is deprecated. Define method corresponding " \
+ "to filter type (#before, #after or #around)."
+ ActiveSupport::Deprecation.warn(message, caller)
filter.singleton_class.class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
def #{kind}(context, &block) filter(context, &block) end
RUBY_EVAL
elsif filter.respond_to?(:before) && filter.respond_to?(:after) && kind == :around && !filter.respond_to?(:around)
- ActiveSupport::Deprecation.warn("Filter object with #before and #after methods is deprecated. Define #around method instead.")
+ message = "Filter object with #before and #after methods is deprecated. Define #around method instead."
+ ActiveSupport::Deprecation.warn(message, caller)
def filter.around(context)
should_continue = before(context)
yield if should_continue
diff --git a/activesupport/lib/active_support/json/variable.rb b/activesupport/lib/active_support/json/variable.rb
index 8af661a795..42e25fbdb3 100644
--- a/activesupport/lib/active_support/json/variable.rb
+++ b/activesupport/lib/active_support/json/variable.rb
@@ -5,8 +5,9 @@ module ActiveSupport
# Deprecated: A string that returns itself as its JSON-encoded form.
class Variable < String
def initialize(*args)
- ActiveSupport::Deprecation.warn 'ActiveSupport::JSON::Variable is deprecated and will be removed in Rails 4.1. ' \
- 'For your own custom JSON literals, define #as_json and #encode_json yourself.'
+ message = 'ActiveSupport::JSON::Variable is deprecated and will be removed in Rails 4.1. ' \
+ 'For your own custom JSON literals, define #as_json and #encode_json yourself.'
+ ActiveSupport::Deprecation.warn(message, caller)
super
end
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb
index 81d97ecb40..646e70c29f 100644
--- a/activesupport/lib/active_support/test_case.rb
+++ b/activesupport/lib/active_support/test_case.rb
@@ -43,7 +43,8 @@ module ActiveSupport
if block_given?
super
else
- ActiveSupport::Deprecation.warn("`describe` without a block is deprecated, please switch to: `def self.name; #{text.inspect}; end`\n")
+ message = "`describe` without a block is deprecated, please switch to: `def self.name; #{text.inspect}; end`\n"
+ ActiveSupport::Deprecation.warn(message, caller)
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
def self.name