зеркало из https://github.com/github/ruby.git
* ext/socket/lib/socket.rb: use safe navigation operator.
[fix GH-1142] Patch by @mlarraz * lib/drb/extservm.rb: ditto. * lib/net/http.rb: ditto. * lib/net/http/response.rb: ditto. * lib/scanf.rb: ditto. * lib/uri/generic.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6cf568f4b5
Коммит
059c9c1cf3
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Mon Dec 14 17:04:14 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||
|
||||
* ext/socket/lib/socket.rb: use safe navigation operator.
|
||||
[fix GH-1142] Patch by @mlarraz
|
||||
* lib/drb/extservm.rb: ditto.
|
||||
* lib/net/http.rb: ditto.
|
||||
* lib/net/http/response.rb: ditto.
|
||||
* lib/scanf.rb: ditto.
|
||||
* lib/uri/generic.rb: ditto.
|
||||
|
||||
Mon Dec 14 17:03:05 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||
|
||||
* bootstraptest/runner.rb: use safe navigation operator.
|
||||
|
|
|
@ -1102,7 +1102,7 @@ class Socket < BasicSocket
|
|||
st = File.lstat(path)
|
||||
rescue Errno::ENOENT
|
||||
end
|
||||
if st && st.socket? && st.owned?
|
||||
if st&.socket? && st.owned?
|
||||
File.unlink path
|
||||
end
|
||||
end
|
||||
|
|
|
@ -37,7 +37,7 @@ module DRb
|
|||
synchronize do
|
||||
while true
|
||||
server = @servers[name]
|
||||
return server if server && server.alive?
|
||||
return server if server&.alive?
|
||||
invoke_service(name)
|
||||
@cond.wait
|
||||
end
|
||||
|
|
|
@ -1055,7 +1055,7 @@ module Net #:nodoc:
|
|||
# The address of the proxy server, if one is configured.
|
||||
def proxy_address
|
||||
if @proxy_from_env then
|
||||
proxy_uri && proxy_uri.hostname
|
||||
proxy_uri&.hostname
|
||||
else
|
||||
@proxy_address
|
||||
end
|
||||
|
@ -1064,7 +1064,7 @@ module Net #:nodoc:
|
|||
# The port of the proxy server, if one is configured.
|
||||
def proxy_port
|
||||
if @proxy_from_env then
|
||||
proxy_uri && proxy_uri.port
|
||||
proxy_uri&.port
|
||||
else
|
||||
@proxy_port
|
||||
end
|
||||
|
|
|
@ -251,7 +251,7 @@ class Net::HTTPResponse
|
|||
return yield @socket if self['content-range']
|
||||
|
||||
v = self['content-encoding']
|
||||
case v && v.downcase
|
||||
case v&.downcase
|
||||
when 'deflate', 'gzip', 'x-gzip' then
|
||||
self.delete 'content-encoding'
|
||||
|
||||
|
|
|
@ -471,8 +471,7 @@ module Scanf
|
|||
end
|
||||
|
||||
def width
|
||||
w = @spec_string[/%\*?(\d+)/, 1]
|
||||
w && w.to_i
|
||||
@spec_string[/%\*?(\d+)/, 1]&.to_i
|
||||
end
|
||||
|
||||
def mid_match?
|
||||
|
|
|
@ -1326,7 +1326,7 @@ module URI
|
|||
# Destructive version of #normalize
|
||||
#
|
||||
def normalize!
|
||||
if path && path.empty?
|
||||
if path&.empty?
|
||||
set_path('/')
|
||||
end
|
||||
if scheme && scheme != scheme.downcase
|
||||
|
|
Загрузка…
Ссылка в новой задаче