[前][次][番号順一覧][スレッド一覧]

ruby-changes:45359

From: kazu <ko1@a...>
Date: Fri, 27 Jan 2017 09:29:28 +0900 (JST)
Subject: [ruby-changes:45359] kazu:r57432 (trunk): {ext, test}/date: Specify frozen_string_literal: true.

kazu	2017-01-27 09:29:21 +0900 (Fri, 27 Jan 2017)

  New Revision: 57432

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57432

  Log:
    {ext,test}/date: Specify frozen_string_literal: true.

  Modified files:
    trunk/ext/date/extconf.rb
    trunk/ext/date/lib/date.rb
    trunk/test/date/test_date.rb
    trunk/test/date/test_date_arith.rb
    trunk/test/date/test_date_attr.rb
    trunk/test/date/test_date_base.rb
    trunk/test/date/test_date_compat.rb
    trunk/test/date/test_date_conv.rb
    trunk/test/date/test_date_marshal.rb
    trunk/test/date/test_date_new.rb
    trunk/test/date/test_date_parse.rb
    trunk/test/date/test_date_strftime.rb
    trunk/test/date/test_date_strptime.rb
    trunk/test/date/test_switch_hitter.rb
Index: ext/date/lib/date.rb
===================================================================
--- ext/date/lib/date.rb	(revision 57431)
+++ ext/date/lib/date.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/date/lib/date.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 # date.rb: Written by Tadayoshi Funaba 1998-2011
 
 require 'date_core'
Index: ext/date/extconf.rb
===================================================================
--- ext/date/extconf.rb	(revision 57431)
+++ ext/date/extconf.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/ext/date/extconf.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'mkmf'
 config_string("strict_warnflags") {|w| $warnflags += " #{w}"}
 create_makefile('date_core')
Index: test/date/test_date_strftime.rb
===================================================================
--- test/date/test_date_strftime.rb	(revision 57431)
+++ test/date/test_date_strftime.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_strftime.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_date.rb
===================================================================
--- test/date/test_date.rb	(revision 57431)
+++ test/date/test_date.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_date_compat.rb
===================================================================
--- test/date/test_date_compat.rb	(revision 57431)
+++ test/date/test_date_compat.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_compat.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_switch_hitter.rb
===================================================================
--- test/date/test_switch_hitter.rb	(revision 57431)
+++ test/date/test_switch_hitter.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_switch_hitter.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
@@ -577,29 +577,29 @@ class TestSH < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/date/test_switch_hitter.rb#L577
   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 https://github.com/ruby/ruby/blob/trunk/test/date/test_switch_hitter.rb#L617
       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
 
Index: test/date/test_date_conv.rb
===================================================================
--- test/date/test_date_conv.rb	(revision 57431)
+++ test/date/test_date_conv.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_conv.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_date_arith.rb
===================================================================
--- test/date/test_date_arith.rb	(revision 57431)
+++ test/date/test_date_arith.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_arith.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_date_marshal.rb
===================================================================
--- test/date/test_date_marshal.rb	(revision 57431)
+++ test/date/test_date_marshal.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_marshal.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_date_strptime.rb
===================================================================
--- test/date/test_date_strptime.rb	(revision 57431)
+++ test/date/test_date_strptime.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_strptime.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_date_new.rb
===================================================================
--- test/date/test_date_new.rb	(revision 57431)
+++ test/date/test_date_new.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_new.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_date_attr.rb
===================================================================
--- test/date/test_date_attr.rb	(revision 57431)
+++ test/date/test_date_attr.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_attr.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_date_base.rb
===================================================================
--- test/date/test_date_base.rb	(revision 57431)
+++ test/date/test_date_base.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_base.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 
Index: test/date/test_date_parse.rb
===================================================================
--- test/date/test_date_parse.rb	(revision 57431)
+++ test/date/test_date_parse.rb	(revision 57432)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/date/test_date_parse.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'date'
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]