summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-11-15tmpdir.rb: merged make_tmpname to createnobu
* lib/tmpdir.rb (Dir::Tmpname#create): try conversion of prefix and suffix just once before loop. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09lib/matrix: Remove method catalog [doc] [ci-skip]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-09Merge rubygems-2.7.2.hsbt
This version fixes some setup commands. https://github.com/rubygems/rubygems/blob/01e797f6aa045fd09df7813d0b5448e3667172a9/History.txt#L3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07http.rb: improve docsstomar
* lib/net/http.rb: [DOC] fix typos and grammar git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-06Merge RubyGems 2.7.1.hsbt
* Fix `gem update --system` with RubyGems 2.7+. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-02rexml: improve docsstomar
* lib/rexml/entity.rb: [DOC] drop a pointless comment. Reported by Michael Gee (mikegee). [Fix GH-1736] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-02Merge release version of Rubygems 2.7.0.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01Update bundled bundler to 1.16.0.hsbt
* lib/bundler, spec/bundler: Merge bundler-1.16.0. * common.mk: rspec examples of bundler-1.16.0 needs require option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-31webrick/httpresponse: minor cleanups to reduce memory usenormal
I never knew "format" was a global method alias for "sprintf"; so it was confusing to me. Normally, one would use "sprintf" since it's also available in many other languages, but Integer#to_s avoids parsing a format string so it's less bug-prone. Furthermore, favor string interpolation over String#<< since it is easier for the VM to optimize memory allocation (as in r60320). Interpolation also reduces method calls and memory overhead for inline method cache. Finally, ensure we clear all short-lived buffers for body responses. A similar change was made and measured for Net::* in r58840 showing a large memory reduction on some workloads. * webrick/httpresponse.rb (send_body_io): favor String#to_s, reduce method calls for String#<<, clear `buf' when done, avoid extra String#bytesize calls * (send_body_string): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-30webrick: support Proc objects as body responsesnormal
* lib/webrick/httpresponse.rb (send_body): call send_body_proc (send_body_proc): new method (class ChunkedWrapper): new class * test/webrick/test_httpresponse.rb (test_send_body_proc): new test (test_send_body_proc_chunked): ditto [Feature #855] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-29lib/set.rb: improve docs for Set#===stomar
* lib/set.rb: [DOC] improve description and examples for Set#===. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-26Host header should add branckets to IPv6 address [Bug #12642]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25securerandom.rb: fix an example of choose [ci skip]nobu
* lib/securerandom.rb (Random::Formatter#choose): [DOC] fix an example, `n` is not optional. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24lib/ostruct.rb: Use frozen literals.marcandre
Patch adapted from Espartaco Palma. [GH-1714] [Bug #14000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24lib/weakref: Remove incorrect example [DOC] [Bug #14031]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24net/http: use require_relative to reduce syscallsnormal
require_relative speeds up loading of files by reducing path lookups. On a clean install with RubyGems-enabled, "ruby -rnet/http -e exit" shows a reduction in failed open(2) syscalls from 410 to 350 (x86-64 GNU/Linux). I could not measure a time difference on my Linux-based machines, however this should be noticeable to users of other kernels with worse syscall and VFS performance than Linux. Further use of require_relative will reduce lookups in other places. * lib/net/http.rb: use require_relative [ruby-core:78285] [Feature #12973] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22rss itunes: fix a bug that <itunes:explicit> value isn't fully supportedkou
Fix GH-1725 <itunes:explicit> accepts "explicit", "yes", "true", "clean", "no" and "false" as valid values. Here is the <itunes:explicit>'s description in https://help.apple.com/itc/podcasts_connect/#/itcb54353390: > The <itunes:explicit> tag indicates whether your podcast contains > explicit material. You can specify the following values: > > * Yes | Explicit | True. If you specify yes, explicit, or true, > indicating the presence of explicit content, the iTunes Store > displays an Explicit parental advisory graphic for your podcast. > > * Clean | No | False. If you specify clean, no, or false, indicating > that none of your podcast episodes contain explicit language or > adult content, the iTunes Store displays a Clean parental > advisory graphic for your podcast. I don't know whether <itunes:explicit> value is case sensitive or insensitive. But the current implementation is case insensitive. Reported by Valerie Woolard Srinivasan. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Add `Set#reset`knu
This method resets the internal state of a set after modification to existing elements, reindexing and deduplicating them. [Feature #6589] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22Fixed misspelling words.hsbt
These are detected by https://github.com/client9/misspell git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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