aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-05-18 07:24:01 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-05-18 07:24:01 -0700
commit2802ad0f72cd030efc3c4ec4f033389564609cec (patch)
tree1d034beff8fec9b7fd85243fd3bde108211bea59 /actionpack/lib
parent75e8e771255eb2e742caba4fc80955d6906f213e (diff)
parent616c91db0a41ee5018b57c1758a4f70ae463ec7e (diff)
downloadrails-2802ad0f72cd030efc3c4ec4f033389564609cec.tar.gz
rails-2802ad0f72cd030efc3c4ec4f033389564609cec.tar.bz2
rails-2802ad0f72cd030efc3c4ec4f033389564609cec.zip
Merge pull request #6377 from ihid/depreciate_old_text_helper_apis
Deprecate old APIs for highlight, excerpt and word_wrap
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index 209360ee82..1834b88532 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -111,6 +111,9 @@ module ActionView
def highlight(text, phrases, *args)
options = args.extract_options!
unless args.empty?
+ ActiveSupport::Deprecation.warn "Calling highlight with a highlighter as an argument is deprecated. " \
+ "Please call with :highlighter => '#{args[0]}' instead.", caller
+
options[:highlighter] = args[0] || '<strong class="highlight">\1</strong>'
end
options.reverse_merge!(:highlighter => '<strong class="highlight">\1</strong>')
@@ -156,6 +159,9 @@ module ActionView
options = args.extract_options!
unless args.empty?
+ ActiveSupport::Deprecation.warn "Calling excerpt with radius and omission as arguments is deprecated. " \
+ "Please call with :radius => #{args[0]}#{", :omission => '#{args[1]}'" if args[1]} instead.", caller
+
options[:radius] = args[0] || 100
options[:omission] = args[1] || "..."
end
@@ -217,6 +223,9 @@ module ActionView
def word_wrap(text, *args)
options = args.extract_options!
unless args.blank?
+ ActiveSupport::Deprecation.warn "Calling word_wrap with line_width as an argument is deprecated. " \
+ "Please call with :line_width => #{args[0]} instead.", caller
+
options[:line_width] = args[0] || 80
end
options.reverse_merge!(:line_width => 80)