lib/deprecation/reporting.rb in deprecation-0.2.1 vs lib/deprecation/reporting.rb in deprecation-0.2.2
- old
+ new
@@ -60,10 +60,10 @@
if options.is_a? String or options.is_a? Symbol
message = options
options = {}
end
- warning = "#{method_name} is deprecated and will be removed from #{options[:deprecation_horizon] || context.deprecation_horizon}"
+ warning = "#{method_name} is deprecated and will be removed from #{options[:deprecation_horizon] || (context.deprecation_horizon if context.respond_to? :deprecation_horizon) || "a future release"}"
case message
when Symbol then "#{warning} (use #{message} instead)"
when String then "#{warning} (#{message})"
else warning
end