From b955939d55b71905fa3e5036149ee4c84943c599 Mon Sep 17 00:00:00 2001 From: Alexey Gaziev Date: Tue, 30 Oct 2012 10:23:41 +0800 Subject: Make caller attribute in deprecation methods optional --- actionpack/lib/action_controller/record_identifier.rb | 4 ++-- actionpack/lib/action_dispatch/http/mime_type.rb | 4 ++-- actionpack/lib/action_dispatch/testing/integration.rb | 3 +-- actionpack/lib/action_view/helpers/asset_tag_helper.rb | 2 +- actionpack/lib/action_view/helpers/date_helper.rb | 2 +- actionpack/lib/action_view/helpers/form_helper.rb | 3 +-- actionpack/lib/action_view/helpers/form_options_helper.rb | 2 +- actionpack/lib/action_view/helpers/form_tag_helper.rb | 10 +++++----- actionpack/lib/action_view/helpers/javascript_helper.rb | 4 ++-- actionpack/lib/action_view/helpers/url_helper.rb | 4 ++-- actionpack/lib/action_view/template.rb | 2 +- actionpack/lib/action_view/template/resolver.rb | 2 +- 12 files changed, 20 insertions(+), 22 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_controller/record_identifier.rb b/actionpack/lib/action_controller/record_identifier.rb index 90b69879e5..b49128c184 100644 --- a/actionpack/lib/action_controller/record_identifier.rb +++ b/actionpack/lib/action_controller/record_identifier.rb @@ -8,12 +8,12 @@ module ActionController 'ActionView::RecodIdentifier module.' def dom_id(record, prefix = nil) - ActiveSupport::Deprecation.warn('dom_id ' + MESSAGE, caller) + ActiveSupport::Deprecation.warn('dom_id ' + MESSAGE) ActionView::RecordIdentifier.dom_id(record, prefix) end def dom_class(record, prefix = nil) - ActiveSupport::Deprecation.warn('dom_class ' + MESSAGE, caller) + ActiveSupport::Deprecation.warn('dom_class ' + MESSAGE) ActionView::RecordIdentifier.dom_class(record, prefix) end end diff --git a/actionpack/lib/action_dispatch/http/mime_type.rb b/actionpack/lib/action_dispatch/http/mime_type.rb index f29730270c..3d560518e1 100644 --- a/actionpack/lib/action_dispatch/http/mime_type.rb +++ b/actionpack/lib/action_dispatch/http/mime_type.rb @@ -275,12 +275,12 @@ module Mime # Returns true if Action Pack should check requests using this Mime Type for possible request forgery. See # ActionController::RequestForgeryProtection. def verify_request? - ActiveSupport::Deprecation.warn("Mime::Type#verify_request? is deprecated and will be removed in Rails 4.1", caller) + ActiveSupport::Deprecation.warn "Mime::Type#verify_request? is deprecated and will be removed in Rails 4.1" @@browser_generated_types.include?(to_sym) end def self.browser_generated_types - ActiveSupport::Deprecation.warn("Mime::Type.browser_generated_types is deprecated and will be removed in Rails 4.1", caller) + ActiveSupport::Deprecation.warn "Mime::Type.browser_generated_types is deprecated and will be removed in Rails 4.1" @@browser_generated_types end diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index ca96ec5f12..56c7948d24 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -498,8 +498,7 @@ module ActionDispatch def self.app if !@@app && !ActionDispatch.test_app - ActiveSupport::Deprecation.warn "Rails application fallback is deprecated " \ - "and no longer works, please set ActionDispatch.test_app", caller + ActiveSupport::Deprecation.warn "Rails application fallback is deprecated and no longer works, please set ActionDispatch.test_app" end @@app || ActionDispatch.test_app diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index 9a2b5ae16a..4eac6514df 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -125,7 +125,7 @@ module ActionView "the :type option key. This behavior is deprecated and will be remove in Rails 4.1. You should pass " + ":type option explicitly if you want to use other types, for example: " + "auto_discovery_link_tag(:xml, '/feed.xml', :type => 'application/xml')" - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message end tag( diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index f43d20c6ed..61e39afd8e 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -69,7 +69,7 @@ module ActionView options = include_seconds_or_options else ActiveSupport::Deprecation.warn "distance_of_time_in_words and time_ago_in_words now accept :include_seconds " + - "as a part of options hash, not a boolean argument", caller + "as a part of options hash, not a boolean argument" options[:include_seconds] ||= !!include_seconds_or_options end diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 1a0ce29756..6abf1e1751 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -1181,8 +1181,7 @@ module ActionView def initialize(object_name, object, template, options, block=nil) if block - message = "Giving a block to FormBuilder is deprecated and has no effect anymore." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn "Giving a block to FormBuilder is deprecated and has no effect anymore." end @nested_child_index = {} diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index dec87013d3..87f4380baf 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -521,7 +521,7 @@ module ActionView options = {} message = "Passing the prompt to grouped_options_for_select as an argument is deprecated. " \ "Please use an options hash like `{ prompt: #{prompt.inspect} }`." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message end body = "".html_safe diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index 11bc0cbec8..7680208702 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -427,7 +427,7 @@ module ActionView if disable_with = options.delete("disable_with") message = ":disable_with option is deprecated and will be removed from Rails 4.1. " \ "Use 'data: { disable_with: \'Text\' }' instead." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message options["data-disable-with"] = disable_with end @@ -435,7 +435,7 @@ module ActionView if confirm = options.delete("confirm") message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ "Use 'data: { confirm: \'Text\' }' instead'." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message options["data-confirm"] = confirm end @@ -489,7 +489,7 @@ module ActionView if disable_with = options.delete("disable_with") message = ":disable_with option is deprecated and will be removed from Rails 4.1. " \ "Use 'data: { disable_with: \'Text\' }' instead." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message options["data-disable-with"] = disable_with end @@ -497,7 +497,7 @@ module ActionView if confirm = options.delete("confirm") message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ "Use 'data: { confirm: \'Text\' }' instead'." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message options["data-confirm"] = confirm end @@ -543,7 +543,7 @@ module ActionView if confirm = options.delete("confirm") message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ "Use 'data: { confirm: \'Text\' }' instead'." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message options["data-confirm"] = confirm end diff --git a/actionpack/lib/action_view/helpers/javascript_helper.rb b/actionpack/lib/action_view/helpers/javascript_helper.rb index 6be35168dd..7bf659d5f2 100644 --- a/actionpack/lib/action_view/helpers/javascript_helper.rb +++ b/actionpack/lib/action_view/helpers/javascript_helper.rb @@ -80,7 +80,7 @@ module ActionView def button_to_function(name, function=nil, html_options={}) message = "button_to_function is deprecated and will be removed from Rails 4.1. We recomend to use Unobtrusive JavaScript instead. " + "See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript" - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function};" @@ -102,7 +102,7 @@ module ActionView def link_to_function(name, function, html_options={}) message = "link_to_function is deprecated and will be removed from Rails 4.1. We recomend to use Unobtrusive JavaScript instead. " + "See http://guides.rubyonrails.org/working_with_javascript_in_rails.html#unobtrusive-javascript" - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message onclick = "#{"#{html_options[:onclick]}; " if html_options[:onclick]}#{function}; return false;" href = html_options[:href] || '#' diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 2a1dd86e0a..48ac4312b6 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -579,7 +579,7 @@ module ActionView if confirm message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ "Use 'data: { confirm: \'Text\' }' instead." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message html_options["data-confirm"] = confirm end @@ -589,7 +589,7 @@ module ActionView if disable_with message = ":disable_with option is deprecated and will be removed from Rails 4.1. " \ "Use 'data: { disable_with: \'Text\' }' instead." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message html_options["data-disable-with"] = disable_with end diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index 01a6bb42c8..aefc42be48 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.rb @@ -150,7 +150,7 @@ module ActionView def mime_type message = 'Template#mime_type is deprecated and will be removed in Rails 4.1. Please use type method instead.' - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message @mime_type ||= Mime::Type.lookup_by_extension(@formats.first.to_s) if @formats.first end diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index 086cc0bacc..fc77c1485d 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -237,7 +237,7 @@ module ActionView unless extension message = "The file #{path} did not specify a template handler. The default is currently ERB, " \ "but will change to RAW in the future." - ActiveSupport::Deprecation.warn(message, caller) + ActiveSupport::Deprecation.warn message end handler = Template.handler_for_extension(extension) -- cgit v1.2.3