* 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
This commit is contained in:
hsbt 2014-06-24 08:48:46 +00:00
Родитель 4c58cdc9a1
Коммит 4f7449beba
7 изменённых файлов: 24 добавлений и 15 удалений

Просмотреть файл

@ -1,3 +1,12 @@
Tue Jun 24 14:46:17 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
* 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@ruby-lang.org> Tue Jun 24 10:50:06 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* hash.c (env_path_str_new): make PATH environment variable * hash.c (env_path_str_new): make PATH environment variable

Просмотреть файл

@ -161,7 +161,7 @@ class GServer
# Return true to allow this client to connect, false to prevent it. # Return true to allow this client to connect, false to prevent it.
def connecting(client) def connecting(client)
addr = client.peeraddr 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") "#{addr[2]}<#{addr[3]}> connect")
true true
end end
@ -171,7 +171,7 @@ class GServer
# #
# +clientPort+:: the port of the client that is connecting # +clientPort+:: the port of the client that is connecting
def disconnecting(clientPort) def disconnecting(clientPort)
log("#{self.class.to_s} #{@host}:#{@port} " + log("#{self.class} #{@host}:#{@port} " +
"client:#{clientPort} disconnect") "client:#{clientPort} disconnect")
end end
@ -179,12 +179,12 @@ class GServer
# Called when the server is starting up, if auditing is enabled. # Called when the server is starting up, if auditing is enabled.
def starting() def starting()
log("#{self.class.to_s} #{@host}:#{@port} start") log("#{self.class} #{@host}:#{@port} start")
end end
# Called when the server is shutting down, if auditing is enabled. # Called when the server is shutting down, if auditing is enabled.
def stopping() def stopping()
log("#{self.class.to_s} #{@host}:#{@port} stop") log("#{self.class} #{@host}:#{@port} stop")
end end
protected :starting, :stopping protected :starting, :stopping

Просмотреть файл

@ -805,7 +805,7 @@ private
rescue rescue
log(FATAL, "Detected an exception. Stopping ... #{$!} (#{$!.class})\n" << $@.join("\n")) log(FATAL, "Detected an exception. Stopping ... #{$!} (#{$!.class})\n" << $@.join("\n"))
ensure ensure
log(INFO, "End of #{ @appname }. (status: #{ status.to_s })") log(INFO, "End of #{ @appname }. (status: #{ status })")
end end
status status
end end

Просмотреть файл

@ -1833,7 +1833,7 @@ XXX
end end
def inspect def inspect
"#<#{self.class.to_s}: #{args.join(' ')}>" "#<#{self.class}: #{args.join(' ')}>"
end end
# #

Просмотреть файл

@ -4,7 +4,7 @@ module ::RbConfig
class << Obsolete class << Obsolete
def _warn_ def _warn_
loc, = caller_locations(2, 1) 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." warn "#{loc}Use RbConfig instead of obsolete and deprecated Config."
self self
end end

Просмотреть файл

@ -1175,7 +1175,7 @@ class Resolv
end end
def inspect def inspect
return "#<#{self.class} #{self.to_s}>" return "#<#{self.class} #{self}>"
end end
def ==(other) def ==(other)
@ -1220,7 +1220,7 @@ class Resolv
end end
def inspect # :nodoc: def inspect # :nodoc:
"#<#{self.class}: #{self.to_s}#{@absolute ? '.' : ''}>" "#<#{self.class}: #{self}#{@absolute ? '.' : ''}>"
end end
## ##
@ -2346,7 +2346,7 @@ class Resolv
end end
def inspect # :nodoc: def inspect # :nodoc:
return "#<#{self.class} #{self.to_s}>" return "#<#{self.class} #{self}>"
end end
## ##
@ -2489,7 +2489,7 @@ class Resolv
end end
def inspect # :nodoc: def inspect # :nodoc:
return "#<#{self.class} #{self.to_s}>" return "#<#{self.class} #{self}>"
end end
## ##
@ -2639,7 +2639,7 @@ class Resolv
end end
def inspect # :nodoc: def inspect # :nodoc:
return "#<#{self.class} #{self.to_s}>" return "#<#{self.class} #{self}>"
end end
def ==(other) # :nodoc: def ==(other) # :nodoc:
@ -2728,7 +2728,7 @@ class Resolv
end end
def inspect # :nodoc: def inspect # :nodoc:
return "#<#{self.class} #{self.to_s}>" return "#<#{self.class} #{self}>"
end end
def ==(other) # :nodoc: def ==(other) # :nodoc:
@ -2790,7 +2790,7 @@ class Resolv
end end
def inspect # :nodoc: def inspect # :nodoc:
return "#<#{self.class} #{self.to_s}>" return "#<#{self.class} #{self}>"
end end
def ==(other) # :nodoc: def ==(other) # :nodoc:

Просмотреть файл

@ -321,7 +321,7 @@ module WEBrick
# res.set_redirect WEBrick::HTTPStatus::TemporaryRedirect # res.set_redirect WEBrick::HTTPStatus::TemporaryRedirect
def set_redirect(status, url) 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 @header['location'] = url.to_s
raise status raise status
end end