* 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
* file.c(rb_file_path): [DOC] Note that the pathname returned by this
method can be inaccurate, for instance file gets moved, renamed,
deleted or is created with File::TMPFILE option.
Relates to [Feature #13568]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/rubyspec/optional/capi/spec_helper.rb (compile_extension):
use LIBRUBYARG_SHARED for LDSHARED.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/fileutils/test_fileutils.rb (test_ln_s): skip if symlink is not
available.
* test/fileutils/test_fileutils.rb (test_ln_s): remove created symlink
certainly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Binding to a potentially public IP in a test can cause problems
if hit by a random port scanner or something...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c (rb_obj_size): The #yield_self Enumerator instance
always has a #count of `1`. This provides a lazy #size of `1`
to match the count instead of `nil`. [Fix GH-1615]
Author: Shannon Skipper <shannonskipper@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* template/exts.mk.tmpl: get rid of making multiple rubies
simultaneously. it can cause making libruby in parallel.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: get rid of unreliable tgamma() implemented of
mingw, which returns NaN unexpectedly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_external_str_new_with_enc): cut down intermediate
string for conversion source, by appending with conversion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_external_str_new_with_enc): fix the case of
conversion failure. when conversion failed for some reason,
just ignores the default internal encoding and returns in the
given encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* spec/rubyspec/core/kernel/itself_spec.rb: `object_id` may return
different objects for each calls, and the expectation of object
identity is done by `equal` matcher which uses `equal?` method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c (rb_external_str_new_with_enc): cut down intermediate
string for conversion source, by appending with conversion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk (yes-test-rubyspec): make test-rubyspec-precheck for
fake.rb to setup build configuration.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* math.c (math_lgamma): check the argument before calling math
function `lgamma_r` for edge cases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* math.c (math_gamma): check the argument before calling math
function `tgamma` for edge cases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
We cannot assume autoload_provided/rb_feature_provided returning
TRUE means it is safe to proceed without waiting. Another
thread may call rb_provide_feature before setting the constant
(via autoload_const_set). So we must wait until autoload is
completed by another thread.
Note: this patch was tested with an explicit rb_thread_schedule
in rb_provide_feature to make the race condition more apparent
as suggested by <s.wanabe@gmail.com>:
> --- a/load.c
> +++ b/load.c
> @@ -563,6 +563,7 @@ rb_provide_feature(VALUE feature)
> rb_str_freeze(feature);
>
> rb_ary_push(features, rb_fstring(feature));
> +rb_thread_schedule();
> features_index_add(feature, INT2FIX(RARRAY_LEN(features)-1));
> reset_loaded_features_snapshot();
> }
* variable.c (check_autoload_required): do not assume a provided
feature means autoload is complete, always wait if autoload is
being performed by another thread.
[ruby-core:81105] [Bug #11384] Thanks to <s.wanabe@gmail.com>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Use `%WINDIR%\system32\drivers\etc\services` instead of `notepad.exe`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_insert): fix the position in error message, when
it is less than -1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c (rb_ary_insert): check position to insert even if no
elements to be inserted. [ruby-core:81125] [Bug #13558]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: do not use buggy tgamma() of mingw.
* missing/tgamma.c (tgamma): merge fix for inifity from
ruby_tgamma. since msvcr120.dll and later have tgamma, this
implementation will not be used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e