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

ruby-changes:40495

From: akr <ko1@a...>
Date: Sat, 14 Nov 2015 22:15:50 +0900 (JST)
Subject: [ruby-changes:40495] akr:r52576 (trunk): * ext/socket/lib/socket.rb: Specify frozen_string_literal: true.

akr	2015-11-14 22:15:33 +0900 (Sat, 14 Nov 2015)

  New Revision: 52576

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

  Log:
    * ext/socket/lib/socket.rb: Specify frozen_string_literal: true.

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/lib/socket.rb
    trunk/test/socket/test_addrinfo.rb
    trunk/test/socket/test_ancdata.rb
    trunk/test/socket/test_basicsocket.rb
    trunk/test/socket/test_nonblock.rb
    trunk/test/socket/test_socket.rb
    trunk/test/socket/test_sockopt.rb
    trunk/test/socket/test_tcp.rb
    trunk/test/socket/test_udp.rb
    trunk/test/socket/test_unix.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52575)
+++ ChangeLog	(revision 52576)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Nov 14 22:15:07 2015  Tanaka Akira  <akr@f...>
+
+	* ext/socket/lib/socket.rb: Specify frozen_string_literal: true.
+
 Sat Nov 14 21:44:56 2015  Tanaka Akira  <akr@f...>
 
 	* lib/time.rb: Use "<<" to reduce string allocation.
Index: ext/socket/lib/socket.rb
===================================================================
--- ext/socket/lib/socket.rb	(revision 52575)
+++ ext/socket/lib/socket.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ext/socket/lib/socket.rb#L1
+# frozen_string_literal: true
+
 require 'socket.so'
 require 'io/wait'
 
@@ -747,7 +749,7 @@ class Socket < BasicSocket https://github.com/ruby/ruby/blob/trunk/ext/socket/lib/socket.rb#L749
     attr_reader :local_address
 
     def inspect # :nodoc:
-      "\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>"
+      "\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>".dup
     end
 
     # Sends the String +msg+ to the source
Index: test/socket/test_sockopt.rb
===================================================================
--- test/socket/test_sockopt.rb	(revision 52575)
+++ test/socket/test_sockopt.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/socket/test_sockopt.rb#L1
+# frozen_string_literal: true
+
 require 'test/unit'
 require 'socket'
 
Index: test/socket/test_unix.rb
===================================================================
--- test/socket/test_unix.rb	(revision 52575)
+++ test/socket/test_unix.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/socket/test_unix.rb#L1
+# frozen_string_literal: true
+
 begin
   require "socket"
 rescue LoadError
@@ -386,7 +388,7 @@ class TestSocket_UNIXSocket < Test::Unit https://github.com/ruby/ruby/blob/trunk/test/socket/test_unix.rb#L388
     assert_equal("", s1.recv(10))
     assert_raise(IO::EAGAINWaitReadable) { s1.recv_nonblock(10) }
 
-    buf = ""
+    buf = "".dup
     s2.send("BBBBBB", 0)
     IO.select([s1])
     rv = s1.recv(100, 0, buf)
Index: test/socket/test_nonblock.rb
===================================================================
--- test/socket/test_nonblock.rb	(revision 52575)
+++ test/socket/test_nonblock.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/socket/test_nonblock.rb#L1
+# frozen_string_literal: true
+
 begin
   require "socket"
   require "io/nonblock"
@@ -129,7 +131,7 @@ class TestSocketNonblock < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/socket/test_nonblock.rb#L131
     mesg = u1.recv_nonblock(100)
     assert_equal("", mesg)
 
-    buf = "short"
+    buf = "short".dup
     out = "hello world" * 4
     out.freeze
     u2.send(out, 0, u1.getsockname)
Index: test/socket/test_addrinfo.rb
===================================================================
--- test/socket/test_addrinfo.rb	(revision 52575)
+++ test/socket/test_addrinfo.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/socket/test_addrinfo.rb#L1
+# frozen_string_literal: true
+
 begin
   require "socket"
 rescue LoadError
Index: test/socket/test_tcp.rb
===================================================================
--- test/socket/test_tcp.rb	(revision 52575)
+++ test/socket/test_tcp.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/socket/test_tcp.rb#L1
+# frozen_string_literal: true
+
 begin
   require "socket"
   require "test/unit"
Index: test/socket/test_socket.rb
===================================================================
--- test/socket/test_socket.rb	(revision 52575)
+++ test/socket/test_socket.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/socket/test_socket.rb#L1
+# frozen_string_literal: true
+
 begin
   require "socket"
   require "tmpdir"
Index: test/socket/test_udp.rb
===================================================================
--- test/socket/test_udp.rb	(revision 52575)
+++ test/socket/test_udp.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/socket/test_udp.rb#L1
+# frozen_string_literal: true
+
 begin
   require "socket"
   require "test/unit"
Index: test/socket/test_basicsocket.rb
===================================================================
--- test/socket/test_basicsocket.rb	(revision 52575)
+++ test/socket/test_basicsocket.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/socket/test_basicsocket.rb#L1
+# frozen_string_literal: true
+
 begin
   require "socket"
   require "test/unit"
Index: test/socket/test_ancdata.rb
===================================================================
--- test/socket/test_ancdata.rb	(revision 52575)
+++ test/socket/test_ancdata.rb	(revision 52576)
@@ -1,3 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/test/socket/test_ancdata.rb#L1
+# frozen_string_literal: true
+
 require 'test/unit'
 require 'socket'
 

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

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