aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 17:58:50 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:10:53 +0200
commitd66e7835bea9505f7003e5038aa19b6ea95ceea1 (patch)
tree9846f86c6d130595f54c389c83b66d57101563c5 /activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb
parent77eb40dab64e1fe2a759044d4f122dc0ef833141 (diff)
downloadrails-d66e7835bea9505f7003e5038aa19b6ea95ceea1.tar.gz
rails-d66e7835bea9505f7003e5038aa19b6ea95ceea1.tar.bz2
rails-d66e7835bea9505f7003e5038aa19b6ea95ceea1.zip
applies new string literal convention in activesupport/lib
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb')
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb b/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb
index a83b368b7f..fbd107463a 100644
--- a/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb
+++ b/activesupport/lib/active_support/number_helper/number_to_human_size_converter.rb
@@ -8,7 +8,7 @@ module ActiveSupport
def convert
if opts.key?(:prefix)
- ActiveSupport::Deprecation.warn('The :prefix option of `number_to_human_size` is deprecated and will be removed in Rails 5.1 with no replacement.')
+ ActiveSupport::Deprecation.warn("The :prefix option of `number_to_human_size` is deprecated and will be removed in Rails 5.1 with no replacement.")
end
@number = Float(number)
@@ -24,13 +24,13 @@ module ActiveSupport
human_size = number / (base ** exponent)
number_to_format = NumberToRoundedConverter.convert(human_size, options)
end
- conversion_format.gsub('%n'.freeze, number_to_format).gsub('%u'.freeze, unit)
+ conversion_format.gsub("%n".freeze, number_to_format).gsub("%u".freeze, unit)
end
private
def conversion_format
- translate_number_value_with_default('human.storage_units.format', :locale => options[:locale], :raise => true)
+ translate_number_value_with_default("human.storage_units.format", :locale => options[:locale], :raise => true)
end
def unit
@@ -38,7 +38,7 @@ module ActiveSupport
end
def storage_unit_key
- key_end = smaller_than_base? ? 'byte' : STORAGE_UNITS[exponent]
+ key_end = smaller_than_base? ? "byte" : STORAGE_UNITS[exponent]
"human.storage_units.units.#{key_end}"
end