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

ruby-changes:45203

From: kazu <ko1@a...>
Date: Sat, 7 Jan 2017 11:14:16 +0900 (JST)
Subject: [ruby-changes:45203] kazu:r57275 (trunk): lib/fileutils.rb: Specify frozen_string_literal: true.

kazu	2017-01-07 11:14:07 +0900 (Sat, 07 Jan 2017)

  New Revision: 57275

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

  Log:
    lib/fileutils.rb: Specify frozen_string_literal: true.

  Modified files:
    trunk/lib/fileutils.rb
    trunk/test/fileutils/clobber.rb
    trunk/test/fileutils/fileasserts.rb
    trunk/test/fileutils/test_dryrun.rb
    trunk/test/fileutils/test_fileutils.rb
    trunk/test/fileutils/test_nowrite.rb
    trunk/test/fileutils/test_verbose.rb
    trunk/test/fileutils/visibility_tests.rb
Index: lib/fileutils.rb
===================================================================
--- lib/fileutils.rb	(revision 57274)
+++ lib/fileutils.rb	(revision 57275)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 #
 # = fileutils.rb
 #
@@ -735,8 +735,8 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L735
   #
   def compare_stream(a, b)
     bsize = fu_stream_blksize(a, b)
-    sa = ""
-    sb = ""
+    sa = String.new(capacity: bsize)
+    sb = String.new(capacity: bsize)
     begin
       a.read(bsize, sa)
       b.read(bsize, sb)
@@ -1432,9 +1432,9 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1432
     end
 
     if File::ALT_SEPARATOR
-      DIRECTORY_TERM = "(?=[/#{Regexp.quote(File::ALT_SEPARATOR)}]|\\z)".freeze
+      DIRECTORY_TERM = "(?=[/#{Regexp.quote(File::ALT_SEPARATOR)}]|\\z)"
     else
-      DIRECTORY_TERM = "(?=/|\\z)".freeze
+      DIRECTORY_TERM = "(?=/|\\z)"
     end
     SYSCASE = File::FNM_SYSCASE.nonzero? ? "-i" : ""
 
Index: test/fileutils/test_fileutils.rb
===================================================================
--- test/fileutils/test_fileutils.rb	(revision 57274)
+++ test/fileutils/test_fileutils.rb	(revision 57275)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 # $Id$
 
 require 'fileutils'
Index: test/fileutils/test_dryrun.rb
===================================================================
--- test/fileutils/test_dryrun.rb	(revision 57274)
+++ test/fileutils/test_dryrun.rb	(revision 57275)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_dryrun.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 # $Id$
 
 require 'fileutils'
Index: test/fileutils/fileasserts.rb
===================================================================
--- test/fileutils/fileasserts.rb	(revision 57274)
+++ test/fileutils/fileasserts.rb	(revision 57275)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fileutils/fileasserts.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 # $Id$
 
 module Test
Index: test/fileutils/test_verbose.rb
===================================================================
--- test/fileutils/test_verbose.rb	(revision 57274)
+++ test/fileutils/test_verbose.rb	(revision 57275)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_verbose.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 # $Id$
 
 require 'test/unit'
Index: test/fileutils/test_nowrite.rb
===================================================================
--- test/fileutils/test_nowrite.rb	(revision 57274)
+++ test/fileutils/test_nowrite.rb	(revision 57275)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_nowrite.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 # $Id$
 
 require 'fileutils'
Index: test/fileutils/clobber.rb
===================================================================
--- test/fileutils/clobber.rb	(revision 57274)
+++ test/fileutils/clobber.rb	(revision 57275)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fileutils/clobber.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'fileutils'
 require 'test/unit'
 require 'tmpdir'
Index: test/fileutils/visibility_tests.rb
===================================================================
--- test/fileutils/visibility_tests.rb	(revision 57274)
+++ test/fileutils/visibility_tests.rb	(revision 57275)
@@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/fileutils/visibility_tests.rb#L1
-# frozen_string_literal: false
+# frozen_string_literal: true
 require 'test/unit'
 require 'fileutils'
 

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

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