summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-10-21Avoid use of `self.class.new(self)` in Set#collect!knu
That prevents infinite recursion when a subclass of Set uses `collect!` in its constructor. This should fix [Bug #12437]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Fix comparison methods of Set to check if `@hash` is actually comparableknu
This should fix comparison of rbtree backed SortedSet instances. [Bug #12072] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Introduce Net::HTTP#min_version/max_version [Feature #9450]naruse
Set SSL minimum/maximum version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21less random generations in Random::Formatter#choose.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Use a mutex to make SortedSet.setup thread-safeknu
This should fix [Bug #13735]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Remove redundant use of module_evalknu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Allow a SortedSet to be frozen and still functional [Bug #12091]knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21SecureRandom.alphanumeric implemented.akr
[ruby-core:68098] [Feature #10849] proposed by Andrew Butterfield. SecureRandom.choose and SecureRandom.graph is not included. (The implementation has SecureRandom.choose but it is private.) I feel the method name, SecureRandom.choose, doesn't represent the behavior well. The actual use cases of SecureRandom.graph is not obvious. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21erb.rb: specify frozen_string_literal: truek0kubun
for compilation performance. $ ruby ./benchmark/driver.rb -e "trunk::/Users/k0kubun/.rbenv/versions/trunk/bin/ruby;modified::/Users/k0kubun/.rbenv/versions/modified/bin/ruby" -d ./benchmark -p app_erb ----------------------------------------------------------- benchmark results: Execution time (sec) name trunk modified app_erb 1.911 1.885 Speedup ratio: compare with the result of `trunk' (greater is better) name modified app_erb 1.014 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Use caller with length to reduce unused stringskazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Removed obsoleted safe level checks on irb.hsbt
https://github.com/ruby/ruby/pull/1713 Patch by @y-yagi [fix GH-1713] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Fixed unexpected behavior of `Resolv::MDNS#each_address` when given ".local" ↵hsbt
address. https://github.com/ruby/ruby/pull/1425 Patch by @elct9620 [fix GH-1484] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Import ipaddr 1.2.0knu
- Add IPAddr#prefix - Add IPAddr#loopback? - Add IPAddr#private? [Feature #11666] - Add IPAddr#link_local? [Feature #10912] - Reject invalid address mask [Bug #13399] - Warn that IPAddr#ipv4_compat and #ipv4_compat? are deprecated [#Bug 13769] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Fix bug about String#scanf("%a")nobu
* lib/scanf.rb (extract_float, initialize): allow to omit a sign on the binary exponent. [ruby-core:82435] [Bug #13833] [Fix GH-1689] From: tarotaro0 <tarousann11922960@yahoo.co.jp> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21Make ACL::ACLEntry not suppress IPAddr::InvalidPrefixErrorknu
This is because it would be a user error because a pattern containing a slash shouldn't be a host name pattern but an IP address pattern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21lib/open3.rb: accept IO-like object for :stdin_data argument.akr
Open3.capture3, Open3.capture2, Open3.capture2e accepts IO-like object for :stdin_data argument. [ruby-core:80936] [Feature #13527] proposed by janko. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-21lib/open-uri.rb: accept :encoding option as well as encoding in mode string.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-20Merge rubygems master(ddbf3203f3857649abe95c73edefc7de7e6ecff4).hsbt
It fixed: https://github.com/rubygems/rubygems/issues/2041 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-20Overwrite destination symlink file if `remove_destination` is set.hsbt
[Bug #13914][ruby-core:82846] Patch by @mzp https://github.com/ruby/fileutils/pull/9 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-20Make Time.parse respect timezone offset secondsnobu
DateTime.parse handles them correctly, and DateTime.parse.to_time results in the correct time. Time.parse doesn't handle them correctly because Time.zone_offset uses a different regexp that only considers hours and minutes, not seconds. [ruby-core:83400] [Bug #14034] From: Jeremy Evans <code@jeremyevans.net> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-18webrick: fix up r60172 and r60210normal
Thanks to MSP-Greg (Greg L) for helping with this. * lib/webrick/server.rb (start_thread): properly fix non-local return introduced in r60208 and r60210 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-18webrick: fix up r60172 and r60208normal
Thanks to MSP-Greg (Greg L) for helping with this. * lib/webrick/server.rb (start_thread): fix non-local return introduced in r60208 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-18webrick: fix up r60172 and revert r60189normal
Thanks to MSP-Greg (Greg L) for helping with this. * lib/webrick/server.rb (start_thread): ignore ECONNRESET, ECONNABORTED, EPROTO, and EINVAL on TLS negotiation errors the same way they were ignored before r60172 in the accept_client method of the main acceptor thread. [Bug #14013] [Bug #14005] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-17tempfile.rb: [DOC] all arguments [ci skip]nobu
* lib/tempfile.rb (Tempfile.create): mention the other arguments too. [ruby-core:83321] [Misc #14019] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-17Fix warning: assigned but unused variablekazu
[Bug #14020][ruby-core:83313] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-17Suppress leak of file descriptorsmame
`Bundler.ui=` in `Gem::TestCase#setup` creates `Bundler::UI::RGProxy` which inherites `::Gem::SilentUI` whose `initialize` opens `/dev/null`, and assigns it to `Gem::DefaultUserInteraction.ui`. After that, `Gem::TestCase#setup` forces to overwrite `Gem::DefaultUserInteraction.ui` with a mock. Thus, the instance of `::Gem::SilentUI` is not closed, which leads to the leak. This commit keeps `Gem::DefaultUserInteraction.ui` and manually close it in `teardown`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-16Layout fixes in rdoc of lib/tempfile.rb [ci skip]nobu
RDoc doesn't understand an asterisk inside the plus markers. Moving them out of the markers looks better. [Fix GH-1716] From: Herwin Weststrate <herwinw@herwinw.nl> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-16webrick: fix up r60172normal
By making the socket non-blocking in r60172, TLS/SSL negotiation via the SSL_accept function must handle non-blocking sockets properly and retry on SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE. OpenSSL::SSL::SSLSocket#accept cannot do that properly with a non-blocking socket, so it must use non-blocking logic of OpenSSL::SSL::SSLSocket#accept_nonblock. Thanks to MSP-Greg (Greg L) for finding this. * lib/webrick/server.rb (start_thread): use SSL_accept properly with non-blocking socket. [Bug #14013] [Bug #14005] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-12webrick: do not hang acceptor on slow TLS connectionsnormal
OpenSSL::SSL::SSLSocket#accept may block indefinitely on clients which negotiate the TCP connection, but fail (or are slow) to negotiate the subsequent TLS handshake. This prevents the multi-threaded WEBrick server from accepting other connections. Since the TLS handshake (via OpenSSL::SSL::SSLSocket#accept) consists of normal read/write traffic over TCP, handle it in the per-client thread, instead. Furthermore, using non-blocking accept() is useful for non-TLS sockets anyways because spurious wakeups are possible from select(2). * lib/webrick/server.rb (accept_client): use TCPServer#accept_nonblock and remove OpenSSL::SSL::SSLSocket#accept call * lib/webrick/server.rb (start_thread): call OpenSSL::SSL::SSLSocket#accept * test/webrick/test_ssl_server.rb (test_slow_connect): new test [ruby-core:83221] [Bug #14005] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-10Merge rubygems-2.6.14 changes.hsbt
It fixed http://blog.rubygems.org/2017/10/09/unsafe-object-deserialization-vulnerability.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-10Removed obsoleted test for RubyToken.hsbt
[Bug #13991][ruby-core:83188] Patch by MSP-Greg. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-10* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-10Merge rdoc-6.0.0.beta3.hsbt
* It version introduced did you mean? feature for ri command: https://github.com/ruby/rdoc/pull/533 * Removed obbsoleted ruby_token.rbb. [Bug #13990][ruby-core:83180] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-09webrick: avoid needless wakeup from IO.selectnormal
Since r51231 ("webrick/server.rb: stop immediately"), there is no need to poll on the @status change every two seconds. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08Removed unnecessary json loading.hsbt
It causes test fail on http://ci.rvm.jp/results/trunk-test@frontier/101990 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08Remove unnecessary `require 'thread'`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08* remove trailing spaces, append newline at EOF.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08Merge rubygems master.hsbt
This is RC version of Rubygems 2.7.0. https://github.com/rubygems/rubygems/commit/688fb7e83c13c3fe7c2bb03c49a2db4c82852aee git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-06No more ubygems in trunknobu
[Fix GH-1711] Author: MSP-Greg <MSP-Greg@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-05webrick: avoid unnecessary IO#sync= callnormal
Sockets and pipes are always created with FMODE_SYNC flag already set (otherwise many things would be broken). * lib/webrick/server.rb (accept_client): remove unnecessary IO#sync= call git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-05Fixed broken `bundle gem` command.hsbt
This patch is provided by @gyugyu (Yusuke Yagyu) * Remove README* entry from no_install that there is no README* files except README.md.tt * Rename .travis.yml.tt to travis.yml.tt like gitignore.tt [Bug #13975][ruby-dev:50278][fix GH-1710] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-05Fixed invalid gemspec.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-05Followed up [ruby-core:83093]. Update gemspec attributes.hsbt
Added metadata for rubygems.org. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-29Use unpack1 instead of unpack and `[0]`kazu
[Feature #13943][ruby-core:83027] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-28Net::HTTP.new: Support no_proxy parameter [Feature #11195]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-28URI::Generic: Separate no_proxy handlingnaruse
To share with Net::HTTP. see #11195 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-27Fix exception class [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-26Make retries for Net::HTTP configurable [Feature #10674]naruse
by stereobooster fix https://github.com/ruby/ruby/pull/1654 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-26erb.rb: drop unreachable methodk0kubun
This seems to be unreachable from first introduction at r21286. In ERB implementation, `#empty?` is only called for each member of return value of `String#scan`, and `ERB::Compiler::PercentLine` is never returned from `String#scan`. Also, in `ERB::Compiler#compile`, as it's yielded only when stag is nil, methods called to `ERB::Compiler::PercentLine` object yielded from `ERB::Compiler::TrimScanner#scan` are only: `#nil?`, `#==`, `to_s`. Thus `ERB::Compiler::PercentLine#empty?` is never used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-25HTTPHeader#add_field should allow binary [Bug #13926]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e