From 4f7449bebae380c2f60530d2b9a51a703f2f7cb6 Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 24 Jun 2014 08:48:46 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++++ lib/gserver.rb | 8 ++++---- lib/logger.rb | 2 +- lib/optparse.rb | 2 +- lib/rbconfig/obsolete.rb | 2 +- lib/resolv.rb | 14 +++++++------- lib/webrick/httpresponse.rb | 2 +- 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1926de2607..6efb1855f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Jun 24 14:46:17 2014 SHIBATA Hiroshi + + * 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 * hash.c (env_path_str_new): make PATH environment variable diff --git a/lib/gserver.rb b/lib/gserver.rb index d7b4a0783e..78593ee45d 100644 --- a/lib/gserver.rb +++ b/lib/gserver.rb @@ -161,7 +161,7 @@ class GServer # 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 # # +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 # 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 diff --git a/lib/logger.rb b/lib/logger.rb index 7d76d25e33..79944fa93c 100644 --- a/lib/logger.rb +++ b/lib/logger.rb @@ -805,7 +805,7 @@ private 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 diff --git a/lib/optparse.rb b/lib/optparse.rb index 1e3986afd7..6d12064b5d 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -1833,7 +1833,7 @@ XXX end def inspect - "#<#{self.class.to_s}: #{args.join(' ')}>" + "#<#{self.class}: #{args.join(' ')}>" end # diff --git a/lib/rbconfig/obsolete.rb b/lib/rbconfig/obsolete.rb index 7025fb43fb..52bc5c20d4 100644 --- a/lib/rbconfig/obsolete.rb +++ b/lib/rbconfig/obsolete.rb @@ -4,7 +4,7 @@ module ::RbConfig 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 diff --git a/lib/resolv.rb b/lib/resolv.rb index 7b2f7f031c..9c7dd1b9b3 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -1175,7 +1175,7 @@ class Resolv end def inspect - return "#<#{self.class} #{self.to_s}>" + return "#<#{self.class} #{self}>" end def ==(other) @@ -1220,7 +1220,7 @@ class Resolv end def inspect # :nodoc: - "#<#{self.class}: #{self.to_s}#{@absolute ? '.' : ''}>" + "#<#{self.class}: #{self}#{@absolute ? '.' : ''}>" end ## @@ -2346,7 +2346,7 @@ class Resolv end def inspect # :nodoc: - return "#<#{self.class} #{self.to_s}>" + return "#<#{self.class} #{self}>" end ## @@ -2489,7 +2489,7 @@ class Resolv end def inspect # :nodoc: - return "#<#{self.class} #{self.to_s}>" + return "#<#{self.class} #{self}>" end ## @@ -2639,7 +2639,7 @@ class Resolv end def inspect # :nodoc: - return "#<#{self.class} #{self.to_s}>" + return "#<#{self.class} #{self}>" end def ==(other) # :nodoc: @@ -2728,7 +2728,7 @@ class Resolv end def inspect # :nodoc: - return "#<#{self.class} #{self.to_s}>" + return "#<#{self.class} #{self}>" end def ==(other) # :nodoc: @@ -2790,7 +2790,7 @@ class Resolv end def inspect # :nodoc: - return "#<#{self.class} #{self.to_s}>" + return "#<#{self.class} #{self}>" end def ==(other) # :nodoc: diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb index 9656f81b83..e897e8c01b 100644 --- a/lib/webrick/httpresponse.rb +++ b/lib/webrick/httpresponse.rb @@ -321,7 +321,7 @@ module WEBrick # res.set_redirect WEBrick::HTTPStatus::TemporaryRedirect def set_redirect(status, url) - @body = "#{url.to_s}.\n" + @body = "#{url}.\n" @header['location'] = url.to_s raise status end