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

6271 Коммитов

Автор SHA1 Сообщение Дата
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