From 4ff30d9bb6d5d591fbb3952112d721c995059302 Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Tue, 20 Jun 2017 18:35:44 +1000 Subject: Make ActiveModel frozen string literal friendly. Includes two external changes because they're referenced within the ActiveModel test suite. --- actionpack/lib/action_dispatch/journey/router/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/journey') diff --git a/actionpack/lib/action_dispatch/journey/router/utils.rb b/actionpack/lib/action_dispatch/journey/router/utils.rb index 6d400f3364..59c6df88ea 100644 --- a/actionpack/lib/action_dispatch/journey/router/utils.rb +++ b/actionpack/lib/action_dispatch/journey/router/utils.rb @@ -29,7 +29,7 @@ module ActionDispatch ENCODE = "%%%02X".freeze US_ASCII = Encoding::US_ASCII UTF_8 = Encoding::UTF_8 - EMPTY = "".force_encoding(US_ASCII).freeze + EMPTY = "".dup.force_encoding(US_ASCII).freeze DEC2HEX = (0..255).to_a.map { |i| ENCODE % i }.map { |s| s.force_encoding(US_ASCII) } ALPHA = "a-zA-Z".freeze -- cgit v1.2.3 From dd491b24ff28f637b1c8879002adb1acdf20a8ac Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Tue, 20 Jun 2017 19:45:46 +1000 Subject: Make ActionMailer frozen string literal friendly. --- actionpack/lib/action_dispatch/journey/router/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/journey') diff --git a/actionpack/lib/action_dispatch/journey/router/utils.rb b/actionpack/lib/action_dispatch/journey/router/utils.rb index 59c6df88ea..b3896faf56 100644 --- a/actionpack/lib/action_dispatch/journey/router/utils.rb +++ b/actionpack/lib/action_dispatch/journey/router/utils.rb @@ -14,7 +14,7 @@ module ActionDispatch # normalize_path("/%ab") # => "/%AB" def self.normalize_path(path) encoding = path.encoding - path = "/#{path}" + path = "/#{path}".dup path.squeeze!("/".freeze) path.sub!(%r{/+\Z}, "".freeze) path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase } -- cgit v1.2.3 From 3d453b409d037a056d0bcd636a2e020cc7cef4a8 Mon Sep 17 00:00:00 2001 From: Pat Allan Date: Tue, 20 Jun 2017 22:20:04 +1000 Subject: Make ActionView frozen string literal friendly. Plus a couple of related ActionPack patches. --- actionpack/lib/action_dispatch/journey/router/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/journey') diff --git a/actionpack/lib/action_dispatch/journey/router/utils.rb b/actionpack/lib/action_dispatch/journey/router/utils.rb index b3896faf56..1ac86d10d6 100644 --- a/actionpack/lib/action_dispatch/journey/router/utils.rb +++ b/actionpack/lib/action_dispatch/journey/router/utils.rb @@ -18,7 +18,7 @@ module ActionDispatch path.squeeze!("/".freeze) path.sub!(%r{/+\Z}, "".freeze) path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase } - path = "/" if path == "".freeze + path = "/".dup if path == "".freeze path.force_encoding(encoding) path end -- cgit v1.2.3