Граф коммитов

6573 Коммитов

Автор SHA1 Сообщение Дата
nobu 90048176cc Make Time.parse respect timezone offset seconds
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-20 01:03:18 +00:00
normal cda27e1a6d webrick: fix up r60172 and r60210
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-18 23:34:02 +00:00
normal 834c252e5e webrick: fix up r60172 and r60208
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-18 23:23:33 +00:00
normal 3b1db7d319 webrick: fix up r60172 and revert r60189
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-18 21:45:34 +00:00
nobu 593d978646 tempfile.rb: [DOC] all arguments [ci skip]
* 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-17 12:40:00 +00:00
kazu 73d128ff2c Fix warning: assigned but unused variable
[Bug #14020][ruby-core:83313]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-17 11:58:51 +00:00
mame 16b6fe17a3 Suppress leak of file descriptors
`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-17 07:41:03 +00:00
nobu 6b4cd8a996 Layout fixes in rdoc of lib/tempfile.rb [ci skip]
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-16 23:11:40 +00:00
normal 525ebb862e webrick: fix up r60172
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-16 04:33:53 +00:00
normal feafe07874 webrick: do not hang acceptor on slow TLS connections
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-12 18:50:07 +00:00
hsbt 500f15e507 Merge rubygems-2.6.14 changes.
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-10 08:58:22 +00:00
hsbt 6d86ee593a Removed obsoleted test for RubyToken.
[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 04:54:49 +00:00
svn f05f1ecb2d * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-10 02:01:01 +00:00
hsbt db6c51ec4f Merge rdoc-6.0.0.beta3.
* 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-10 02:01:00 +00:00
normal 4c6335e93b webrick: avoid needless wakeup from IO.select
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-09 19:00:22 +00:00
hsbt cb69638dd1 Removed unnecessary json loading.
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-08 09:13:03 +00:00
kazu 6064132c42 Remove unnecessary `require 'thread'`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08 07:00:01 +00:00
svn 3b1d6fc168 * remove trailing spaces, append newline at EOF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08 01:32:22 +00:00
hsbt c00e84327f Merge rubygems master.
This is RC version of Rubygems 2.7.0.
  688fb7e83c

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08 01:32:18 +00:00
nobu 9de6c712b6 No more ubygems in trunk
[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-06 00:15:08 +00:00
normal 0d2ab887f3 webrick: avoid unnecessary IO#sync= call
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-05 21:53:54 +00:00
hsbt 5b3d137b1f Fixed broken `bundle gem` command.
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-05 08:32:01 +00:00
hsbt d002f23024 Fixed invalid gemspec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-05 01:43:47 +00:00
hsbt a6ac6e0098 Followed up [ruby-core:83093]. Update gemspec attributes.
Added metadata for rubygems.org.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-05 01:30:08 +00:00
kazu 5723d9fd34 Use unpack1 instead of unpack and `[0]`
[Feature #13943][ruby-core:83027]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-29 11:00:00 +00:00
naruse c4130b0958 Net::HTTP.new: Support no_proxy parameter [Feature #11195]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-28 10:51:37 +00:00
naruse ec7c76c446 URI::Generic: Separate no_proxy handling
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-28 10:51:31 +00:00
kazu 8aebd7e9eb Fix exception class [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-27 12:32:57 +00:00
naruse 4f4d724720 Make retries for Net::HTTP configurable [Feature #10674]
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-26 14:00:25 +00:00
k0kubun 9d389d6510 erb.rb: drop unreachable method
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-26 11:50:07 +00:00
naruse 56f91c6ec5 HTTPHeader#add_field should allow binary [Bug #13926]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-25 14:28:53 +00:00
hsbt e5e1f904d5 Removed ubygems.rb. rubygems.rb is always loaded now.
* tool/sync_default_gems.rb: removed ubygems.rb from sync target.
  * test/rubygems/test_gem.rb: only enable "-rubygems" option when
    running under the Ruby 1.9.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-24 07:52:25 +00:00
hsbt 1aa4a40d4f Integrate LICENSE file of rubygems to LEGAL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-23 02:24:27 +00:00
eregon 2dd35a7453 Prefer adapting specs to complicating library code
* lib/net/ftp.rb (Net::FTP#initialize): simplify as per
  the original intent.
* spec/ruby/library/net/ftp/initialize_spec.rb: adapt specs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20 21:50:14 +00:00
eregon aaf07f7ad5 Adapt tools to follow spec/rubyspec => spec/ruby rename
* [Misc #13792] [ruby-core:82287]
* Prefer test-spec over test-rubyspec in spec/README.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20 20:19:54 +00:00
shugo da1b14bcec Add MonitorMinx#mon_locked? and #mon_owned? to check states of objects
Patched by Satoshi "Moris" Tagomori <tagomoris@gmail.com>.  [Fix GH-1699]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-20 01:40:53 +00:00
knu 2aee703e7a Alias Set#=== to #include?
* set.rb (Set#===): Added via [Feature #13801] by davidarnold.

Closes #1673.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-19 08:45:12 +00:00
normal b40a9475db webrick: handle EAGAIN/EWOULDBLOCK on proxy connections
* lib/webrick/httpproxy.rb (do_CONNECT): high-level IO methods
  [ruby-core:82861] [Bug #12130]
  Patch by: Keisuke NISHI

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-19 08:39:22 +00:00
hsbt 2b86b6f333 Define the MIME type for JSON in WEBrick::HTTPUtils::DefaultMimeTypes.
[Feature #10798][ruby-core:67879]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-19 01:54:28 +00:00
nobu 2635984cf2 fileutils.rb: error at rmdir
* lib/fileutils.rb (rmdir): should not ignore errors first, except
  for parent directories.  [ruby-dev:50236] [Bug #13889]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-16 11:59:47 +00:00
hsbt 274c6180b7 To use github url for gemspec.
[Bug #13906][ruby-core:82817]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-15 23:46:46 +00:00
naruse b2996b30d9 Find.find -> Use Dir.children instead of Dir.entries
Dir.children is available since Feature #11302.
Find.find can use of the new list (having no '.' neither '..' entries),
making now superflous an if statement.

This change can improve the performance of Find.find when the path
has lots of entries (thousands?).

https://bugs.ruby-lang.org/issues/11302
patched by Espartaco Palma <esparta@gmail.com>
https://github.com/ruby/ruby/pull/1697 fix GH-1697
[Feature #13896]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-15 17:00:49 +00:00
naruse 16225d823d include query parameters in Net::HTTP.post
patched by Samuel Giddins <segiddins@segiddins.me>
https://github.com/ruby/ruby/pull/1686 fix GH-1686

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-15 16:53:55 +00:00
mame 6617c41292 lib/webrick/log.rb: sanitize any type of logs
It had failed to sanitize some type of exception messages.  Reported and
patched by Yusuke Endoh (mame) at https://hackerone.com/reports/223363

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-14 11:16:23 +00:00
hsbt 4d5c414fcc Update gemspec for gem released versions.
* These are dbm, fcntl, io-console, sdbm, stringio, strscan, zlib,
    cmath, scanf.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-14 02:01:36 +00:00
ko1 9ea2102e57 remove an unused variable (sometimes it fails test).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-14 01:55:59 +00:00
hsbt a8c632972f Removed needless magic-comment for encodings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-13 09:06:34 +00:00
hsbt 6336b394ec Fixup r59856. Added workaround for JRuby.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-13 09:06:05 +00:00
hsbt 71f98748a9 Added executable to bundler template.
It's same as upstream permission.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-13 02:36:46 +00:00
hsbt 672848de47 Partly reverted r59845.
All of environments on Ruby CI are fails rdoc generation.
  It may be caused by
  8cfa11d6f1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-12 12:51:43 +00:00
kazu aca81f3766 Fix problem when open in emacs [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-12 11:15:25 +00:00
hsbt 0593c6a510 Merge csv-0.1.0 from upstream.
* csv.gemspec: Update release version.
  * lib/csv.rb: Remove superfluous private clause.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-12 08:38:06 +00:00
hsbt c08f7b8088 Fixed install error with rdoc.gemspec
"lib/rdoc" is only workds on rdoc repository structure.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-12 05:19:20 +00:00
svn 708afa47eb * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-12 03:42:55 +00:00
hsbt 214a7f8d49 Merge rdoc-6.0.0.beta2 from upstream.
* This version changed lexer used Ripper from lexer based IRB.
    see details: https://github.com/ruby/rdoc/pull/512

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-12 03:42:54 +00:00
mame 3b08df649e lib/securerandom.rb: test one byte to determine urandom or openssl
`SecureRandom#gen_random` determines whether urandom is available or not
by trying `Random.urandom(n)`.  But, when n = 0, `Random.urandom(0)`
always succeeds even if urandom is not available, which leads to a wrong
decision.

When failed, `Random.urandom` returns nil instead of returning a shorter
string than required.  So the check for `ret.length != n` is not needed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-11 12:44:51 +00:00
hsbt 21f6916b98 Remove commented out code of URI::HTTP.new.
[Misc #13871][ruby-core:82655] Patch by @aycabta

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-11 06:12:40 +00:00
hsbt f7b3d2be57 Remove commented out code of SecureRandom.random_number.
[Misc #13870][ruby-core:82654] Patch by @aycabta.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-11 06:11:37 +00:00
hsbt 8598f8c2dc Merge bundler to standard libraries.
rubygems 2.7.x depends bundler-1.15.x. This is preparation for
  rubygems and bundler migration.

  * lib/bundler.rb, lib/bundler/*: files of bundler-1.15.4
  * spec/bundler/*: rspec examples of bundler-1.15.4. I applied patches.
    * https://github.com/bundler/bundler/pull/6007
    * Exclude not working examples on ruby repository.
    * Fake ruby interpriter instead of installed ruby.
  * Makefile.in: Added test task named `test-bundler`. This task is only
    working macOS/linux yet. I'm going to support Windows environment later.
  * tool/sync_default_gems.rb: Added sync task for bundler.

  [Feature #12733][ruby-core:77172]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-08 08:45:41 +00:00
duerst 04547c7dc0 update Ruby to Unicode 10.0.0
- In common.mk, set UNICODE_VERSION  to 10.0.0
- Generate and add enc/unicode/10.0.0/casefold.h and
  enc/unicode/10.0.0/name2ctype.h
- Update lib/unicode_normalize/tables.rb

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-06 07:56:41 +00:00
nobu 0f6e7edf72 getoptlong.rb: multiline regexps
* lib/getoptlong.rb: make regexps multiline safe.
  [ruby-core:82627] [Bug #13858]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-02 02:05:34 +00:00
ko1 7e8cdaa6c3 to_str -> to_s
* lib/net/http/header.rb (set_field): `val` can not have `to_str`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-30 22:23:45 +00:00
naruse 427f5b5713 A HTTP Header value must not contain CR or LF.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-30 17:24:05 +00:00
svn f32e46b791 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-29 11:52:52 +00:00
hsbt 4790c08906 Merge rdoc-6.0.0.beta1.
This version fixed strange behavior of ruby code parser.
  We will list all of impromovement to Changelog when 6.0.0 releasing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-29 11:52:50 +00:00
hsbt 9d99093169 Partly reverted r59642. Because IO#close is idempotent since Ruby 2.3.
Reported by Eric Wong. Thank you.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-29 10:22:47 +00:00
glass f70827b7cf resolv.rb: remove unnecessary require statement
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-29 04:58:29 +00:00
hsbt c5da5b1ea2 Merge rubygems-2.6.13.
see details for this update:
  http://blog.rubygems.org/2017/08/27/2.6.13-released.html

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-28 08:31:28 +00:00
glass 1a1930180c lib/csv.rb: refactor and optimize. This change
includes the patch from marshall-lee.
close #1168

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-28 07:54:00 +00:00
shugo 21e4ade56b lib/net/imap.rb: Accept continuation requests without response text
The IMAP server of DOCOMO returns such continuation requests.
[ruby-list:50558]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-27 06:32:00 +00:00
kazu 11d419ad19 `$IGNORECASE` is no longer effective. [ci skip]
* lib/English.rb: [DOC] `$IGNORECASE` is no longer effective.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-25 15:47:04 +00:00
glass 20c5f60775 csv.rb: optimize CSV::Table#to_a and #to_csv
* lib/csv.rb (CSV::Table#to_a, #to_csv): use Array#push instead of
  Array#concat for performance improvement. This performance improvement is
  proposed by zdennis <zach.dennis@gmail.com>. The patch is from
  Mau Magnaguagno <maumagnaguagno@gmail.com>.
  close #946

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-25 08:13:32 +00:00
hsbt ffb49a7e9b Fixed regression to convert blank value at r45497.
[Bug #11126][ruby-core:69088]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 06:57:00 +00:00
hsbt ede0df3a9b Gracefully handle CSV IO when file descriptor closed.
[Bug #10504][ruby-core:66240]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 06:40:59 +00:00
hsbt 20aed4495b Fixed equality method fails when given the object that doesn't support table method.
[Bug #12422][ruby-core:75707]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 06:34:27 +00:00
hsbt 9c38a08f28 Fixed to write_headers option behavior when given no rows.
[Bug #9988][ruby-core:63375]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 06:17:42 +00:00
hsbt 2c69f7b278 Escape skip_lines string before convert to Regexp.
It ignored all of lines when given Regexp special characters.

  [Feature #9147][ruby-core:58549]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-22 05:32:34 +00:00
hsbt bab14d39fb Extract files variables of ipaddr.gemspec for non git environment.
[Bug #13808][ruby-core:82358]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-16 09:45:58 +00:00
nobu 16565fa2d7 ftp.rb: fix example format [ci skip]
* lib/uri/ftp.rb: [DOC] fix format of example URLs.  patched by
  aycabta (Code Ahss) at [ruby-core:82379].  [Bug #13814]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-15 01:05:50 +00:00
duerst fda0371535 fix documentation of REXML::Formatters::Default (id_hack -> ie_hack) [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-14 16:04:35 +00:00
kou 2bbc30520f REXML: Fix a bug that unexpected methods can be called as a XPath function
[HackerOne:249295]

Reported by Andrea Jegher. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-13 12:14:24 +00:00
ko1 41e1670a64 use stable sort.
* lib/rubygems/resolver.rb (sort_dependencies): use stable sort.
  TestGemRequestSetLockfile#test_to_s_gem_dependency_non_default
  fails because this method return unstable results.
  Note that Enumerable#sort_by is unstable.

  I'm not sure the "stable" nature is required for RubyGems.
  The fact is that using stable sort, the test passed on
  mswin64+VS2017 where the sort results was reverse (unstable) order.
  Also using `-i` instead of `i` (it means forcing unstable sort)
  this test fails on other platform where the test successed before.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-04 14:57:31 +00:00
kazu 92c52f0832 Fix `NameError: uninitialized constant Net`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-04 12:00:00 +00:00
kazu 01eb8d776b Use `register_scanner` instead of `regist_scanner`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-04 11:59:59 +00:00
kazu 3b1987fb79 Add deprecated warning to ERB::Compiler::SimpleScanner2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-04 11:59:57 +00:00
kazu c8247a6b47 Fix variable name in example of net/pop
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-02 15:10:42 +00:00
kazu b93aea84d0 Fix net/pop code example syntax error
ref https://github.com/rurema/doctree/pull/455
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-02 15:10:40 +00:00
kazu 42fbe19fa8 Fix cgi/core code example missing comma
ref https://github.com/rurema/doctree/pull/448
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-02 15:10:38 +00:00
knu 71d16ad5aa ipaddr is now a default gem with an upstream at: https://github.com/ruby/ipaddr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-08-02 02:20:48 +00:00
kou cff3941b81 rexml: Remove needless document
[Fix GH-1671]

Patch by madblobfish. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-28 14:16:17 +00:00
glass 32eeff1708 csv.rb: fix incompatibility introduced in r59428
* lib/csv.rb: fix incompatibility introduced in r59428.
              CSV.new takes options as keyword arguments.

* test/csv/test_features.rb: add a test to ensure it raises error againt
                             unknown options

* test/csv/test_features.rb: add a test to ensure row_sep option is properly
                             applied

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-28 07:46:20 +00:00
glass a983fc5022 csv.rb: use keyword parameters
* lib/csv.rb: usb keyword parameters to receive options

* test/csv/test_features.rb: remove a test for checking options

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-27 09:53:58 +00:00
glass 5e3f1a10ca csv.rb: use Array#to_h
* lib/csv.rb (CSV::Row#to_hash): use Array#to_h

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-27 06:49:27 +00:00
shugo ae91976d56 lib/net/imap.rb: support CHANGEDSINCE and MODSEQ
Patch by plehoux (Philippe-Antoine Lehoux).  [ruby-core:64272] [Feature #10119]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-26 07:47:34 +00:00
nobu 3fe5d355a8 optparse.rb: case-sensitive candidate
* lib/optparse.rb (candidate): short options are case-sensitive by
  the default, should not match case-different options..
  https://github.com/mernen/completion-ruby/pull/9#issuecomment-317287946

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-24 01:56:04 +00:00
nobu 5f534b7d46 optparse.rb: [DOC] fix keys
* lib/optparse.rb (getopts): [DOC] parameter keys are strings, not
  symbols.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-21 08:31:47 +00:00
kazu 0055f09bcc Use `unpack1` instead of `unpack` and `[0]`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-20 23:34:03 +00:00
sonots 93fe0ff2f1 logger.rb: Fix handling progname
Because progname was memoized with ||= a logger call that involved
outputting false would be nil. Example code:

  logger = Logger.new(STDOUT)
  logger.info(false)  # => nil

Perform an explicit nil check instead of ||= so that false will be output.

patched by Gavin Miller <gavingmiller@gmail.com> [Fix GH-1667]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-20 16:47:26 +00:00
shugo ece6c6741e lib/net/pop.rb: support timeout for TLS handshake
Patch by ahorek (Pavel Rosický).  [ruby-core:80490] [Feature #13389]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-19 23:38:31 +00:00
shugo 016586824f lib/net/imap.rb: Ignore trailing space for Microsoft Exchange Server
Based on the patch by keysen (Jérémy Carlier).
[ruby-core:81641] [Bug #13649]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-19 23:08:34 +00:00
normal a6c13d08d7 webrick: fix SNI support
* lib/webrick/https.rb: check ssl context of virtual host.
* lib/webrick/ssl.rb: ensure to return ssl context.
* test/webrick/test_https.rb: test returned cert is correct.
  [Feature #13729][ruby-dev:50173]

Author: Tietew <tietew@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-18 01:59:28 +00:00
knu d893c123f6 Alias Set#to_s to #inspect [ruby-core:81753] [Feature #13676]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-14 08:46:13 +00:00
nobu 89bf90a370 optparse.rb: get rid of eval
* lib/optparse.rb: try Float() and Integer() instead of eval,
  which does too much things.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-12 02:49:53 +00:00
normal 08bdbef5ca webrick: add Server Name Indication (SNI)
* lib/webrick/https.rb: servername_cb implementation.
* lib/webrick/ssl.rb: abstract servername_cb.
* test/webrick/test_https.rb: test.
  [ruby-dev:50165] [Feature #13729]
  Author: Tietew <tietew@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-07 17:09:39 +00:00
nobu 8ddf0263bb Fix DecimalInteger converting to octal bug
Previously if the input started with a '0' then it will be converted
as octal even though it has been specified as a decimal. This commit
forces the number to be interpreted as a decimal.

[ruby-core:81927] [Bug #13722] [Fix GH-1665]
Author:    william <william.mccumstie@outlook.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-06 11:49:03 +00:00
rhe 650e758060 un.rb: use OpenSSL::PKey.read instead of OpenSSL::PKey::RSA.new
Also, error out if --ssl-private-key option is not given, since
specifying only the certificate makes no sense.  [Feature #13714]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-05 09:05:53 +00:00
nobu 2c59dd61f1 un.rb: support https
* lib/un.rb: add https support.  based on the patch by Flavio
  Castelli <flavio@castelli.name> in [ruby-core:81901].
  [Feature #13714]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-05 06:27:43 +00:00
nobu 3c45a7899e Delegate to `eql?` [Fix GH-1564]
* lib/delegate.rb (eql?): Delegate to `eql?` of the inner object.
  based on the patch by giginet <giginet.net@gmail.com>.
  [ruby-core:76950] [Bug #12684]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-24 03:35:29 +00:00
glass b906f78855 Fix exception type in option type checker
* lib/shell/system-command.rb (SystemCommand#initialize):
  `def_e2message` wraps error message, but does not define new exception

* test/shell/test_command_processor.rb: add a test

This patch is authored by Kenichi Kamiya <kachick1@gmail.com>
close #1657

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-22 10:56:49 +00:00
hsbt 0a907a3792 Make string literal to frozen object on gemspec of defulte gems.
Added following gemspecs.

    * extensions: date, dbm, etc, fiddle, gdbm, sdbm, stringio, strscan, zlib
    * pure ruby libraries: cmath, csv, fileutils, scanf, webrick

  psych and rdoc is out of scope of this commit. I will merge after
  upstream was change to `frozen_string_literal: true`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-19 13:03:06 +00:00
a_matsuda 88de87c295 Don't pollute toplevel by an IRB internal method
There actually are some libraries that requires 'irb' such as byebug, and when
'irb' is required, it requires irb/src_encoding.rb, then it defines the toplevel
default_src_encoding method that is visible from anywhere in the end users' apps.

Here's a quick oneliner that shows what's happening.

  % ruby -rpry-byebug -e 'p private_methods(false)'
  [:include, :using, :define_method, :public, :private, :DelegateClass, :default_src_encoding]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-15 10:43:17 +00:00
a_matsuda cb8ce41b02 Fix typo.
Patch by: Sarah Duve
Signed-off-by: Akira Matsuda <ronnie@dio.jp>

[Fix GH-1643]
[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-09 01:31:36 +00:00
kou d311921d31 rexml: add close tag check on end of document to StreamParser
[ruby-core:81593] [Bug #13636]

Reported by Anton Sivakov. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-07 13:01:28 +00:00
naruse abbfc048c5 suppress warning: ambiguous first argument; put parentheses or a space even after `-' operator
Introduced at r58905
http://rubyci.s3.amazonaws.com/ubuntu/ruby-trunk/log/20170526T153003Z.diff.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-28 16:41:31 +00:00
k0kubun 2e75043a49 erb.rb: Use str_uplus instead of rb_str_dup
to skip unnecessary string allocation on frozen_string_literal: false.
str_uplus can bypass calling rb_str_dup when OBJ_FROZEN is true.

* Before

erb_render      1.064

* Afete

erb_render      0.909

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-27 03:06:55 +00:00
k0kubun 43572889b3 erb.rb: Tiny improvement of compiling cost
by reducing string allocation.

* Before

app_erb 0.687

* After

app_erb 0.679

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-26 14:17:55 +00:00
k0kubun 9f9f8236ff erb.rb: [DOC] Follow compiled code's change
introduced in r58905.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-26 13:58:36 +00:00
k0kubun 6f685e106c erb.rb: Generate static string with opt_str_uminus
to skip object allocation for static string.

We can't always enable frozen_string_literal pragma because we can't
freeze string literals embedded by user for backward compatibility.
So we need to use fstring for each static string.

Since adding ".freeze" to string literals in #content_dump is slow
on compiling, I used unary "-" operator instead.

benchmark/bm_app_erb_render.rb: Added rendering-only benchmark to
test rendering performance on production environment.

This benchmark is created to reproduce the behavior on Sinatra (Tilt).
Thus it doesn't use ERB#result to skip parsing compiled code.
It doesn't use ERB#def_method too to regard `title` and `content` as
local variables. If we use #def_method, `title` and `content` needs
to be method call. I wanted to avoid it.

This patch's benchmark results is:

* Before

app_erb_render  1.250
app_erb 0.704

* After

app_erb_render  1.066
app_erb 0.686

This patch optimizes rendering performance (app_erb_render) without
spoiling (total of rendering +) compiling performance (app_erb).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-26 13:49:35 +00:00
k0kubun 5fc3236222 erb.rb: Use script encoding instead of force_encoding
The original intention of introducing `_erbout.force_encoding`
in r21170 was:

- "returns a string in the same character encoding as the input string."
- "When the input string has a magic comment, however, it returns a string
  in the encoding specified by the magic comment."

And they are tested by test/erb/test_erb_m17n.rb well and this patch
passes the test.
Since magic comment is always added in ERB compiled code, using ''.dup
instead of String.new will set correct encoding without calling
force_encoding method.

The benchmark results are:

* Before

$ ./ruby benchmark/run.rb --matzruby=./ruby -m bm_app_erb
MatzRuby:
ruby 2.5.0dev (2017-05-26 skip-force-enc.. 58903) [x86_64-linux]
last_commit=Skip force_encoding in compiled code of erb
Ruby:

app_erb:
matz 0.715

* After

$ ./ruby benchmark/run.rb --matzruby=./ruby -m bm_app_erb
MatzRuby:
ruby 2.5.0dev (2017-05-26 skip-force-enc.. 58903) [x86_64-linux]
last_commit=Skip force_encoding in compiled code of erb
Ruby:

app_erb:
matz 0.672

And perf(1) results are:

* Before

$ sudo perf stat ./ruby benchmark/bm_app_erb.rb

 Performance counter stats for './ruby benchmark/bm_app_erb.rb':

        709.571746      task-clock (msec)         #    1.000 CPUs utilized
                 5      context-switches          #    0.007 K/sec
                 1      cpu-migrations            #    0.001 K/sec
             1,337      page-faults               #    0.002 M/sec
     3,088,936,521      cycles                    #    4.353 GHz
   <not supported>      stalled-cycles-frontend
   <not supported>      stalled-cycles-backend
     4,849,564,282      instructions              #    1.57  insns per cycle
     1,027,042,087      branches                  # 1447.411 M/sec
        19,983,456      branch-misses             #    1.95% of all branches

       0.709747823 seconds time elapsed

* After

$ sudo perf stat ./ruby benchmark/bm_app_erb.rb

 Performance counter stats for './ruby benchmark/bm_app_erb.rb':

        693.494673      task-clock (msec)         #    1.000 CPUs utilized
                 7      context-switches          #    0.010 K/sec
                 1      cpu-migrations            #    0.001 K/sec
             1,316      page-faults               #    0.002 M/sec
     3,025,639,349      cycles                    #    4.363 GHz
   <not supported>      stalled-cycles-frontend
   <not supported>      stalled-cycles-backend
     4,694,848,271      instructions              #    1.55  insns per cycle
       994,496,704      branches                  # 1434.037 M/sec
        19,693,239      branch-misses             #    1.98% of all branches

       0.693724345 seconds time elapsed

[fix GH-1147]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-26 12:12:13 +00:00
sonots 10ee38b6bc * lib/uri/common.rb: [DOC] add rdoc to describe
URI.unescape is obsolete [ci-skip] [fix GH-1630]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-26 06:42:11 +00:00
k0kubun eb1652b571 erb.rb: Add ERB#result_with_hash
[ruby-core:55985] [Feature #8631] [fix GH-1623]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-25 15:38:25 +00:00
normal cbedbaf9d9 lib/net/protocol.rb: account read_bytes before caller sees it
Users may modify the chunk yielded to them in Net::HTTPResponse#read_body.
This will allow users to reduce memory usage by calling
String#clear on the buffer once they're done using it.

* lib/net/protocol.rb (read): increment read_bytes earlier
  (read_all): ditto
* test/net/http/test_httpresponse.rb (test_read_body_block_mod): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-22 07:36:00 +00:00
shugo 27fb27ff42 net/imap: separate @continuation_request_exception from @exception
Otherwise literal data will be sent even if NO response is returned
because @exception is set to nil in receive_responses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-22 06:13:11 +00:00
k0kubun 72fb1e1690 erb.rb: Skip creating regexp
if stags and etags are not changed from default.

:putobject insn (of regexp) will be used instead of :toregexp insn.
This means that the regexp won't be compiled for every
`SimpleScanner#scan` call.

It may not be a good idea to apply this kind of optimization for all cases.
But I applied this because it is default scanner and used frequently and has
relatively large impact for benchmark like this:

* Before
app_erb 1.023

* After
app_erb 0.781

This commit fixes only the bottleneck of performance regression introduced
in r53412. For maintainability, I won't fix other small regressions like
additional overhead of method calls.

[ruby-core:73820] [Bug #12074]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-22 03:56:16 +00:00
normal 8623ba8618 lib/net/protocol: clear short-lived read buffer
Using a parallel Net::HTTP downloader, this reduced memory usage
from around 120MB to 50MB on my 32-bit x86 system.

* lib/net/protocol.rb (rbuf_fill): clear temporary buffer

Test script I used:

  require 'net/http'
  require 'uri'
  require 'digest/sha1'
  url = 'http://80x24.org/git-i-forgot-to-pack/objects/pack/pack-97b25a76c03b489d4cbbd85b12d0e1ad28717e55.idx'
  uri = URI(url)
  use_ssl = "https" == uri.scheme
  thrs = 30.times.map do
    Thread.start do
      cur = Thread.current.object_id
      Net::HTTP.start(uri.host, uri.port, use_ssl: use_ssl) do |http|
        req = Net::HTTP::Get.new(uri)
        http.request(req) do |res|
          dig = Digest::SHA1.new
          res.read_body do |buf|
            dig.update(buf)
            #buf.clear # most Ruby programmers don't do this :<
          end
          warn "#{Time.now} #{cur} #{dig.hexdigest}\n"
        end
      end
      :done
    end
  end

  p thrs.map(&:value)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-21 23:52:08 +00:00
kazu 3f8248f1ee Remove redundant square brackets
Use character class directly instead of
character class in character class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-21 01:01:10 +00:00
k0kubun 64c914706e erb.rb: Allow trimming CR in all trim_modes
to unify a behavior with r58823 and r58825.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20 17:36:09 +00:00
k0kubun b82ed2ce61 erb.rb: Allow explicit trimming carriage return
when trim_mode is "-", for Windows environments.

[ruby-core:39625] [Bug #5339]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20 17:17:22 +00:00
k0kubun 040f275690 erb.rb: Allow trimming carriage return
when trim_mode is "<>", for Windows environments.

[Bug #11464]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20 16:50:33 +00:00
k0kubun a6986f10d0 erb.rb: Prevent potential unexpected rescue
of LoadError in some method calls, not from `require "strscan"`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20 16:20:07 +00:00
k0kubun ca34d7075a erb.rb: Drop unused scanner implementation
Original `SimpleScanner` was used only in tests.
Since `SimpleScanner` and `SimpleScanner2` work in the same way, I want
to drop the one which can't be used in a normal situation.

The only difference was `SimpleScanner` can be loaded without strscan
dependency but I think there's no situation that strscan is unavailable
because it's a standard library.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20 14:55:33 +00:00
stomar 82092f4bb7 prime.rb: remove alias after timeout test
* test/test_prime.rb: remove alias after timeout test.

* lib/prime.rb: fix typo.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20 10:21:44 +00:00
marcandre 68354c350a lib/prime: Fix primality of some large integers [#13492].
* lib/prime.rb: Use accurate sqrt to insure all factors are tested.
  Patch by Marcus Stollsteimer.

* test/test_prime.rb: Adapt test for timeout

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20 00:36:55 +00:00
hsbt 825a1e939b Merge gemspec from ruby/fileutils.
* Replaced homepage option to source code location as github.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19 23:39:58 +00:00
naruse 79d9955180 Define classes for r58800
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19 16:19:46 +00:00
naruse bd73d37471 Net::HTTP::STATUS_CODES is added as HTTP Status Code Repository [Misc #12935]
Note that 418 I'm a teapot doesn't exist because RFC 2324 and
RFC 7168 are not registered in IANA repository.
https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19 16:06:25 +00:00
naruse cca77ee9ca Add more HTTP status classes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19 16:06:18 +00:00
naruse 67723c1e46 Net::HTTP#start now pass :ENV to p_addr by default [Bug #13351]
To avoid this, pass nil explicitly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19 15:13:42 +00:00
nobu a6df192ded tempfile.rb: do not call File.identical? on closed stream
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19 09:36:34 +00:00
svn 940f32eb5d * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19 09:25:53 +00:00
shugo 84c1596342 net/imap: Net::IMAP#append should not block when NO response is received
[ruby-dev:50129] [Bug#13579]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19 09:25:52 +00:00
nobu 3c5344bf30 tempfile.rb: remove in Tempfile.create
* lib/tempfile.rb (Tempfile.create): should not fail even if the
  temporary file has been removed in the block, just ignore.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-19 09:20:14 +00:00
hsbt 37abc2fb7e Improve CSV parsing performance.
Patch by @joshpencheon (Josh Pencheon)
  [fix GH-1607]

  #### benchmark-ips results
  ```
  trunk:
  Warming up --------------------------------------
                         4.000  i/100ms
  Calculating -------------------------------------
                         39.661  (±10.1%) i/s -      2.352k in 60.034781s
  with-patch:
  Warming up --------------------------------------
                         5.000  i/100ms
  Calculating -------------------------------------
                         60.521  (± 9.9%) i/s -      3.595k in 60.047157s
  ```

  #### memory_profiler resuts

  ```
  trunk:
  allocated memory by class
  -----------------------------------
    35588490  String
     7454320  Array
      294000  MatchData
       37340  Regexp
       11840  Hash
        2400  CSV
        1600  Proc
        1280  Method
         800  StringIO
  with-patch:
  allocated memory by class
  -----------------------------------
    18788490  String
     3454320  Array
      294000  MatchData
       37340  Regexp
       11840  Hash
        2400  CSV
        1600  Proc
        1280  Method
         800  StringIO
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-18 02:42:16 +00:00
k0kubun e1b4327545 cgi/util.rb: Don't escape tilde in #escape
to make it compatible with ERB::Util.url_encode.

ext/cgi/escape/escape.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17 12:34:59 +00:00
k0kubun 53127c2410 erb.rb: Don't encode tilde in #url_encode
Based on patch by madeofcode (Mark Dodwell).
[ruby-core:46168] [Bug #6696] [Fix GH-54]

`~` is a unreserved character.
https://tools.ietf.org/html/rfc3986#section-2.3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17 11:58:09 +00:00
hsbt 15cb9817a2 Optimize CSV#shift.
[Bug #12373][ruby-core:75462]
  Patch by Yuki Kurihara.

  Benchmark:
  ```
  Warming up --------------------------------------
           csv_shift     1.000  i/100ms
       new_csv_shift     1.000  i/100ms
Calculating -------------------------------------
           csv_shift      1.192  (± 0.0%) i/s -      6.000  in 5.034250s
       new_csv_shift      1.527  (± 0.0%) i/s -      8.000  in 5.243446s

Comparison:
       new_csv_shift:        1.5 i/s
           csv_shift:        1.2 i/s - 1.28x  slower
  ```

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-17 07:56:27 +00:00
hsbt 87acdae43d Strip punctuation from CSV headers in symbol converter.
Patch by @cllns. [Fix GH-957]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16 09:32:32 +00:00
hsbt 3b77cb2a64 Added accessor of original line when parsing.
[Feature #11865][ruby-core:72452][fix GH-1170]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16 09:17:09 +00:00
nobu 66b54b1a4a fix tempfile leaks on Windows
* lib/rubygems/ext/ext_conf_builder.rb (build): needs to close
  before unlink on Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16 05:47:53 +00:00
ko1 f033cfa381 refresh Gem at the end of `teardown`.
* lib/rubygems/test_case.rb (teardown): call `Gem::refresh()` at the
  end of `teardown`.
  On parallel test sometimes fails test process. The reason
  is:
  (1) previous tests remains `Gem::Specification@@stubs` value
      which points to temporary directories and the directories
      are removed by `teardown` method of previous test.
  (2) `require 'rubygems/gem_runner'` in `test_gem_gem_runner.rb`
      tries to require test utility file. However, with strange `@@stubs`
      RubyGems tries to load specification from removed directory.
      `StubSpecification#to_spec` returns `nil` and error will occur.
  The solution this patch employs is to refresh all of parameters
  includes `Gem::Specification@@stubs` by `Gem::refresh()`.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-15 14:40:07 +00:00
k0kubun 52c738408e erb.rb: Use String#<< instead of #concat
to optimize String concatenation on rendering.

[fix GH-1612]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-15 13:38:02 +00:00
shugo 5bf395f4cb net/imap: Revert read_tiemout in r58549.
get_response is called in a receiver thread, so there may be no pending
commands when get_response is called.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-12 09:39:23 +00:00
shugo cea73b2df9 net/imap: Net::IMAP#disconnect need not do anything if already disconnected
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-11 07:56:52 +00:00
stomar dba186ebc7 lib/uri/generic.rb: fix typos
* lib/uri/generic.rb: [DOC] fix typos in URI::Generic#== docs.
  Patch by Alyssa Ross (alyssais).  [Fix GH-1604]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-10 19:03:07 +00:00
naruse d7181f726f confirm current process equals to gemhome's pid
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-10 07:23:06 +00:00
naruse 8972de9ff7 dump stub specifications if nil
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-09 17:41:10 +00:00
duerst 88892c8d65 add explanations about status of module UnicodeNormalize
In lib/unicode_normalize/normalize.rb, add explanations and clarifications
about the status of the files and the module. [ci skip]
This is in response to discussions at https://github.com/ruby/spec/pull/433
and https://bugs.ruby-lang.org/issues/5481#note-58.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-09 10:45:46 +00:00
naruse cc3042a793 Add one more guard to avoid mixing nil into latest_specs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-09 07:47:28 +00:00
duerst c7baa31c76 delete lib/unicode_normalize.rb, because no longer needed
(all content has been moved to string.c)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-06 03:12:26 +00:00
nobu 97849e1178 share `@@accept_charset`
* lib/cgi/{core,util}.rb: include CGI::Util not only extending, to
  share `@@accept_charset` class variable, so that it is always
  accessible.  [ruby-core:80986] [Bug #13539]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-06 01:33:04 +00:00
duerst 140560e4ee move definition of String#unicode_normalized? to C to make sure it is documented
* lib/unicode_normalize.rb: Remove definition of String#unicode_normalized?
  (including documentation). Leave a comment explaining that the file is now empty.
* string.c: Define String#unicode_normalized? in rb_str_unicode_normalized_p in C,
  (including documentation)
* lib/unicode_normalize/normalize.rb: Remove (re)definition of
  String#unicode_normalized? to avoid warnings (when $VERBOSE==true) and
  problems when String is frozen

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-04 02:00:19 +00:00
duerst 90ab1ee023 move definition of String#unicode_normalize! to C to make sure it is documented
* lib/unicode_normalize.rb: Remove definition of String#unicode_normalize!
  (including documentation)
* string.c: Define String#unicode_normalize! in rb_str_unicode_normalize_bang in C,
  (including documentation)
* lib/unicode_normalize/normalize.rb: Remove (re)definition of
  String#unicode_normalize! to avoid warnings (when $VERBOSE==true) and
  problems when String is frozen

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-04 01:36:52 +00:00
kou 6faa8408e5 rss: Accept empty text element as valid element
Parser has been accepted it but XML serializer wasn't accepted.

Reported by stefano frabetti. Thanks!!!

[ruby-core:80965] [Bug #13531]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-03 12:25:17 +00:00
duerst 5fee67c9ba move definition of String#unicode_normalize to C to make sure it is documented
* lib/unicode_normalize.rb: Remove definition of String#unicode_normalize
  (including documentation)
* string.c: Define String#unicode_normalize in rb_str_unicode_normalize in C,
  (including documentation)
* lib/unicode_normalize/normalize.rb: Remove (re)definition of
  String#unicode_normalize to avoid warnings (when $VERBOSE==true) and
  problems when String is frozen

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-03 12:18:37 +00:00
shugo 8b51a725db net/imap: handle timeouts
Patch by Pavel Rosický.  [Feature #13379] [ruby-core:80440]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-03 11:32:22 +00:00
duerst 107f157289 remove unnecessary conditions in lib/unicode_normalize.rb
Because the methods in lib/unicode_normalize.rb are overwritten
by those in lib/unicode_normalize/normalize.rb as soon as one
of them is called, the check for whether UnicodeNormalized is
defined or not is no longer necessary.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-02 05:46:31 +00:00
duerst 8001dae820 rework definition of String#unicode_normalize! and #unicode_normalized?
simplify String#unicode_normalize! and #unicode_normalized?
in lib/unicode_normalize.rb by redefining them
in lib/unicode_normalize/normalize.rb

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-02 05:34:25 +00:00
duerst 42b8713703 rework definition of String#unicode_normalize
simplify String#unicode_normalize in lib/unicode_normalize.rb
by redefining it in lib/unicode_normalize/normalize.rb

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-02 05:15:04 +00:00
hsbt 708a10d35b Merge rubygems-2.6.12 from rubygems/rubygems.
* Details of changes:
    0090800402/History.txt (L3)

  * I kept ko1's commmit related thread issue. It's not merged 2.6 branch on rubygems.
    1721dfa0ea

  * I removed test_realworld_default_gem from rubygems-2.6.12. It fails on
    Ruby trunk. Because it's differences of test suite and environment.
    https://github.com/rubygems/rubygems/pull/1899

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-01 11:40:46 +00:00
hsbt abb8b33011 Merge gemspec from ruby/webrick.
* Bump version to 1.4.0.beta1. Because https://rubygems.org/gems/webrick
    is already reserved old version of webrick.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-01 10:20:35 +00:00
hsbt 33f66084d5 Import gemspec
Import gemspec and test file from ruby/webrick.

  * webrick.gemspec: Update files and dependency for standalone gem.
  * test/webrick/utils.rb: Added explicitly loading of EnvUtil for
    test suite without ruby core test suite.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-25 09:23:04 +00:00
naruse c7ec1b1f59 Allow Net::HTTP to fetch user/pass from http_proxy
Note that this feature is enabled only on environment variables are
multi-user safe. In this time the list includes Linux, FreeBSD, or
Darwin. [Bug #12921]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-23 16:19:23 +00:00
hsbt 7a856b11c8 Removed mathn.rb from stdlib. It's deprecated from Ruby 2.2.
[Feature #10169][[ruby-core:64553]]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 06:16:11 +00:00
ko1 1721dfa0ea release monitor correctly.
* lib/rubygems/core_ext/kernel_require.rb: sometimes
  `Kernel.send(:gem, spec.name)` can raise some errors
  (Gem::MissingSpecError I observed) and this method
  doesn't release RUBYGEMS_ACTIVATION_MONITOR correctly.
  This patch fix this problem.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 15:02:55 +00:00
nobu f14f0d3464 ruby-lex.rb: fix continued line conditions
* lib/irb/ruby-lex.rb (RubyLex#lex): fix conditions for continued
  line; empty lines, a semicolon, first line in `begin` block,
  just after `else` are not continued.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 11:07:02 +00:00
nobu 716ce65138 ruby-lex.rb: merge regexps
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 11:07:00 +00:00
hsbt 6a08beef51 Removed math mode from irb.
mathn is deprecated from Ruby 2.2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 09:11:36 +00:00
hsbt 7b3ac07781 Removed deprecated extensions of mathn.
* ext/mathn/{complex,rational}: Removed from ruby core.
    [fix GH-1542][Feature #13334][ruby-core:80247]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 08:21:24 +00:00
stomar 55d0da5105 unicode_normalize.rb: improve docs
* lib/unicode_normalize.rb: [DOC] improve docs for
  String#{unicode_normalize,unicode_normalized?}: rdoc formatting,
  adopt style of other String methods (drop heading and "Examples").

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-12 19:49:48 +00:00
stomar 0c10564dd9 nodoc UnicodeNormalize module
* lib/unicode_normalize/normalize.rb: [DOC] nodoc the
  internal UnicodeNormalize module.
* lib/unicode_normalize/tables.rb: ditto.
* template/unicode_norm_gen.tmpl: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-12 18:07:32 +00:00
hsbt fa3a612e2e Import latest gemspec from ruby/fileutils.
* Bump version to 0.7.1. Beucause fileutils-0.7 is alread reserverd
    on rubygems.org.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-12 08:12:53 +00:00
nobu fb979b4532 Use \A and \z to match whole string
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-07 13:26:12 +00:00
akr 70ae0d2a42 Refactored using Method#owner.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-04 12:54:42 +00:00
eregon a6456054ae ostruct.rb: improve fix for OpenStruct.allocate + #respond_to?
* lib/ostruct.rb (OpenStruct#respond_to_missing?): this makes
  OpenStruct#respond_to? works on any OpenStruct instance,
  just like Kernel#respond_to? does, without workarounds.
  [ruby-core:80292] [Bug #13358]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-01 10:30:48 +00:00
mame e294fbaf5f Fix two typos
My typo checker :-) found the bugs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-29 11:49:39 +00:00
nobu a20715c8ed ostruct.rb: refine visibility failure message
* lib/ostruct.rb (method_missing): raise an exception with proper
  visibility message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-28 09:21:58 +00:00
nobu cd911b9367 ostruct.rb: fix OpenStruct.allocate
* lib/ostruct.rb (OpenStruct.allocate): initialize an instance
  variable directly, without calling `intialize` method which may
  be overridden in a subclass.  [ruby-core:80292] [Bug #13358]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-24 12:16:54 +00:00
normal 7142f5b595 logger: remove redundant opt_str_freeze use
Strings in "when" statements are allocation-free, so there's
never any reason to uglify the code to use opt_str_freeze over
the normal putobject instructions, here.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-24 07:29:33 +00:00
hsbt 719262eeda Added initial gemspec for mathn.
[Feature #13335]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-20 07:07:49 +00:00
stomar 58c3935ec9 improve docs for URI::Generic
* lib/uri/generic.rb: [DOC] expand docs for URI::Generic#normalize
  to clarify what normalization means here.
  Reported by Robert Gleeson.  [ruby-core:58430] [Bug #9127]

* lib/uri/generic.rb: [DOC] fix indent for correct code block detection.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-19 15:01:05 +00:00
hsbt fa59a2ea80 Merge rubygems-2.6.11
This version fixed regression of rubygems-2.6.10.
  https://github.com/rubygems/rubygems/pull/1856

  See details of changelogs for 2.6.11 release:
  adfcf40502/History.txt (L3)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-17 01:29:22 +00:00
marcandre 666df14594 * lib/matrix.rb: Add Vector.zero and Vector#zero?
Patch by Chia-sheng Chen [#13208]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-14 20:09:30 +00:00
glass 279d31f11d Fix bug of Tempfile#size if nothing is written [Bug #13198]
* lib/tempfile.rb (Tempfile#size): Fix its behavior when nothing
  is written. Tempfile#size should return 0 in this case.
  The patch is from nobu <nobu@ruby-lang.org>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-14 12:53:32 +00:00
naruse 1933215038 Raise error if spec is nil
With parallel test-all, the spec is sometimes nil.
To debug it raise more detailed error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-13 09:05:35 +00:00
stomar 44fbaaae46 lib/ostruct.rb: [DOC] revise docs for OpenStruct
* update paragraph on implementation:
  define_singleton_method is used, not define_method
* add call-seq with return values for each_pair
* adopt description of dig from Array and Hash
* fix description of the hash method
* :nodoc: initialize_copy, respond_to_missing?
* other small improvements, e.g. use the term `attribute' in the docs
  (instead of `member'), which is clearer for users of the class
* improve code examples: e.g. use more consistent style (always use
  double quotes, drop `p' and `puts', ...), update inspect output,
  use example data that is not prone to change (like population)
* add more code examples
* fix some small errors and grammar

[ruby-core:79265] [Bug #13159]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-11 21:32:46 +00:00
stomar ddd37e5491 docs for FileUtils.ln methods
* lib/fileutils.rb: [DOC] add clarifying call-seq's for FileUtil.ln,
  ln_s, and ln_sf, with better argument names for the created link and
  link target.  Reported by Mike Vastola. [ruby-core:62532] [Bug #9829]

* lib/fileutils.rb: [DOC] further improve descriptions of FileUtils.ln
  and related methods; improve examples: relative links probably won't
  work in other dir, avoid `include', use more generic homedir name.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-08 20:41:38 +00:00
stomar b637593ae7 rdoc for String class
* lib/unicode_normalize.rb: [DOC] prevent a comment from
  showing up in the class documentation for String.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-04 20:02:48 +00:00
stomar e9d6c6716f nodoc OptParse
* lib/optparse.rb: [DOC] nodoc OptParse, introduced with r46126,
  to avoid leaking of its documentation (OptionParser's docs) into
  the class documentation of Object.  [ruby-core:79909] [Bug #13281]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-04 19:52:30 +00:00
kazu c1fd1b111d lib/e2mmap.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-01 11:37:30 +00:00
stomar 97e946f75a fileutils.rb: improve rdoc for FileUtils
* lib/fileutils.rb: [DOC] fix invalid example code to make it
  syntax highlighted, fix rdoc for lists, nodoc internal methods,
  avoid a dangerous example.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-01 10:17:42 +00:00
stomar 7957042253 fileutils.rb: improve docs for FileUtils.compare_file
* lib/fileutils.rb (compare_file): [DOC] clarify documentation
  by avoiding confusing return value of "maybe false".

[ruby-core:75431] [Misc #12365] reported by Robert A. Heiler.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-01 08:54:37 +00:00
stomar 98374b99dd lib/mathn.rb: [DOC] nodoc internal Math.rsqrt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-28 10:41:03 +00:00
nobu 7d4cdab8f8 mkmf.rb: get rid of error messages
* lib/mkmf.rb (create_makefile): add TARGET_SO to CLEANLIBS only
  when the extension library will be build, to get rid of trying
  to remove $(TARGET_SO_DIR).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-27 07:37:55 +00:00
nobu afdd2fa7e9 mkmf.rb: clean generated files
* lib/mkmf.rb (try_link0): remove generated files other than the
  executable file.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-27 05:55:32 +00:00
nobu e3e2a2c715 Makefile.in: verify-static-library
* Makefile.in (verify-static-library): separate from LIBRUBY_A.
  no check every times by default.

* lib/mkmf.rb (try_link): remove debugging symbol directory after
  linking, instead of try_do.

* lib/mkmf.rb (try_link): bccwin32 support has been removed long
  ago.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-27 05:14:30 +00:00
rhe a0acd82f2a securerandom: fix up r57384
SecureRandom.gen_random_openssl still refers to Random.raw_seed, which
is renamed to Random.urandom by r57384.  [Bug #9569]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-24 11:33:06 +00:00
hsbt df3e22ce84 Update rdoc-5.1.0
* Details of changes are following url.
    https://github.com/rdoc/rdoc/blob/master/History.rdoc#510--2017-02-24

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-24 07:39:37 +00:00
kazu fbd5cda6aa {lib,test}/cgi: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-18 05:52:16 +00:00
nobu 3261cfd881 fileutils.rb: do not make root
* lib/fileutils.rb (FileUtils#mkdir_p): no need to make root
  directory which should be exist and cannot be made with mkdir
  recent Cygwin can make a directory contains a colon.
  [Bug #13214]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-16 08:42:22 +00:00
hsbt 6c0d7c98b6 Added initial gemspec for Scanf module.
[Feature #13213]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-14 11:12:52 +00:00
kazu ad97d4839c lib/find.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-13 12:16:26 +00:00
kazu 97795849e4 Use `unpack1` instead of `unpack` and `first`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-10 00:58:47 +00:00
kazu 07b88b2616 lib/base64.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-10 00:58:45 +00:00
kazu b15f8b6de9 lib/abbrev.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-09 16:12:00 +00:00
hsbt 2507e9000e Fix a required ruby version on gemspec of gemified libraries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-07 07:14:22 +00:00
hsbt 52dbede23b Added initial gemspec for FileUtils module.
[Feature #13197]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-06 09:51:17 +00:00
nobu 84012757a7 rdoc: suppress warnings in eval
* lib/rdoc/markup/to_html.rb (RDoc::Markup::ToHtml): the argument
  text may contain warnings, which are useless to check if
  parseable.  merge rdoc/rdoc#440.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-06 02:35:48 +00:00
marcandre 4d7b999c77 lib/ostruct.rb: Fix returned value of each_pair.
From a patch by Marcus Stollsteimer. [Fixes #13169]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-03 18:25:28 +00:00
hsbt ffcb389d68 Added initial gemspec for CMath module.
[Feature #13182]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-02 07:49:19 +00:00
hsbt 8395d5a7c3 Prepare to make CSV module to default gem.
* lib/csv.gemspec: initial gemspec for csv gem.
  * tool/rbinstall.rb: support gemspec located under lib direcotry like `lib/foo.gemspec`

  [Feature #13177]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-01 09:12:53 +00:00
hsbt b8afbf5e6d Initial commit for gem release of webrick.
[Feature #13173]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-31 08:48:14 +00:00
nobu df5d84bb41 mkmf.rb: message format string
* lib/mkmf.rb (checking_for): message needs format string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-31 08:03:08 +00:00
nobu b3dbeb6e90 mkmf.rb: fix script installation
* lib/mkmf.rb (MakeMakefile): fix condition to install script
  files.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28 05:02:39 +00:00
kazu c71e1223c5 [DOC] Use Integer instead of Fixnum [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 15:14:02 +00:00
kazu e7cc39008e lib/weakref.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 15:14:00 +00:00
kou fdbb4bb3e2 Add document for lib/rss/atom.rb
[fix GH-1520]

Patch by Tsehau Chao. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26 12:47:51 +00:00
hsbt 5d43821536 Update Rubygems 2.6.10
* 2ee5bf9fd3
 * be510dd409

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-24 02:38:57 +00:00
naruse 6219b68fb5 Fix typo of URI#escape [Bug #13147]
patched by Steve Hill <sghill.dev@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23 17:02:08 +00:00
nobu 5bb125c63e csv.rb: fix field_size_limit check
* lib/csv.rb (CSV#shift): the last column is an Array in extended
  column since r55985.  [ruby-dev:49964] [Bug #13149]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23 05:59:28 +00:00
kazu 562bbdf995 lib/tempfile.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-21 12:21:05 +00:00
kazu 121984da8e Remove deprecated rbconfig/datadir
This is deleted at
0e3c2c1f04
in upstream.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-20 13:33:06 +00:00
shyouhei abae70d6ed SecureRandom should try /dev/urandom first [Bug #9569]
* random.c (InitVM_Random): rename Random.raw_seed to
	  Random.urandom.  A quick search seems there are no practical use
	  of this method than securerandom.rb so I think it's OK to rename
	  but if there are users of it, this hunk is subject to revert.

	* test/ruby/test_rand.rb (TestRand#test_urandom): test for it.

	* lib/securerandom.rb (SecureRandom.gen_random): Prefer OS-
	  provided CSPRNG if available. Otherwise falls back to OpenSSL.
	  Current preference is:

	  1. CSPRNG routine that the OS has; one of
	     - getrandom(2),
	     - arc4random(3), or
	     - CryptGenRandom()
	  2. /dev/urandom device
	  3. OpenSSL's RAND_bytes(3)

	  If none of above random number generators are available, you
	  cannot use this module.  An exception is raised that case.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-20 08:00:00 +00:00
hsbt 18a315df43 Fix documentation of options for all of methods in FileUtils.
Patch by galia traub( @galiat ). [Fix GH-1510][ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-19 07:07:17 +00:00
kazu e527695d50 lib/profiler.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-18 12:35:10 +00:00
nobu 556e3da421 uri/generic.rb: fix exception on non-IP format
* lib/uri/generic.rb (URI::Generic#find_proxy): match IP address
  no_proxy against resolved self IP address.  [Fix GH-1513]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-17 12:54:35 +00:00
kazu 2a9dd6b818 lib/pstore.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-17 12:47:38 +00:00
normal 22908245ef rinda/ring.rb (make_socket): do not keep socket on failures
This prevents leaked FD warnings on test/rinda/test_rinda.rb
when testing on a machine without multicast support.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-17 03:31:57 +00:00
kazu 710d9384e7 lib/profile.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-15 02:56:04 +00:00
nobu 8b8505d239 resolv.rb: byte buffer
* lib/resolv.rb (Resolv::DNS::Message::MessageDecoder): treat the
  data as a byte buffer.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-14 02:26:49 +00:00
nobu 2b2450ba4b Made #decode_rdata client to catch errors
* lib/resolv.rb (Resolv::DNS::Message::MessageDecoder#get_rr):
  re-raise an exception from decode_rdata as DecodeError, so it
  can report them to the top in more informative way.  It was not
  reflecting on errors of data and thus breaking.  Client code
  expects `DecodeError` and knows how to handle broken messages.
  [Fix GH-1511]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-14 02:26:48 +00:00
kazu 82f61a1336 lib/observer.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-13 12:08:29 +00:00
kazu 6ca3028eec lib/net/smtp.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-12 12:17:33 +00:00
shugo 58935eb8bd lib/net/protocol.rb: preserve backtrace information
BufferedIO#rbuf_fill should preserve backtrace information when raising
EOFError.  Otherwise, users get confused when EOFError is leaked out from
Net::SMTP etc.  [ruby-core:78550] [Bug #13018]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-12 02:19:17 +00:00
kazu 3e34d8a44f lib/net/protocol.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-11 14:48:51 +00:00
kazu 1dd076c557 lib/net/pop.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-10 12:32:56 +00:00
nobu 474a730182 slex.rb: japanese comment [ci skip]
* lib/irb/slex.rb (postproc): translated a japanese comment in
  ISO-2022-JP.  [ruby-core:79017] [Misc #13117]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-09 02:45:28 +00:00
kazu 6a680a5cb3 lib/getoptlong.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-08 04:17:08 +00:00
kazu 9144d57b94 lib/fileutils.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-07 02:14:07 +00:00
nobu 7802f01d4f prelude.rb: Binding#irb [ci skip]
* prelude.rb (Binding#irb): [EXPERIMENTAL] automatically require
  irb and run.  [ruby-core:78960] [Bug #13099]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-06 03:11:45 +00:00
kazu 761dd9a778 lib/delegate.rb: Specify frozen_string_literal: true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-06 02:05:35 +00:00