summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-27 00:29:21 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-27 00:29:21 +0000
commit8edb6ce4f7920dadcead21dc064557ea7c8b9e25 (patch)
tree90dac0560413496fb0b36265712b43e4dddf8fdc
parentc71e1223c5a91ef51d5efbdb9de13e0af04bcf4a (diff)
{ext,test}/date: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/date/extconf.rb2
-rw-r--r--ext/date/lib/date.rb2
-rw-r--r--test/date/test_date.rb2
-rw-r--r--test/date/test_date_arith.rb2
-rw-r--r--test/date/test_date_attr.rb2
-rw-r--r--test/date/test_date_base.rb2
-rw-r--r--test/date/test_date_compat.rb2
-rw-r--r--test/date/test_date_conv.rb2
-rw-r--r--test/date/test_date_marshal.rb2
-rw-r--r--test/date/test_date_new.rb2
-rw-r--r--test/date/test_date_parse.rb2
-rw-r--r--test/date/test_date_strftime.rb2
-rw-r--r--test/date/test_date_strptime.rb2
-rw-r--r--test/date/test_switch_hitter.rb34
14 files changed, 30 insertions, 30 deletions
diff --git a/ext/date/extconf.rb b/ext/date/extconf.rb
index e859695..a4f243e 100644
--- a/ext/date/extconf.rb
+++ b/ext/date/extconf.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'mkmf'
config_string("strict_warnflags") {|w| $warnflags += " #{w}"}
create_makefile('date_core')
diff --git a/ext/date/lib/date.rb b/ext/date/lib/date.rb
index c10441e..9170a99 100644
--- a/ext/date/lib/date.rb
+++ b/ext/date/lib/date.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
# date.rb: Written by Tadayoshi Funaba 1998-2011
require 'date_core'
diff --git a/test/date/test_date.rb b/test/date/test_date.rb
index 247cce1..531495d 100644
--- a/test/date/test_date.rb
+++ b/test/date/test_date.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_arith.rb b/test/date/test_date_arith.rb
index f5ac5bf..96622ba 100644
--- a/test/date/test_date_arith.rb
+++ b/test/date/test_date_arith.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_attr.rb b/test/date/test_date_attr.rb
index 3d1b0a2..d3bb9b9 100644
--- a/test/date/test_date_attr.rb
+++ b/test/date/test_date_attr.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_base.rb b/test/date/test_date_base.rb
index 06fec19..8d53adf 100644
--- a/test/date/test_date_base.rb
+++ b/test/date/test_date_base.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_compat.rb b/test/date/test_date_compat.rb
index 1bd30b5..316f8c0 100644
--- a/test/date/test_date_compat.rb
+++ b/test/date/test_date_compat.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_conv.rb b/test/date/test_date_conv.rb
index 3729476..5c295da 100644
--- a/test/date/test_date_conv.rb
+++ b/test/date/test_date_conv.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_marshal.rb b/test/date/test_date_marshal.rb
index 27ae1e9..10e396b 100644
--- a/test/date/test_date_marshal.rb
+++ b/test/date/test_date_marshal.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_new.rb b/test/date/test_date_new.rb
index 80ecbc2..2a015bf 100644
--- a/test/date/test_date_new.rb
+++ b/test/date/test_date_new.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_parse.rb b/test/date/test_date_parse.rb
index d980674..ac0eb85 100644
--- a/test/date/test_date_parse.rb
+++ b/test/date/test_date_parse.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_strftime.rb b/test/date/test_date_strftime.rb
index 1c0f9b1..a33eaa3 100644
--- a/test/date/test_date_strftime.rb
+++ b/test/date/test_date_strftime.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_date_strptime.rb b/test/date/test_date_strptime.rb
index 15fdc94..bf3002a 100644
--- a/test/date/test_date_strptime.rb
+++ b/test/date/test_date_strptime.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
diff --git a/test/date/test_switch_hitter.rb b/test/date/test_switch_hitter.rb
index 931d736..bfd0b8e 100644
--- a/test/date/test_switch_hitter.rb
+++ b/test/date/test_switch_hitter.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'date'
@@ -577,29 +577,29 @@ class TestSH < Test::Unit::TestCase
def test_taint
h = Date._strptime('15:43+09:00', '%R%z')
assert_equal(false, h[:zone].tainted?)
- h = Date._strptime('15:43+09:00'.taint, '%R%z')
+ h = Date._strptime('15:43+09:00'.dup.taint, '%R%z')
assert_equal(true, h[:zone].tainted?)
h = Date._strptime('1;1/0', '%d')
assert_equal(false, h[:leftover].tainted?)
- h = Date._strptime('1;1/0'.taint, '%d')
+ h = Date._strptime('1;1/0'.dup.taint, '%d')
assert_equal(true, h[:leftover].tainted?)
h = Date._parse('15:43+09:00')
assert_equal(false, h[:zone].tainted?)
- h = Date._parse('15:43+09:00'.taint)
+ h = Date._parse('15:43+09:00'.dup.taint)
assert_equal(true, h[:zone].tainted?)
s = Date.today.strftime('new 105')
assert_equal(false, s.tainted?)
- s = Date.today.strftime('new 105'.taint)
+ s = Date.today.strftime('new 105'.dup.taint)
assert_equal(true, s.tainted?)
- s = Date.today.strftime("new \000 105".taint)
+ s = Date.today.strftime("new \000 105".dup.taint)
assert_equal(true, s.tainted?)
s = DateTime.now.strftime('super $record')
assert_equal(false, s.tainted?)
- s = DateTime.now.strftime('super $record'.taint)
+ s = DateTime.now.strftime('super $record'.dup.taint)
assert_equal(true, s.tainted?)
end
@@ -617,29 +617,29 @@ class TestSH < Test::Unit::TestCase
assert_equal(Encoding::US_ASCII, s.encoding) if s
end
- h = Date._strptime('15:43+09:00'.force_encoding('euc-jp'), '%R%z')
+ h = Date._strptime('15:43+09:00'.dup.force_encoding('euc-jp'), '%R%z')
assert_equal(Encoding::EUC_JP, h[:zone].encoding)
- h = Date._strptime('15:43+09:00'.force_encoding('ascii-8bit'), '%R%z')
+ h = Date._strptime('15:43+09:00'.dup.force_encoding('ascii-8bit'), '%R%z')
assert_equal(Encoding::ASCII_8BIT, h[:zone].encoding)
- h = Date._strptime('1;1/0'.force_encoding('euc-jp'), '%d')
+ h = Date._strptime('1;1/0'.dup.force_encoding('euc-jp'), '%d')
assert_equal(Encoding::EUC_JP, h[:leftover].encoding)
- h = Date._strptime('1;1/0'.force_encoding('ascii-8bit'), '%d')
+ h = Date._strptime('1;1/0'.dup.force_encoding('ascii-8bit'), '%d')
assert_equal(Encoding::ASCII_8BIT, h[:leftover].encoding)
- h = Date._parse('15:43+09:00'.force_encoding('euc-jp'))
+ h = Date._parse('15:43+09:00'.dup.force_encoding('euc-jp'))
assert_equal(Encoding::EUC_JP, h[:zone].encoding)
- h = Date._parse('15:43+09:00'.force_encoding('ascii-8bit'))
+ h = Date._parse('15:43+09:00'.dup.force_encoding('ascii-8bit'))
assert_equal(Encoding::ASCII_8BIT, h[:zone].encoding)
- s = Date.today.strftime('new 105'.force_encoding('euc-jp'))
+ s = Date.today.strftime('new 105'.dup.force_encoding('euc-jp'))
assert_equal(Encoding::EUC_JP, s.encoding)
- s = Date.today.strftime('new 105'.force_encoding('ascii-8bit'))
+ s = Date.today.strftime('new 105'.dup.force_encoding('ascii-8bit'))
assert_equal(Encoding::ASCII_8BIT, s.encoding)
- s = DateTime.now.strftime('super $record'.force_encoding('euc-jp'))
+ s = DateTime.now.strftime('super $record'.dup.force_encoding('euc-jp'))
assert_equal(Encoding::EUC_JP, s.encoding)
- s = DateTime.now.strftime('super $record'.force_encoding('ascii-8bit'))
+ s = DateTime.now.strftime('super $record'.dup.force_encoding('ascii-8bit'))
assert_equal(Encoding::ASCII_8BIT, s.encoding)
end