aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/duration
diff options
context:
space:
mode:
authorPat Allan <pat@freelancing-gods.com>2017-06-19 19:03:10 +1000
committerPat Allan <pat@freelancing-gods.com>2017-06-20 18:04:44 +1000
commit036bdee4d5bdad3b3fa1d57ca292214afe746a09 (patch)
tree8eabc5fa599dce65e6266f7056fa8ff3252285a9 /activesupport/lib/active_support/duration
parentb37aa68ff637c4ce1cfd9f6eaec659bc98a1e1b5 (diff)
downloadrails-036bdee4d5bdad3b3fa1d57ca292214afe746a09.tar.gz
rails-036bdee4d5bdad3b3fa1d57ca292214afe746a09.tar.bz2
rails-036bdee4d5bdad3b3fa1d57ca292214afe746a09.zip
Make ActiveSupport frozen string literal friendly.
The ActiveSupport test suite only passes currently if it uses the latest unreleased commits for dalli, and a patch for Builder: https://github.com/tenderlove/builder/pull/6 Beyond that, all external dependencies (at least, to the extent they’re used by ActiveSupport) are happy, including Nokogiri as of 1.8.0.
Diffstat (limited to 'activesupport/lib/active_support/duration')
-rw-r--r--activesupport/lib/active_support/duration/iso8601_serializer.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/duration/iso8601_serializer.rb b/activesupport/lib/active_support/duration/iso8601_serializer.rb
index e5d458b3ab..1cc731df2b 100644
--- a/activesupport/lib/active_support/duration/iso8601_serializer.rb
+++ b/activesupport/lib/active_support/duration/iso8601_serializer.rb
@@ -15,12 +15,12 @@ module ActiveSupport
parts, sign = normalize
return "PT0S".freeze if parts.empty?
- output = "P"
+ output = "P".dup
output << "#{parts[:years]}Y" if parts.key?(:years)
output << "#{parts[:months]}M" if parts.key?(:months)
output << "#{parts[:weeks]}W" if parts.key?(:weeks)
output << "#{parts[:days]}D" if parts.key?(:days)
- time = ""
+ time = "".dup
time << "#{parts[:hours]}H" if parts.key?(:hours)
time << "#{parts[:minutes]}M" if parts.key?(:minutes)
if parts.key?(:seconds)