aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib/matrix: Remove method catalog [doc] [ci-skip]marcandre2017-11-091-104/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rubygems-2.7.2.hsbt2017-11-092-1/+25
| | | | | | | 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
* http.rb: improve docsstomar2017-11-071-5/+5
| | | | | | * 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
* Merge RubyGems 2.7.1.hsbt2017-11-062-2/+6
| | | | | | * 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
* rexml: improve docsstomar2017-11-021-2/+1
| | | | | | | * 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
* Merge release version of Rubygems 2.7.0.hsbt2017-11-022-2/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update bundled bundler to 1.16.0.hsbt2017-11-01156-1512/+5231
| | | | | | | * 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
* webrick/httpresponse: minor cleanups to reduce memory usenormal2017-10-311-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* webrick: support Proc objects as body responsesnormal2017-10-301-0/+35
| | | | | | | | | | | | * 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
* lib/set.rb: improve docs for Set#===stomar2017-10-291-6/+11
| | | | | | * 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
* Host header should add branckets to IPv6 address [Bug #12642]naruse2017-10-261-5/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* securerandom.rb: fix an example of choose [ci skip]nobu2017-10-251-1/+1
| | | | | | | * 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
* lib/ostruct.rb: Use frozen literals.marcandre2017-10-241-16/+11
| | | | | | 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
* lib/weakref: Remove incorrect example [DOC] [Bug #14031]marcandre2017-10-241-47/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* net/http: use require_relative to reduce syscallsnormal2017-10-241-10/+10
| | | | | | | | | | | | | | | | | | | 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
* rss itunes: fix a bug that <itunes:explicit> value isn't fully supportedkou2017-10-224-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add `Set#reset`knu2017-10-221-0/+18
| | | | | | | 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
* Fixed misspelling words.hsbt2017-10-222-3/+3
| | | | | | 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
* Avoid use of `self.class.new(self)` in Set#collect!knu2017-10-211-1/+3
| | | | | | | | | 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
* Fix comparison methods of Set to check if `@hash` is actually comparableknu2017-10-211-4/+4
| | | | | | | 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
* Introduce Net::HTTP#min_version/max_version [Feature #9450]naruse2017-10-211-0/+10
| | | | | | Set SSL minimum/maximum version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* less random generations in Random::Formatter#choose.akr2017-10-211-1/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use a mutex to make SortedSet.setup thread-safeknu2017-10-211-90/+92
| | | | | | This should fix [Bug #13735]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove redundant use of module_evalknu2017-10-211-8/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Allow a SortedSet to be frozen and still functional [Bug #12091]knu2017-10-211-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* SecureRandom.alphanumeric implemented.akr2017-10-211-2/+42
| | | | | | | | | | | | | | | | [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
* erb.rb: specify frozen_string_literal: truek0kubun2017-10-211-7/+7
| | | | | | | | | | | | | | | | | | 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
* Use caller with length to reduce unused stringskazu2017-10-215-18/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Removed obsoleted safe level checks on irb.hsbt2017-10-211-3/+0
| | | | | | | | 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
* Fixed unexpected behavior of `Resolv::MDNS#each_address` when given ".local" ↵hsbt2017-10-211-1/+1
| | | | | | | | | | 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
* Import ipaddr 1.2.0knu2017-10-212-3/+89
| | | | | | | | | | | - 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
* Fix bug about String#scanf("%a")nobu2017-10-211-3/+3
| | | | | | | | | | * 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
* Make ACL::ACLEntry not suppress IPAddr::InvalidPrefixErrorknu2017-10-211-0/+7
| | | | | | | 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
* lib/open3.rb: accept IO-like object for :stdin_data argument.akr2017-10-211-3/+15
| | | | | | | | | | 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
* lib/open-uri.rb: accept :encoding option as well as encoding in mode string.akr2017-10-211-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge rubygems master(ddbf3203f3857649abe95c73edefc7de7e6ecff4).hsbt2017-10-201-3/+7
| | | | | | 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
* Overwrite destination symlink file if `remove_destination` is set.hsbt2017-10-201-1/+1
| | | | | | | [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
* Make Time.parse respect timezone offset secondsnobu2017-10-201-2/+2
| | | | | | | | | | | | 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
* webrick: fix up r60172 and r60210normal2017-10-181-5/+5
| | | | | | | | | 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
* webrick: fix up r60172 and r60208normal2017-10-181-5/+5
| | | | | | | | | 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
* webrick: fix up r60172 and revert r60189normal2017-10-181-9/+6
| | | | | | | | | | | | 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
* tempfile.rb: [DOC] all arguments [ci skip]nobu2017-10-171-1/+2
| | | | | | | * 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
* Fix warning: assigned but unused variablekazu2017-10-171-2/+2
| | | | | | [Bug #14020][ruby-core:83313] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Suppress leak of file descriptorsmame2017-10-171-0/+3
| | | | | | | | | | | | | | | `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
* Layout fixes in rdoc of lib/tempfile.rb [ci skip]nobu2017-10-161-2/+2
| | | | | | | | | | 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
* webrick: fix up r60172normal2017-10-161-1/+9
| | | | | | | | | | | | | | | | | 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
* webrick: do not hang acceptor on slow TLS connectionsnormal2017-10-121-10/+24
| | | | | | | | | | | | | | | | | | | | | | | 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
* Merge rubygems-2.6.14 changes.hsbt2017-10-106-6/+55
| | | | | | 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
* Removed obsoleted test for RubyToken.hsbt2017-10-101-1/+0
| | | | | | [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
* * remove trailing spaces.svn2017-10-101-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e