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

ruby-changes:34462

From: hsbt <ko1@a...>
Date: Tue, 24 Jun 2014 17:49:03 +0900 (JST)
Subject: [ruby-changes:34462] hsbt:r46543 (trunk): * lib/gserver.rb: remove redundant use of to_s in interpolation.

hsbt	2014-06-24 17:48:46 +0900 (Tue, 24 Jun 2014)

  New Revision: 46543

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

  Log:
    * lib/gserver.rb: remove redundant use of to_s in interpolation.
    * lib/logger.rb: ditto.
    * lib/optparse.rb: ditto.
    * lib/rbconfig/obsolete.rb: ditto.
    * lib/resolv.rb: ditto.
    * lib/webrick/httpresponse.rb: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/lib/gserver.rb
    trunk/lib/logger.rb
    trunk/lib/optparse.rb
    trunk/lib/rbconfig/obsolete.rb
    trunk/lib/resolv.rb
    trunk/lib/webrick/httpresponse.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46542)
+++ ChangeLog	(revision 46543)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jun 24 14:46:17 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* lib/gserver.rb: remove redundant use of to_s in interpolation.
+	* lib/logger.rb: ditto.
+	* lib/optparse.rb: ditto.
+	* lib/rbconfig/obsolete.rb: ditto.
+	* lib/resolv.rb: ditto.
+	* lib/webrick/httpresponse.rb: ditto.
+
 Tue Jun 24 10:50:06 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* hash.c (env_path_str_new): make PATH environment variable
Index: lib/gserver.rb
===================================================================
--- lib/gserver.rb	(revision 46542)
+++ lib/gserver.rb	(revision 46543)
@@ -161,7 +161,7 @@ class GServer https://github.com/ruby/ruby/blob/trunk/lib/gserver.rb#L161
   # Return true to allow this client to connect, false to prevent it.
   def connecting(client)
     addr = client.peeraddr
-    log("#{self.class.to_s} #{@host}:#{@port} client:#{addr[1]} " +
+    log("#{self.class} #{@host}:#{@port} client:#{addr[1]} " +
         "#{addr[2]}<#{addr[3]}> connect")
     true
   end
@@ -171,7 +171,7 @@ class GServer https://github.com/ruby/ruby/blob/trunk/lib/gserver.rb#L171
   #
   # +clientPort+:: the port of the client that is connecting
   def disconnecting(clientPort)
-    log("#{self.class.to_s} #{@host}:#{@port} " +
+    log("#{self.class} #{@host}:#{@port} " +
       "client:#{clientPort} disconnect")
   end
 
@@ -179,12 +179,12 @@ class GServer https://github.com/ruby/ruby/blob/trunk/lib/gserver.rb#L179
 
   # Called when the server is starting up, if auditing is enabled.
   def starting()
-    log("#{self.class.to_s} #{@host}:#{@port} start")
+    log("#{self.class} #{@host}:#{@port} start")
   end
 
   # Called when the server is shutting down, if auditing is enabled.
   def stopping()
-    log("#{self.class.to_s} #{@host}:#{@port} stop")
+    log("#{self.class} #{@host}:#{@port} stop")
   end
 
   protected :starting, :stopping
Index: lib/resolv.rb
===================================================================
--- lib/resolv.rb	(revision 46542)
+++ lib/resolv.rb	(revision 46543)
@@ -1175,7 +1175,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L1175
         end
 
         def inspect
-          return "#<#{self.class} #{self.to_s}>"
+          return "#<#{self.class} #{self}>"
         end
 
         def ==(other)
@@ -1220,7 +1220,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L1220
       end
 
       def inspect # :nodoc:
-        "#<#{self.class}: #{self.to_s}#{@absolute ? '.' : ''}>"
+        "#<#{self.class}: #{self}#{@absolute ? '.' : ''}>"
       end
 
       ##
@@ -2346,7 +2346,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L2346
     end
 
     def inspect # :nodoc:
-      return "#<#{self.class} #{self.to_s}>"
+      return "#<#{self.class} #{self}>"
     end
 
     ##
@@ -2489,7 +2489,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L2489
     end
 
     def inspect # :nodoc:
-      return "#<#{self.class} #{self.to_s}>"
+      return "#<#{self.class} #{self}>"
     end
 
     ##
@@ -2639,7 +2639,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L2639
       end
 
       def inspect # :nodoc:
-        return "#<#{self.class} #{self.to_s}>"
+        return "#<#{self.class} #{self}>"
       end
 
       def ==(other) # :nodoc:
@@ -2728,7 +2728,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L2728
       end
 
       def inspect # :nodoc:
-        return "#<#{self.class} #{self.to_s}>"
+        return "#<#{self.class} #{self}>"
       end
 
       def ==(other) # :nodoc:
@@ -2790,7 +2790,7 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/lib/resolv.rb#L2790
       end
 
       def inspect # :nodoc:
-        return "#<#{self.class} #{self.to_s}>"
+        return "#<#{self.class} #{self}>"
       end
 
       def ==(other) # :nodoc:
Index: lib/webrick/httpresponse.rb
===================================================================
--- lib/webrick/httpresponse.rb	(revision 46542)
+++ lib/webrick/httpresponse.rb	(revision 46543)
@@ -321,7 +321,7 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/httpresponse.rb#L321
     #   res.set_redirect WEBrick::HTTPStatus::TemporaryRedirect
 
     def set_redirect(status, url)
-      @body = "<HTML><A HREF=\"#{url.to_s}\">#{url.to_s}</A>.</HTML>\n"
+      @body = "<HTML><A HREF=\"#{url}\">#{url}</A>.</HTML>\n"
       @header['location'] = url.to_s
       raise status
     end
Index: lib/logger.rb
===================================================================
--- lib/logger.rb	(revision 46542)
+++ lib/logger.rb	(revision 46543)
@@ -805,7 +805,7 @@ private https://github.com/ruby/ruby/blob/trunk/lib/logger.rb#L805
       rescue
         log(FATAL, "Detected an exception. Stopping ... #{$!} (#{$!.class})\n" << $@.join("\n"))
       ensure
-        log(INFO, "End of #{ @appname }. (status: #{ status.to_s })")
+        log(INFO, "End of #{ @appname }. (status: #{ status })")
       end
       status
     end
Index: lib/rbconfig/obsolete.rb
===================================================================
--- lib/rbconfig/obsolete.rb	(revision 46542)
+++ lib/rbconfig/obsolete.rb	(revision 46543)
@@ -4,7 +4,7 @@ module ::RbConfig https://github.com/ruby/ruby/blob/trunk/lib/rbconfig/obsolete.rb#L4
   class << Obsolete
     def _warn_
       loc, = caller_locations(2, 1)
-      loc = "#{loc.to_s}: " if loc
+      loc = "#{loc}: " if loc
       warn "#{loc}Use RbConfig instead of obsolete and deprecated Config."
       self
     end
Index: lib/optparse.rb
===================================================================
--- lib/optparse.rb	(revision 46542)
+++ lib/optparse.rb	(revision 46543)
@@ -1833,7 +1833,7 @@ XXX https://github.com/ruby/ruby/blob/trunk/lib/optparse.rb#L1833
     end
 
     def inspect
-      "#<#{self.class.to_s}: #{args.join(' ')}>"
+      "#<#{self.class}: #{args.join(' ')}>"
     end
 
     #

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

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