aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-10-02 05:32:14 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-10-02 05:32:14 +0000
commit0ee1cb2cd32bfaf47deaf5440dd5b9cf0915ab6a (patch)
tree5778378eafcbdfa37c82c67be1566c76aca249be /actionpack/lib/action_view
parent9264bdc8f618344307f07790a07a60dc04b80434 (diff)
downloadrails-0ee1cb2cd32bfaf47deaf5440dd5b9cf0915ab6a.tar.gz
rails-0ee1cb2cd32bfaf47deaf5440dd5b9cf0915ab6a.tar.bz2
rails-0ee1cb2cd32bfaf47deaf5440dd5b9cf0915ab6a.zip
Ruby 1.9 compat, consistent load paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/number_helper.rb10
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb2
2 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/number_helper.rb b/actionpack/lib/action_view/helpers/number_helper.rb
index 64e424df2f..0b76f1a48f 100644
--- a/actionpack/lib/action_view/helpers/number_helper.rb
+++ b/actionpack/lib/action_view/helpers/number_helper.rb
@@ -164,11 +164,11 @@ module ActionView
def number_to_human_size(size, precision=1)
size = Kernel.Float(size)
case
- when size.to_i == 1 : "1 Byte"
- when size < 1.kilobyte: "%d Bytes" % size
- when size < 1.megabyte: "%.#{precision}f KB" % (size / 1.0.kilobyte)
- when size < 1.gigabyte: "%.#{precision}f MB" % (size / 1.0.megabyte)
- when size < 1.terabyte: "%.#{precision}f GB" % (size / 1.0.gigabyte)
+ when size.to_i == 1; "1 Byte"
+ when size < 1.kilobyte; "%d Bytes" % size
+ when size < 1.megabyte; "%.#{precision}f KB" % (size / 1.0.kilobyte)
+ when size < 1.gigabyte; "%.#{precision}f MB" % (size / 1.0.megabyte)
+ when size < 1.terabyte; "%.#{precision}f GB" % (size / 1.0.gigabyte)
else "%.#{precision}f TB" % (size / 1.0.terabyte)
end.sub(/([0-9])\.?0+ /, '\1 ' )
rescue
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index e3e17eaf42..adb0e1fa1b 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -580,7 +580,7 @@ module ActionView
# Specifies a Set of 'bad' tags that the #sanitize helper will remove completely, as opposed
# to just escaping harmless tags like &lt;font&gt;
- @@sanitized_bad_tags = Set.new('script')
+ @@sanitized_bad_tags = Set.new(%w(script))
mattr_reader :sanitized_bad_tags
# Specifies the default Set of tags that the #sanitize helper will allow unscathed.