diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2011-02-10 23:01:02 +0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-02-10 23:47:54 +0800 |
commit | 98c0c5db50a7679b3d58769ac22cb0a27a62c930 (patch) | |
tree | 2b1dc40e86e974c3432cd4764045f64a5e6fd30b /activesupport/lib/active_support | |
parent | 1a73407b8506b548a5343c66c16897140203472e (diff) | |
download | rails-98c0c5db50a7679b3d58769ac22cb0a27a62c930.tar.gz rails-98c0c5db50a7679b3d58769ac22cb0a27a62c930.tar.bz2 rails-98c0c5db50a7679b3d58769ac22cb0a27a62c930.zip |
Removed Array#safe_join in AS core_ext and moved it to a view helper with the same same.
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/string/output_safety.rb | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index 0c8fc20ea5..c930abc003 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -122,34 +122,3 @@ class String ActiveSupport::SafeBuffer.new(self) end end - -class Array - # If the separator and all the items in the array are html safe - # then an html safe string is returned using <tt>Array#join</tt>, - # otherwise the result of <tt>Array#join</tt> is returned without - # marking it as html safe. - # - # ["Mr", "Bojangles"].join.html_safe? - # # => false - # - # ["Mr".html_safe, "Bojangles".html_safe].join.html_safe? - # # => true - # - def safe_join(sep=$,) - sep ||= "".html_safe - str = join(sep) - (sep.html_safe? && html_safe?) ? str.html_safe : str - end - - # Returns +true+ if all items in the array are html safe. - # - # [""].html_safe? - # # => false - # - # ["".html_safe].html_safe? - # # => true - # - def html_safe? - detect { |e| !e.html_safe? }.nil? - end -end |