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

1241 Коммитов

Автор SHA1 Сообщение Дата
卜部昌平 9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00
Nobuyoshi Nakada a58bbd6a51
Use `rb_warn_deprecated` for `File.exists?` and `Dir.exists?` 2020-04-06 21:43:32 +09:00
Nobuyoshi Nakada 146330906f
Fixed the location of the shared library
On platform where searchs shared libraries by `PATH` environment
variable (i.e., Windows), the shared library is installed in
`bindir`.  On other platforms, the library directory is directed
by `libdirname` indirectly.
2020-04-04 11:18:25 +09:00
Nobuyoshi Nakada 4a71645565
rbconfig_spec.rb: removed needless windows guard
This reverts commit 34b0a7be0e.
2020-04-04 11:18:23 +09:00
Benoit Daloze 7f82c8cd47 Update to ruby/spec@7289ea3 2020-04-04 01:02:53 +02:00
Benoit Daloze da5a128991 Update to ruby/mspec@fad32a5 2020-04-04 01:02:50 +02:00
Nobuyoshi Nakada ca0f68260e
Use `platform_is` guard 2020-04-03 09:47:19 +09:00
Nobuyoshi Nakada 18f7d3c9a6
Refined "Drop support for ruby 2.4 from ruby/spec"
By using spec/mspec/tool/remove_old_guards.rb.
2020-04-03 09:44:40 +09:00
Nobuyoshi Nakada f49a24201c
Refined spec/mspec/tool/remove_old_guards.rb
* Allow spaces around `...`
* Matches quotes more precisely
* Matches 0 teeny
2020-04-03 09:44:32 +09:00
Benoit Daloze da05c1552e Update to ruby/spec@cc7b9e5 2020-04-02 22:39:28 +02:00
Benoit Daloze 4ec32f869f Update to ruby/mspec@b9fe8d6 2020-04-02 22:39:26 +02:00
Nobuyoshi Nakada 242e58db2f
Removed obsolete names 2020-04-03 01:16:57 +09:00
Nobuyoshi Nakada 826f44834f Drop support for ruby 2.4 from ruby/spec 2020-04-01 15:36:20 +09:00
Nobuyoshi Nakada 3a2073e61b Use FrozenError instead of frozen_error_class 2020-04-01 15:36:20 +09:00
Yusuke Endoh 87aebecdc2 spec/ruby/core/time/: Use near time for timezone test
`time_with_zone.zone.should == (time_with_zone - 60*60).zone` fails when
the time is immediately before the change of summer time.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-master/log/20200328T232504Z.fail.html.gz

```
1)
Time#+ preserves time zone FAILED
Expected "CET" == "CEST"
to be truthy but was false
```

It is acceptable as it fails at most twice per year, but it would be
good to use near time objects to reduce the possibility.
2020-03-29 10:06:53 +09:00
Yusuke Endoh 6379c6af4d spec/bundler/other/platform_spec.rb: skip an attempt to simulate JRuby 2020-03-29 09:09:46 +09:00
Takashi Kokubun cf191872fd
Increase the number of Process.times attempts
CI of 5806c54447 did not succeed
https://travis-ci.org/github/ruby/ruby/jobs/668072714
2020-03-28 15:23:30 -07:00
Benoit Daloze 5806c54447 Improve reliability of the Process.times spec 2020-03-28 14:39:01 +01:00
Benoit Daloze 6413a26b6c Do not check that #stime changes in Process.times spec
* Since the spec might not spend any time in system calls.
2020-03-28 14:32:22 +01:00
Benoit Daloze 11a381940b Remove debugging code 2020-03-28 14:27:13 +01:00
Benoit Daloze 5b48686691 Remove Process.clock_getres "matches the resolution in practice" specs
* Almost all platforms return incorrect values for Process.clock_getres,
  it should be removed: https://bugs.ruby-lang.org/issues/16740
2020-03-28 12:49:28 +01:00
Benoit Daloze 282c9d1bbe Remove spec which is an incorrect usage of rb_rescue2()
* It segfaults on MRI.
2020-03-28 12:34:45 +01:00
Yusuke Endoh 34b0a7be0e spec/ruby/library/rbconfig/rbconfig_spec.rb: restore "not windows" guard
https://github.com/ruby/ruby/runs/541455267
```
1)
RbConfig::CONFIG libdir/LIBRUBY_SO is the path to libruby and it exists if and only if ENABLE_SHARED FAILED
Expected File.exist? "d:/Ruby26-x64/lib/x64-msvcrt-ruby260.dll"
to be truthy but was false
D:/a/ruby/ruby/src/spec/ruby/library/rbconfig/rbconfig_spec.rb:46:in `block (3 levels) in <top (required)>'
D:/a/ruby/ruby/src/spec/ruby/library/rbconfig/rbconfig_spec.rb:4:in `<top (required)>'
```
2020-03-28 19:31:11 +09:00
Nobuyoshi Nakada 8c80922c82
Fixed RbConfig spec for multiarch 2020-03-28 16:27:01 +09:00
Nobuyoshi Nakada 7072e0324e
Guard RbConfig spec unless installed 2020-03-28 14:57:17 +09:00
Yusuke Endoh 6eb3820aad spec/ruby/optional/capi/kernel_spec.rb: stop a spec that causes SEGV
I think the wrong terminating argument cannot work.
To stop the noisy CI failures, the spec is tentatively suspended.
2020-03-28 11:12:30 +09:00
Benoit Daloze f234d51eab Update to ruby/spec@ec84479 2020-03-28 00:22:51 +01:00
Benoit Daloze 296f68816c Update to ruby/mspec@16b5a0a 2020-03-28 00:22:48 +01:00
Nobuyoshi Nakada f6b6a7ad34
Show failed times 2020-03-24 14:56:03 +09:00
Takashi Kokubun eff0c5bf2a
Try to avoid random failures on clock_getres_spec.rb
This spec fails too often
https://github.com/ruby/ruby/runs/529546249
https://github.com/ruby/ruby/runs/524933256
2020-03-23 22:53:54 -07:00
Jeremy Evans 4f7b435c95 Support obj.clone(freeze: true) for freezing clone
This freezes the clone even if the receiver is not frozen.  It
is only for consistency with freeze: false not freezing the clone
even if the receiver is frozen.

Because Object#clone is now partially implemented in Ruby and
not fully implemented in C, freeze: nil must be supported to
provide the default behavior of only freezing the clone if the
receiver is frozen.

This requires modifying delegate and set, to set freeze: nil
instead of freeze: true as the keyword parameter for
initialize_clone.  Those are the two libraries in stdlib that
override initialize_clone.

Implements [Feature #16175]
2020-03-22 09:30:07 -07:00
Nobuyoshi Nakada 5b287481be
Removed non-RUBY_INTEGER_UNIFICATION code 2020-03-21 16:59:55 +09:00
Yusuke Endoh d514ba8e17 `Proc` made by `Hash#to_proc` should be a lambda [Bug #12671]
Like `Symbol#to_proc` (f0b815dc67)
2020-03-16 23:38:26 +09:00
Yusuke Endoh 47141797be hash.c: Do not use the fast path (rb_yield_values) for lambda blocks
As a semantics, Hash#each yields a 2-element array (pairs of keys and
values).  So, `{ a: 1 }.each(&->(k, v) { })` should raise an exception
due to lambda's arity check.
However, the optimization that avoids Array allocation by using
rb_yield_values for blocks whose arity is more than 1 (introduced at
b9d2960337 and some commits), seemed to
overlook the lambda case, and wrongly allowed the code above to work.

This change experimentally attempts to make it strict; now the code
above raises an ArgumentError.  This is an incompatible change; if the
compatibility issue is bigger than our expectation, it may be reverted
(until Ruby 3.0 release).

[Bug #12706]
2020-03-16 23:17:12 +09:00
Nobuyoshi Nakada f14409c9bb
Enclosed version constant 2020-03-15 22:21:23 +09:00
Nobuyoshi Nakada 1ad9b231ca
Added guard against [Bug #16497] 2020-03-15 22:15:39 +09:00
Jean Boussier e257c08f2e
[ruby/stringio] StringIO#initialize default to the source string encoding
[Bug #16497]

https://github.com/ruby/stringio/commit/4958a5ccab
2020-03-15 18:43:01 +09:00
Yusuke Endoh c6633f21a4 Update some syslog tests to absurb the format change of FreeBSD syslog
FreeBSD

```
$ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }'
rubyspec 78462 - - Hello
```

Linux

```
$ ruby -rsyslog -e 'Syslog.open("rubyspec", Syslog::LOG_PERROR) {|s| s.log(Syslog::LOG_ALERT, "Hello") }'
rubyspec: Hello
```

591ef7c807
2020-03-12 15:30:20 +09:00
Nobuyoshi Nakada 2fd779fcd9
Added version guard for OpenSSL::Config 2020-03-10 21:47:18 +09:00
Jeremy Evans e02bd0e713
Don't display singleton class in Method#inspect unless method defined there
Previously, if an object has a singleton class, and you call
Object#method on the object, the resulting string would include
the object's singleton class, even though the method was not
defined in the singleton class.

Change this so the we only show the singleton class if the method
is defined in the singleton class.

Fixes [Bug #15608]
2020-03-09 07:57:16 -07:00
Jeremy Evans f4394bbca3 Do not autosplat when calling procs that accept rest and keywords
When providing a single array to a block that takes a splat, pass the
array as one argument of the splat instead of as the splat itself,
even if the block also accepts keyword arguments.  Previously, this
behavior was only used for blocks that did not accept keywords.

Implements [Feature#16166]
2020-03-08 20:49:09 -07:00
Nobuyoshi Nakada 108f7536b3
Removed unnecessary `chomp`
As `String#split` with the default argument drops trailing newline
as a separator, preceding `String#chomp` is futile.
2020-03-07 17:04:37 +09:00
Kazuhiro NISHIYAMA fcd605020b
Fix a typo 2020-03-07 13:49:28 +09:00
Yusuke Endoh 17d5efa4fe spec/ruby/core/process/exec_spec.rb: remove a guard for openbsd
openbsd current seems to behave the same as other OSs.

https://rubyci.org/logs/rubyci.s3.amazonaws.com/openbsd-current/ruby-master/log/20200305T063005Z.fail.html.gz
2020-03-05 18:25:47 +09:00
Nobuyoshi Nakada af1863734c
Adjust types 2020-02-29 21:42:38 +09:00
dependabot[bot] 02a3e27608
Bump rake from 10.5.0 to 12.3.3 in /spec/mspec (#2942)
Bumps [rake](https://github.com/ruby/rake) from 10.5.0 to 12.3.3.
- [Release notes](https://github.com/ruby/rake/releases)
- [Changelog](https://github.com/ruby/rake/blob/master/History.rdoc)
- [Commits](https://github.com/ruby/rake/compare/v10.5.0...v12.3.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-28 10:13:28 -08:00
Benoit Daloze a0f5ff4c3c Update to ruby/spec@41bf282 2020-02-28 19:07:17 +01:00
Benoit Daloze 5d21050182 Update to ruby/mspec@a514ad7 2020-02-28 19:07:14 +01:00
Jeremy Evans 54499d7810 Remove support for passing nil to IO#ungetc
Fixes [Bug #13675]
2020-02-27 10:17:54 -08:00
Nobuyoshi Nakada 8a7e0aaaef
Warn non-nil `$/` [Feature #14240] 2020-02-23 13:37:40 +09:00
Nobuyoshi Nakada 6298ec2875
Warn non-nil `$\` [Feature #14240] 2020-02-23 13:37:40 +09:00
Benoit Daloze 4aebb49153 Expand Symbol#to_proc specs to be clearer 2020-02-22 14:43:52 +01:00
Nobuyoshi Nakada 5b29ea0845
Proc from Symbol needs a receiver
So its arity should be -2 instead of -1.

[Bug #16640]
https://bugs.ruby-lang.org/issues/16640#change-84337
2020-02-22 10:49:59 +09:00
Nobuyoshi Nakada f0b815dc67
`Proc` made by `Symbol#to_proc` should be a lambda [Bug #16260] 2020-02-19 15:46:26 +09:00
Yusuke Endoh 6bfc576271 spec/ruby/library/socket/constants/constants_spec.rb: skip on Android
IP_MAX_MEMBERSHIPS seems not to be defined on Android
2020-02-13 23:16:10 +09:00
Yusuke Endoh bbc6799334 spec/ruby/library/socket/addrinfo/getnameinfo_spec.rb: skip on Android
FreeBSD's GETNAMEINFO(3) says:

> If a link-layer address or UNIX-domain address is passed to
> getnameinfo(), its ASCII representation will be stored in host.  The
> string pointed to by serv will be set to the empty string if non-NULL;
> flags will always be ignored.

Android seems to behave like FreeBSD.
2020-02-13 23:13:17 +09:00
Yusuke Endoh 09a042ae04 spec/ruby/library/etc/: skip the specs related to group on Android
User/group system on Android seems different from normal Linux.
2020-02-13 23:11:28 +09:00
Yusuke Endoh db8c8c0916 spec/ruby/library/socket/addrinfo: skip the specs that uses SOCK_SEQPACKET on Android
SOCK_SEQPACKET seems not to be supported on Android
2020-02-13 23:10:03 +09:00
Yusuke Endoh 89bfad17d5 spec/ruby/library/syslog: skip the specs that use LOG_PERROR on Android
LOG_PERROR is defined on Android, but not implemented yet.
See also f3c4e620ac.
2020-02-13 23:08:31 +09:00
Yusuke Endoh c6ebbbd38b spec/ruby: skip the specs that use /etc/passwd on Android
There is no /etc/passwd on Android
2020-02-13 23:06:33 +09:00
Yusuke Endoh ca53ab581b spec/ruby/library/etc/confstr_spec.rb: skip on Android
There seems to be no _CS_PATH on Android.
2020-02-13 23:04:15 +09:00
Yusuke Endoh 02233e171c spec/ruby/core/process/spawn_spec.rb: Use / instead of /tmp
because there is no /tmp on Android.
2020-02-13 23:03:07 +09:00
Yusuke Endoh ed549f80b6 spec/ruby/core/process/clock_getres_spec.rb: skip on Android
in the same way as FreeBSD and OpenBSD.
I guess that the spec makes too strong assumption.
2020-02-13 23:00:30 +09:00
Yusuke Endoh 022268ae00 spec/ruby/core/encoding/locale_charmap_spec.rb: locale_charmap is UTF-8 on Android
nl_langinfo(CODESET) always returns UTF-8 on Android, regardless to
LC_ALL=C.
2020-02-13 23:00:03 +09:00
Yusuke Endoh a11fa7d8cd spec/ruby/core/dir/home_spec.rb: exclude Android
I couldn't find a robust way to get the home path except ENV["HOME"] on
Android Termux.
2020-02-13 22:56:42 +09:00
Jeremy Evans 7a288df7b8 Make yield in singleton class definitions in methods a SyntaxError
This behavior was deprecated in 2.7 and scheduled to be removed
in 3.0.

Calling yield in a class definition outside a method is now a
SyntaxError instead of a LocalJumpError, as well.
2020-02-11 12:44:23 -08:00
Nobuyoshi Nakada 92c86e39de
Removed a useless guard
MSpec requires Ruby 2.4 or more recent.
2020-02-09 12:13:28 +09:00
Yusuke Endoh 2173ae7801 spec/ruby/core/file/utime_spec.rb: far future timestamp may be trancated
Under some Ext4 filesystem settings, a timestamp is limited up to
0x37fffffff (2446-05-10).

https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Inode_Timestamps
> Therefore, timestamps should not overflow until May 2446.

Actually the spec fails under one of our CI environments, like:

```
1)
File.utime allows Time instances in the far future to set mtime and atime FAILED
Expected 2446 == 559444
to be truthy but was false
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-master/log/20200208T180002Z.fail.html.gz
2020-02-09 11:13:06 +09:00
Nobuyoshi Nakada 80cbf97918
[DOC] Added 2.7.x to the latest stable versions [ci skip] 2020-02-08 19:48:31 +09:00
Nobuyoshi Nakada 739fdb7ff0
[ruby/spec] Don't care about return values
RDoc says nothing about them.  Added an example that
ConditionVariable#wait can be woken up by
ConditionVariable#signal, instead.
2020-02-06 15:42:36 +09:00
Nobuyoshi Nakada 32adae431d
[ruby/spec] Just test that sleep completes 2020-02-06 15:42:16 +09:00
Nobuyoshi Nakada 3d83e641b1
[ruby/spec] Check by Thread#stop?
Check if threads are stopped by Thread#stop? instead of the status
name.
2020-02-06 14:50:32 +09:00
Benoit Daloze 809f0b8a13 Update to ruby/spec@f8a2d54 2020-01-28 20:47:48 +01:00
Benoit Daloze ed377cc9aa Update to ruby/mspec@9bce874 2020-01-28 20:47:46 +01:00
Jeremy Evans 766f8a7a60 Fix some spec breakage on 2.7 related to keyword arguments
These specs were probably added in the commit to fully
separate keyword arguments after the release of 2.7.0, but
apparently not tested on 2.7 before hand. The enclosing
ruby_version guard for these specs limits them to 2.7.
2020-01-28 09:26:02 -08:00
Benoit Daloze fe8573f31a Run specs against the latest release of 2.4 2020-01-28 18:12:24 +01:00
Benoit Daloze 0ad0e63887 Fix version guard in __dir__ spec 2020-01-28 18:01:59 +01:00
Nobuyoshi Nakada 9b55a9649f
Removed useless "spec"s
It is not specific to particular methods that keyword option
arguments are coerced to `Hash`es using `to_hash` method.
2020-01-27 10:19:09 +09:00
Nobuyoshi Nakada d4e1d4e94e
Moved Array#sample to rbinc 2020-01-26 19:45:58 +09:00
Nobuyoshi Nakada 29eb1b1602
Moved Array#shuffle and Array#shuffle! to rbinc 2020-01-26 19:40:34 +09:00
Yusuke Endoh 4396ced07d spec/ruby/core/process/times_spec.rb: add an output code for debugging 2020-01-25 19:48:10 +09:00
Nobuyoshi Nakada 109183c2c0
Guarded the examples for deprecated "taint" 2020-01-23 22:03:13 +09:00
Kazuhiro NISHIYAMA ac93cf4ff8
Update version guard
fix up 98ef38ada4
2020-01-15 10:50:53 +09:00
Jean Boussier 98ef38ada4 Freeze Regexp literals
[Feature #8948] [Feature #16377]

Since Regexp literals always reference the same instance,
allowing to mutate them can lead to state leak.
2020-01-15 10:38:47 +09:00
Hiroshi SHIBATA c7ef7d8a73 Also ignored cve_2014_8080_spec 2020-01-12 12:28:29 +09:00
Hiroshi SHIBATA e61cab3a36 Ignore rexml examples on ruby/spec 2020-01-12 12:28:29 +09:00
Nobuyoshi Nakada b0e9db65c3
Include the standard `id` command output
On macOS, GNU coreutils `id` is limited to NGROUPS_MAX groups,
because of the backward compatibility of getgroups(2).
2020-01-09 15:58:46 +09:00
Hiroshi SHIBATA 13f4f07f21 Merge bundler-2.1.4 2020-01-08 18:00:32 +09:00
Jeremy Evans 0eeed5bcc5 Make eval(code, binding) use (eval) as __FILE__ and 1 as __LINE__
This removes the warning that was added in
3802fb92ff, and switches the behavior
so that the eval does not use the binding's __FILE__ and __LINE__
implicitly.

Fixes [Bug #4352]
2020-01-03 20:13:09 -08:00
Jeremy Evans e014e6bf66 Update specs for keyword argument separation 2020-01-02 18:40:45 -08:00
Sutou Kouhei e1c363f847
[bundler/bundler] Add ruby2_keywords
https://github.com/bundler/bundler/commit/29d932d72d
2020-01-01 07:41:37 +09:00
MSP-Greg eb2b425821 MinGW on Actions (#2791)
* MinGW - skip spec in spec/ruby/optional/capi/thread_spec.rb

C-API Thread function rb_thread_call_without_gvl
      -- runs a C function with the global lock unlocked and unlocks IO with the generic RUBY_UBF_IO

stops/freezes spec tests

See https://bugs.ruby-lang.org/issues/16265

* MinGW - skip test test/resolv/test_dns.rb

Test times out in CI (both AppVeyor & Actions), cannot repo locally

* MinGW - skip test test/ruby/test_thread_queue.rb

* Add Actions mingw.yml
2019-12-30 23:19:31 -08:00
Alan Wu 3264a00958 Fix Proc#<< spec
[Bug #16406]
2019-12-30 18:13:55 -05:00
Alan Wu 99c7b0b7ea
Decide lambdaness of (f << g) using g (#2729)
* Deciding lambdaness of (f << g) using g

* Use version guards for spec changes
2019-12-30 17:47:58 -05:00
Benoit Daloze c74d30e795 Update to ruby/spec@7241f39 2019-12-27 17:36:07 +01:00
Benoit Daloze 74fdc1e60f Update to ruby/mspec@673fcab 2019-12-27 17:36:04 +01:00
Benoit Daloze a2fac1d72c Update to ruby/spec@d419e74 2019-12-27 16:46:08 +01:00
Benoit Daloze 26a9f80c82 Update to ruby/mspec@1034afc 2019-12-27 16:46:05 +01:00
Hiroshi SHIBATA 1857b44278
Merge Bundler 2.1.2 from bundler/bundler.
[Misc #16449][ruby-core:96458]
2019-12-25 07:28:02 +09:00
Nobuyoshi Nakada e954be14d0
Get rid of false positive misspellings
[Bug #16437]
2019-12-24 10:33:32 +09:00
NAKAMURA Usaku 204dc3f39f Revert "Should return "." for File.extname("file.") also on Windows"
We want to introduce consistency and better compatibility with unixen,
but the Windows APIs doues not have consistency fundamentally and
we can not found any logical way...

This reverts commit 61aff0cd18.
2019-12-23 11:54:25 +09:00
Benoit Daloze 7c33ee5ddf Move version guard outside to make it clear the method was added in Ruby 2.5 2019-12-22 11:39:22 +01:00
NAKAMURA Usaku 61aff0cd18 Should return "." for File.extname("file.") also on Windows
But not changes another cases, such as "file.rb."
[Bug #15267]
2019-12-22 02:42:09 +09:00
Alan Wu ddb6023d64 Add spec for capturing Kernel#lambda with Kernel#method 2019-12-21 09:08:52 -05:00
Alan Wu e0b336c8ce Add specs for calling into Kernel#lambda with super 2019-12-21 09:08:52 -05:00
Nobuyoshi Nakada 435a4ca2a3
Makes the receiver to FrozenError.new a keyword parameter
[Feature #16419]
2019-12-20 14:18:20 +09:00
Nobuyoshi Nakada e68999c82c
Fixed misspellings
Fixed misspellings reported at [Bug #16437], for default gems.
2019-12-20 12:19:45 +09:00
Nobuyoshi Nakada db16629008
Fixed misspellings
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
2019-12-20 09:32:42 +09:00
Hiroshi SHIBATA efbc0d499c
Merge bundler-2.1.1 from bundler/bundler 2019-12-18 14:53:19 +09:00
NARUSE, Yui 5da4a310cc close datasocket on stor of server side 2019-12-17 08:24:47 +09:00
David Rodríguez 9f43160014 Delegate should be supported now
Since `did_you_mean` dropped its dependency on it.
2019-12-15 16:41:10 +09:00
Hiroshi SHIBATA 286cb3395f Fixed test failures with gem command path on ruby core repo. 2019-12-15 16:41:10 +09:00
Hiroshi SHIBATA 38002a8adb Prepare to release bundler-2.1.0 2019-12-15 16:41:10 +09:00
Nobuyoshi Nakada 3098798044
Test `Thread#to_s` when used from to_s_spec.rb 2019-12-11 16:52:06 +09:00
Nobuyoshi Nakada d2d42081ce
`Thread#to_s` has been added at ruby 2.5 2019-12-11 16:52:06 +09:00
Koichi Sasada 1269157a6e Thread#to_s is not same as #inspect on old version.
Thread#to_s returns simple Object#to_s until Ruby 2.4.
2019-12-11 16:10:26 +09:00
Koichi Sasada 6025783a3b fix for old MRI versions 2019-12-11 14:00:32 +09:00
Jean byroot Boussier 8a80bfcfd4 Make Thread#to_s consistent with Method and Proc to_s 2019-12-11 11:59:14 +09:00
NARUSE, Yui 8852fa8760 Revert "Regexp#match{?} with nil raises TypeError as String, Symbol (#1506)"
This reverts commit 2a22a6b2d8.
Revert [Feature #13083]
2019-12-04 06:40:54 +09:00
NARUSE, Yui 08074eb712 Revert "Revert nil error and adding deprecation message"
This reverts commit 452bee3ee8.
2019-12-04 06:40:54 +09:00
NARUSE, Yui a705f6472c Revert "Improve warning message"
This reverts commit 31110d820c.
2019-12-04 06:40:54 +09:00
NARUSE, Yui 34a66b1f36 Revert "Fix warnings in Regexp#{match,match?} specs"
This reverts commit 782d1b8fb0.
2019-12-04 06:40:54 +09:00
Benoit Daloze 424ad9a493 Make more attempts to check for the precision of Process.times
* Process.clock_getres specs use 10_000 but that's quite slow for
  the Process.times spec.
2019-12-02 21:23:10 +01:00
Takashi Kokubun a47d6c256f
Fix random failure on getusage-missing environments
`* 1e6` makes a spurious result about floating point number's precision.

```
irb(main)[01:0]> 16.028
=> 16.028
irb(main)[02:0]> (16.028 * 1e6)
=> 16027999.999999998
```
2019-12-02 00:17:41 -08:00
Takashi Kokubun 185f760873
Debug random failure of ruby-spec on ci.rvm.jp 2019-12-01 23:23:40 -08:00
Benoit Daloze 617a3735ae Update to ruby/spec@dcf4955 2019-12-01 14:11:42 +01:00
Benoit Daloze 60d362b0bb Update to ruby/mspec@aa28e95 2019-12-01 14:11:40 +01:00
Nobuyoshi Nakada ab516e263c
[ruby/spec] Fix failures with LC_ALL=C
https://github.com/ruby/spec/commit/51047687c0
https://github.com/ruby/spec/commit/2b87b467cc
2019-12-01 21:55:51 +09:00
Nobuyoshi Nakada bdc62dfc8e
Fixed type of an index variable 2019-12-01 14:38:33 +09:00
Takashi Kokubun 5b1f7f26b4
Skip if getrusage is not supported
1243255c3a broke ci.rvm.jp tests like
http://ci.rvm.jp/results/trunk_clang_39@silicon-docker/2445098.

253232c028 works only if getrusage is supported.
2019-11-30 13:29:01 -08:00
Benoit Daloze 1243255c3a Update to ruby/spec@4eec3dc 2019-11-30 21:26:52 +01:00
Benoit Daloze ab8345271e Update to ruby/mspec@a401f63 2019-11-30 21:26:49 +01:00
Koichi Sasada 36da0b3da1 check interrupts at each frame pop timing.
Asynchronous events such as signal trap, finalization timing,
thread switching and so on are managed by "interrupt_flag".
Ruby's threads check this flag periodically and if a thread
does not check this flag, above events doesn't happen.

This checking is CHECK_INTS() (related) macro and it is placed
at some places (laeve instruction and so on). However, at the end
of C methods, C blocks (IMEMO_IFUNC) etc there are no checking
and it can introduce uninterruptible thread.

To modify this situation, we decide to place CHECK_INTS() at
vm_pop_frame(). It increases interrupt checking points.
[Bug #16366]

This patch can introduce unexpected events...
2019-11-29 17:47:02 +09:00
Kazuhiro NISHIYAMA fea24bbfdb Fix glob base in bundler.gemspec 2019-11-19 00:29:10 +09:00
Kazuhiro NISHIYAMA 9aa75795f9 Skip some tests if extracted from tarball 2019-11-19 00:29:10 +09:00
Kazuhiro NISHIYAMA e9992bcab0 Allow unknown if ruby core 2019-11-19 00:29:10 +09:00
Jeremy Evans ffd0820ab3 Deprecate taint/trust and related methods, and make the methods no-ops
This removes the related tests, and puts the related specs behind
version guards.  This affects all code in lib, including some
libraries that may want to support older versions of Ruby.
2019-11-18 01:00:25 +02:00
Jeremy Evans c5c05460ac Warn on access/modify of $SAFE, and remove effects of modifying $SAFE
This removes the security features added by $SAFE = 1, and warns for access
or modification of $SAFE from Ruby-level, as well as warning when calling
all public C functions related to $SAFE.

This modifies some internal functions that took a safe level argument
to no longer take the argument.

rb_require_safe now warns, rb_require_string has been added as a
version that takes a VALUE and does not warn.

One public C function that still takes a safe level argument and that
this doesn't warn for is rb_eval_cmd.  We may want to consider
adding an alternative method that does not take a safe level argument,
and warn for rb_eval_cmd.
2019-11-18 01:00:25 +02:00
Hiroshi SHIBATA bb9ecd026a Merge Bundler 2.1.0.pre3 released version 2019-11-13 10:19:51 +09:00
Nobuyoshi Nakada bf34ade7ef
Show the name `Kernel#proc` in the warning message 2019-11-12 22:58:09 +09:00
Hiroshi SHIBATA 7585bc3187 Merge Bundler 2.1.0.pre.3
Features:
    - Add caller information to some deprecation messages to make them easier to fix [#7361](https://github.com/bundler/bundler/pull/7361)
    - Reconcile `bundle cache` vs `bundle package` everywhere. Now in docs, CLI help and everywhere else `bundle cache` is the preferred version and `bundle package` remains as an alias [#7389](https://github.com/bundler/bundler/pull/7389)
    - Display some basic `bundler` documentation together with ruby's RDoc based documentation [#7394](https://github.com/bundler/bundler/pull/7394)

  Bugfixes:
    - Fix typos deprecation message and upgrading docs [#7374](https://github.com/bundler/bundler/pull/7374)
    - Deprecation warnings about `taint` usage on ruby 2.7 [#7385](https://github.com/bundler/bundler/pull/7385)
    - Fix `--help` flag not correctly delegating to `man` when used with command aliases [#7388](https://github.com/bundler/bundler/pull/7388)
    - `bundle add` should cache newly added gems if an application cache exists [#7393](https://github.com/bundler/bundler/pull/7393)
    - Stop using an insecure folder as a "fallback home" when user home is not defined [#7416](https://github.com/bundler/bundler/pull/7416)
    - Fix `bundler/inline` warning about `Bundler.root` redefinition [#7417](https://github.com/bundler/bundler/pull/7417)
2019-11-11 18:56:25 +09:00
Nobuyoshi Nakada 03fdf02321
Removed trial and errors 2019-11-09 23:00:32 +09:00
Nobuyoshi Nakada a68205c5c1
Specify the permission
To make the temporary directory non-writable by group and others.
2019-11-09 22:40:14 +09:00
Nobuyoshi Nakada 774cfb0655
Fixed the debug print 2019-11-09 22:15:15 +09:00
Nobuyoshi Nakada 20bc038ea3
Debug-print tmpdir info 2019-11-09 21:59:07 +09:00
Kazuhiro NISHIYAMA 352096ef60
Add debug print 2019-11-09 16:45:27 +09:00
Yusuke Endoh 9deca1a3b9 Try to fix test-spec failure on macOS
Not sure what is happening, but spec/ruby/security/cve_2018_6914_spec.rb
fails on macOS.
https://github.com/ruby/ruby/runs/294462511#step:10:134

I suspect that the state of a directory is weird immediately after it is
created (not writable or even world writable?).  This change tries to
make sure that ENV["TMPDIR"] is actually used by Dir.tmpdir.
2019-11-09 00:25:28 +09:00
Benoit Daloze 40e161a612 Exclude some clocks on armv8 too
* See https://bugs.ruby-lang.org/issues/16234#note-16
2019-11-06 23:10:15 +01:00
Jun Aruga f5c7fc495a Fix spawn_spec.rb for Travis arm64 environment.
The process group id (/proc/[pid]/stat 5th field) is 0
in the Travis arm64 environment.

This is a case where it is available.

$ cat /proc/4543/stat
4543 (ruby) S 4525 4525 1384 34818 4525 4194304 37443 1754841 0 0 366 105 2291 391 20 0 3 0 1381328 1428127744 11475 18446744073709551615 94195983785984 94195986670225 140728933833312 0 0 0 0 0 1107394127 0 0 0 17 2 0 0 1 0 0 94195987686512 94195987708942 94196017770496 140728933835483 140728933835595 140728933835595 140728933842904 0

This is a case where it is not available in Travis arm64 environment.

$ cat /proc/19179/stat
19179 (ruby) S 19160 0 0 0 -1 4194560 37618 1710547 313 163 770 665 5206 1439 20 0 2 0 17529566 1196347392 10319 18446744073709551615 187650811428864 187650815023116 281474602721280 0 0 0 0 4096 1107390031 0 0 0 17 22 0 0 0 0 0 187650815091456 187650815114064 187651414974464 281474602725080 281474602725211 281474602725211 281474602729420 0

See "man proc" for detail.
2019-11-06 09:08:37 -08:00
Nobuyoshi Nakada c6a52cffd1
Separated `@counter` and `@tally` so that "-ft" works with "-j" 2019-11-05 17:43:38 +09:00
Nobuyoshi Nakada fa52a924aa Enable "-f" option in multi_exec mode
Make `MultiFormatter` a module and extend the formatter specified
by "-f" option.
2019-11-05 17:42:35 +09:00
Nobuyoshi Nakada 19f91f7880 `DottedFormatter#finish` consistency
Rmoved optional parameter `printed_exceptions`, and clear
`exceptions` just after printing each exception, instead.
2019-11-05 17:42:35 +09:00
Nobuyoshi Nakada dfb3322d27 `DottedFormatter#state` consistency
Let the method of `DottedFormatter` subclasses have the same
arity.
2019-11-05 17:42:35 +09:00
NARUSE, Yui bea322a352 Revert "[EXPERIMENTAL] Make Symbol#to_s return a frozen String [Feature #16150]"
This reverts commit 6ffc045a81.
2019-11-05 17:30:54 +09:00
Benoit Daloze 782d1b8fb0 Fix warnings in Regexp#{match,match?} specs 2019-11-03 11:25:42 +01:00
Kenichi Kamiya 31110d820c Improve warning message
https://github.com/ruby/ruby/pull/2637#discussion_r341812475
2019-11-03 11:03:04 +01:00
Kenichi Kamiya 452bee3ee8 Revert nil error and adding deprecation message 2019-11-03 11:03:04 +01:00
Yusuke Endoh 5f6fbf8725 spec: Fix syntax errors
Follow up of 473882e01f
2019-10-31 17:11:23 +09:00
Hiroshi SHIBATA 473882e01f
Skip tainted examples for stringio 2019-10-31 16:50:00 +09:00
Nobuyoshi Nakada fee5cde00b
Fix tests for CVE-2018-6914
Since the current working directory is not involved in `Tempfile`
and `Dir.mktmpdir` (except for the last resort), it is incorrect
to derive the traversal path from it.  Also, since the rubyspec
temporary directory is created under the build directory, this is
not involved in the target method.  Fixed sporadic errors in
test-spec.
2019-10-29 22:40:41 +09:00
Benoit Daloze 664e96b1de Update to ruby/spec@28a728b 2019-10-26 20:53:01 +02:00
Benoit Daloze 3eb0d50c0b Update to ruby/mspec@e171725 2019-10-26 20:52:59 +02:00
Jeremy Evans 8c59b9250c Update date specs
Allow Date.new spec to run on 2.7.

Separate Date.valid_jd? specs, since 2.7 is now stricter and
requires numeric value for the first argument.
2019-10-24 12:34:51 -07:00
Hiroshi SHIBATA 70ca56deda
Temporarily skipped with upstream changes of Date library. 2019-10-24 18:50:57 +09:00
Koichi Sasada 4c3e3b8028 Revert "Fix Fiber#transfer"
This reverts commit fa8ac91e95.

Previous behavior is intentional.
2019-10-24 16:46:21 +09:00
Jeremy Evans fa8ac91e95
Fix Fiber#transfer
Fiber#transfer previously made it impossible to resume the fiber
if it was transferred to (no resuming the target of Fiber#transfer).
However, the documentation specifies that you cannot resume a fiber
that has transferred to another fiber (no resuming the source of
Fiber#transfer), unless control is transferred back.

Fix the code by setting the transferred flag on the current/source
fiber, and unsetting the transferred flag on the target fiber.

Fixes [Bug #9664]
Fixes [Bug #12555]
2019-10-21 16:54:58 -07:00
Nobuyoshi Nakada f2ed8466d3
Fixed a typo [ci skip] 2019-10-20 02:58:32 +09:00
Jeremy Evans 0162e7e647 Make circular argument reference a SyntaxError instead of a warning
Fixes [Bug #10314]
2019-10-17 09:32:06 -07:00
Nobuyoshi Nakada e169ad93f4 Fixed File.extname at a name ending with a dot
File.extname now returns a dot string at a name ending with a dot.
[Bug #15267]
2019-10-17 18:51:51 +09:00
git 2a261909cc * remove trailing spaces. [ci skip] 2019-10-17 17:45:02 +09:00
Kenichi Kamiya 2a22a6b2d8 Regexp#match{?} with nil raises TypeError as String, Symbol (#1506)
* {String|Symbol}#match{?} with nil returns falsy

To improve consistency with Regexp#match{?}

* String#match(nil) returns `nil` instead of TypeError
* String#match?(nil) returns `false` instead of TypeError
* Symbol#match(nil) returns `nil` instead of TypeError
* Symbol#match?(nil) returns `false` instead of TypeError

* Prefer exception

* Follow empty ENV

* Drop outdated specs

* Write ruby/spec for above

https://github.com/ruby/ruby/pull/1506/files#r183242981

* Fix merge miss
2019-10-17 17:44:46 +09:00
Nobuyoshi Nakada 929d5fd3b9 Comparable#clamp with a range [Feature #14784] 2019-10-16 01:42:34 +09:00
Nobuyoshi Nakada 0195966ba2
Suppress warnings for Thread.exclusive 2019-10-14 15:42:27 +09:00
Sutou Kouhei 95c420c4a6
Import StringScanner 1.0.3 (#2553) 2019-10-14 12:40:50 +09:00
Takashi Kokubun 7db83b04d0
Revert "Simplify bin_path_spec.rb guard"
This reverts commit a56d742e69.

I was checking the CI result of the wrong revision. It actually worked
fine https://ci.appveyor.com/project/ruby/ruby/builds/27866303. Never
mind...
2019-10-03 15:58:20 -07:00
Takashi Kokubun a56d742e69
Simplify bin_path_spec.rb guard
For some reason the guard_not seems not working as expected
https://ci.appveyor.com/project/ruby/ruby/builds/27866153/job/v6wa6q6p7b7n7r37
2019-10-03 15:33:11 -07:00
Takashi Kokubun 182336ccb5
bin_path_spec.rb has failed from the beginning
for mswin. This spec is not valid for mswin platform.
https://ci.appveyor.com/project/ruby/ruby/builds/27748774/job/85khngfpc806m5lj
2019-10-03 14:25:45 -07:00
Jeremy Evans ef697388be
Treat return in block in class/module as LocalJumpError (#2511)
return directly in class/module is an error, so return in
proc in class/module should also be an error.  I believe the
previous behavior was an unintentional oversight during the
addition of top-level return in 2.4.
2019-10-02 07:56:28 -07:00
Benoit Daloze 54d49aeb52 Update to ruby/spec@2699ea4 2019-09-29 19:56:15 +02:00
Jeremy Evans 869e4f6e4c Fix or suppress keyword argument separation warnings in util_spec
Some warnings are because the @o.rb_scan_args call doesn't
include keyword arguments, but the first argument is passed to
rb_scan_args may have a last hash treated as keywords.  Those
should be handled using rb_scan_args_kw on Ruby 2.7.

Other warnings are for the deprecated rb_scan_args behavior to
split option hashes or treat a nil argument as an option hash.
Those warnings should just be suppressed.
2019-09-29 10:34:07 -07:00
Benoit Daloze 070cbe22b7 Update to ruby/spec@34e6246 2019-09-29 19:13:37 +02:00
Benoit Daloze d51b4e34fb Update to ruby/mspec@5dda9fb 2019-09-29 19:13:35 +02:00
Benoit Daloze 2d41c712a7 Skip default gemspecs spec if the default_specifications_dir cannot be found 2019-09-29 18:34:12 +02:00
Benoit Daloze a17bc04d15 Update to ruby/spec@e69a14c 2019-09-29 18:01:32 +02:00
Benoit Daloze f9a9f3c7c6 Update to ruby/mspec@8cabcef 2019-09-29 18:01:30 +02:00
Benoit Daloze 1c938a72aa Update to ruby/spec@519df35 2019-09-29 16:03:58 +02:00
Benoit Daloze 31bb66a19d Update to ruby/mspec@8106083 2019-09-29 16:03:47 +02:00
Jean Boussier eff15a269f [EXPERIMENTAL] Make NilClass#to_s, TrueClass#to_s and FalseClass#to_s return a frozen String
* Always the same frozen String for each of these values.
    * Avoids extra allocations whenever calling these 3 methods.
    * See [Feature #16150]
2019-09-27 13:52:33 +09:00
Jean Boussier 9d0866c7d7 [EXPERIMENTAL] Make Module#name return a frozen String
* Always the same frozen String for a given Module or Class.
    * Avoids extra allocations whenever calling Module#name.
    * See [Feature #16150]
2019-09-26 13:25:23 +02:00
Benoit Daloze 6ffc045a81 [EXPERIMENTAL] Make Symbol#to_s return a frozen String
* Always the same frozen String for a given Symbol.
* Avoids extra allocations whenever calling Symbol#to_s.
* See [Feature #16150]
2019-09-26 10:23:02 +02:00
Jeremy Evans 27144de2bd Fix documentation for ENV.each to return ENV
Also have spec check that it returns ENV.

Mostly from burdettelamar@yahoo.com (Burdette Lamar).

Fixes [Bug #16164]
2019-09-20 12:18:07 -07:00
Hiroshi SHIBATA 67a6662032
Removed Scanf from the ruby repository. 2019-09-20 12:43:11 +09:00
Hiroshi SHIBATA a3b8501614
Removed CMath from the ruby repository. 2019-09-20 12:31:37 +09:00
Nobuyoshi Nakada e6378cdcd8
Allow calling a private accessor with `self.`
[Feature #11297] [Feature #16123]
2019-09-20 02:21:37 +09:00
Nobuyoshi Nakada d583df5259
Added version guard
[Feature #11297] [Feature #16123]
2019-09-20 02:21:25 +09:00
Dylan Thacker-Smith 7fbd2f7cc2
Allow calling a private method with `self.`
This makes it consistent with calling private attribute assignment
methods, which currently is allowed (e.g. `self.value =`).

Calling a private method in this way can be useful when trying to
assign the return value to a local variable with the same name.

[Feature #11297] [Feature #16123]
2019-09-20 02:20:59 +09:00
Hiroshi SHIBATA 7d354175d7
Fixed up ccbfb054b1 2019-09-18 18:26:33 +09:00
Hiroshi SHIBATA 2da8574930
Fixed the rubocop warnings 2019-09-18 18:26:33 +09:00
David Rodríguez effacde2c0
[bundler/bundler] Merge all `bundle check --path` specs
And skip them all for bundler 3.

https://github.com/bundler/bundler/commit/b88936cdc2
2019-09-18 18:26:33 +09:00
Bundlerbot 434af7303c
[bundler/bundler] Merge #7340
7340: Fix bundle clean issue r=deivid-rodriguez a=deivid-rodriguez

### What was the end-user problem that led to this PR?

The problem was that `bundle clean` is crashing under some conditions.

### What was your diagnosis of the problem?

My diagnosis was that sometimes (when the bundle includes git sourced gems with extensions), it assumes that some paths exist, but they don't.

### What is your fix for the problem, implemented in this PR?

My fix is to ignore those paths.

### Why did you choose this fix out of the possible options?

I chose this fix because it fixes the issue.

Fixes #7338.

Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit b007fde67c77c1f15f13b97eda186644c2a2be04)

https://github.com/bundler/bundler/commit/3766053507
2019-09-18 18:26:33 +09:00
David Rodríguez e6ad9452b6
[bundler/bundler] Fix remembered flag deprecation message
It was suggested a deprecated command as a fix.

https://github.com/bundler/bundler/commit/e330a9a34f
2019-09-18 18:26:33 +09:00
Samuel Giddins 4f2f6aeb5f
[bundler/bundler] Add a spec for installing git deps after packaging w/o git
https://github.com/bundler/bundler/commit/65351c58b8
2019-09-18 18:26:32 +09:00
David Rodríguez 0c6529bac2
[bundler/bundler] Revert "Add all platforms to lockfile by default"
This reverts commit 3dc509e645abb497e4dc92a7c42be471ff87db0b.

https://github.com/bundler/bundler/commit/b5766564fb
2019-09-18 18:26:32 +09:00
David Rodríguez 6f16ededdd
[bundler/bundler] Revert "Remove now meaningless warning"
This reverts commit 00b095b98fe4bd44950beaf3bc9f1d91eac7b69e.

https://github.com/bundler/bundler/commit/e93bce3b20
2019-09-18 18:26:32 +09:00
Takayuki Nakata c27aaf1a8f
[bundler/bundler] Fix comments and messages to refer to https url
https://github.com/bundler/bundler/commit/a86b49f1b9
2019-09-18 18:26:32 +09:00
David Rodríguez b9996803f7
[bundler/bundler] Remove duplicated spec filter
https://github.com/bundler/bundler/commit/b7fc6f4187
2019-09-18 18:26:32 +09:00
David Rodríguez a29ead52e1
[bundler/bundler] Deprecate `--path` flag to `bundle check`
https://github.com/bundler/bundler/commit/0a0e7cf5ec
2019-09-18 18:26:32 +09:00
Nobuyoshi Nakada 751d4ab9c2
Refine Timezone fixture 2019-09-15 21:55:34 +09:00
Yusuke Endoh cce6cfbe48 Make test-all and test-spec runnable on Android
Calling some syscall functions such as Dir.chroot causes SIGSYS instead
of EPERM on Android.
This change skips all tests that stops the test-suite run.
2019-09-09 20:24:03 +09:00
Benoit Daloze b10940a839 Improve Proc#to_s specs 2019-09-08 12:41:14 +02:00
Nobuyoshi Nakada aedf6946a7
Removed useless braces to suppress a warning 2019-09-08 12:54:06 +09:00
Benoit Daloze 324dd9d01f armv7l and armv7l are the same platform, generalize to armv7
[Bug #16007]
2019-09-07 12:53:47 +02:00
David Rodríguez 2a166cfea2 Add `File.absolute_path?` (#2198)
In order to check whether a path is absolute or not in a portable way.

[Feature #15868]
2019-09-05 20:00:50 +09:00
Jeremy Evans 4a3972c261 Remove bad expectation in spec
This spec should not be checking where methods are defined, only
that the method works as expected (returns a Lazy instance).
2019-09-03 11:30:49 -07:00
Nobuyoshi Nakada 6f206b8ec6
Prohibit nul-separated glob pattern [Feature #14643] (#2419) 2019-09-02 15:08:53 +09:00
Hiroshi SHIBATA 1756ec2065
Ignore the all of warnings with inline_spec.rb of bundler examples. 2019-09-01 08:56:00 +09:00
Jeremy Evans 3463e83192 Warn for keyword to last hash parameter when method has no optional/rest parameters
Previously, there was no warning in this case, even though we will
be changing the behavior in Ruby 3.

Fixes [Bug #14130]
2019-08-30 19:25:46 -07:00
Jeremy Evans b5b3afadfa Fix a couple of bundler issues with keyword argument separation
There are more issues than this, but hopefully this is enough
to get make test-bundler passing in CI.
2019-08-30 12:39:31 -07:00
Jeremy Evans a810f6cbef Update specs to handle non-Symbols for keyword splats in 2.7
Also handle some warnings for behavior that will change in 3.0.
2019-08-30 12:39:31 -07:00
Yusuke Endoh ba9adcc175 spec/ruby/core/unboundmethod/bind_call_spec.rb: Add ruby_version_is guard 2019-08-30 11:49:42 +09:00
Yusuke Endoh 09c940b17f spec/ruby/core/unboundmethod/bind_call_spec.rb: Added
For UnboundMethod#bind_call [Feature #15955] introduced in
002e592e0d67bb0271d16314a32380ad947c9ae9.
2019-08-30 11:13:00 +09:00
Nobuyoshi Nakada d3e0bc07e2
Fixed a comment [ci skip]
A range literal in conditional expression is turned into a
flip-flop, as a Range object is never falsy and does not make a
sense.
2019-08-29 11:23:16 +09:00
Nobuyoshi Nakada d92289cd8d
Revert "Remove warnings of flip-flop deprecation from tests and specs"
This reverts commit bf7a32d220.

flip-flop is no longer deprecated.

[Feature #5400]
2019-08-29 11:10:45 +09:00
Nobuyoshi Nakada 6a0d2bc2af
Follows callback declaration updates 2019-08-28 00:09:14 +09:00
Takashi Kokubun eaff19de2b
Fix rb_thread_create argument type
in response to the declaration change in
e3fc30564e.

Fixing the AppVeyor mswin CI failure:
https://ci.appveyor.com/project/ruby/ruby/builds/26980881/job/2j6h1qwjnbc8cpop

ref: https://github.com/ruby/ruby/pull/2404
2019-08-27 23:41:52 +09:00
Hiroshi SHIBATA d9b73dcc0d Remove github_action_linux tag from bundler examples.
Maybe it has fixed at 5a384e2c08
2019-08-23 19:05:45 +10:00
Nobuyoshi Nakada 4419b5dbc2
The investigation is going on... 2019-08-21 13:31:22 +09:00
lolwut a230e65e8b
[bundler/bundler] Freeze time to avoid failures at midnight
Specify just a string

set @built_at as nil before testing

https://github.com/bundler/bundler/commit/578ec96c9c
2019-08-21 08:10:49 +09:00
Hiroshi SHIBATA 1c2774526e
[bundler/bundler] Share test fixtures with parallel_tests
https://github.com/bundler/bundler/commit/a38161c5be
2019-08-21 08:10:49 +09:00
Hiroshi SHIBATA 10011f4371
[bundler/bundler] Try to use RunTimeLogger for parallel_tests
https://github.com/bundler/bundler/commit/faccc522d1
2019-08-21 08:10:48 +09:00
David Rodríguez ace88852f2
[bundler/bundler] Parallelize test suite
https://github.com/bundler/bundler/commit/23007cb107
2019-08-21 08:10:48 +09:00
David Rodríguez ede77d82e7
[bundler/bundler] Fix a couple of typos
https://github.com/bundler/bundler/commit/52b6b94068
2019-08-21 07:58:46 +09:00
David Rodríguez 1120bacd8b
[bundler/bundler] Remove the :ruby exclusion tag
Our current set of specs is the same for all supported rubies, and we
should keep it that way.

https://github.com/bundler/bundler/commit/c9dc0f6f2c
2019-08-21 07:58:46 +09:00
David Rodríguez bcc4ac924d
[bundler/bundler] Remove another 1.8.7 specific bit
https://github.com/bundler/bundler/commit/8c7942d2c6
2019-08-21 07:58:46 +09:00
David Rodríguez 5ea08883cf
[bundler/bundler] Remove old rubies stuff no longer needed
https://github.com/bundler/bundler/commit/36fb3287f4
2019-08-21 07:58:46 +09:00
Nobuyoshi Nakada dd58c4ba35
Investigation of a sporadic error at Github Actions 2019-08-20 16:07:43 +09:00
David Rodríguez 5a384e2c08 Fix some bundler specs (#2380)
* These seem to consistenly pass already

* Show actual command when running `make test-bundler`

Current the setup command that installs the necessary gems for testing
bundler was printed, but not the actual command that runs the tests.
That was a bit confusing.

* Borrow trick from setproctitle specs

* A title that long doesn't get set sometimes

No idea why, but the test doesn't need that the title is that long.

* Fix most gem helper spec ruby-core failures

* Fix the rest of the gem helper failures

* Fix version spec by improving the assertion

* Remove unnecessary `BUNDLE_RUBY` environment var

We can use `RUBY` when necessary, and `BUNDLE_RUBY` is not a good name
because bundler considers `BUNDLE_*` variables as settings.

* Rename `BUNDLE_GEM` to `GEM_COMMAND`

This is more descriptive I think, and also friendlier for bundler
because `BUNDLE_` env variables are interpreted by bundler as settings,
and this is not a bundler setting.

This fixes one bundler spec failure in config specs against ruby-core.

* Fix quality spec when run in core

Use the proper path helper.

* Fix dummy lib builder to never load default gems

If a dummy library is named as a default gem, when requiring the library
from its executable, the default gem would be loaded when running from
core, because in core all default gems share path with bundler, and thus
they are always in the $LOAD_PATH. We fix the issue by loading lib
relatively inside dummy lib executables.

* More exact assertions

Sometimes I have the problem that I do some "print debugging" inside
specs, and suddently the spec passes. This happens when the assertion is
too relaxed, and the things I print make it match, specially when they
are simple strings like "1.0" than can be easily be part of gem paths
that I print for debugging.

I fix this by making a more exact assertion.

* Detect the correct shebang when ENV["RUBY"] is set

* Relax assertion

So that the spec passes even if another paths containing "ext" are in
the load path. This works to fix a ruby-core issue, but it's a better
assertion in general. We just want to know that the extension path was
added.

* Use folder structure independent path helper

It should fix this spec for ruby-core.

* Fix the last failing spec on ruby-core

* Skip `bundle open <default_gem>` spec when no default gems
2019-08-20 09:46:31 +09:00
Hiroshi SHIBATA d3da1d57d3
Skip open_spec.rb:L95 because ruby repo doesn't have json as default gems. 2019-08-18 15:02:21 +09:00
David Rodríguez a77b3b4476 [bundler/bundler] Remove unnecessary require
https://github.com/bundler/bundler/commit/8ef571ed4e
2019-08-18 13:45:57 +09:00
David Rodríguez 683f9e1dbf [bundler/bundler] No need to activate the `fileutils` default gem
The version we're vendoring actually relaxed this restriction back to
2.3.0+, so we can always use the vendored version.

https://github.com/bundler/bundler/commit/d366cbfe5d
2019-08-18 13:45:45 +09:00
David Rodríguez 4756c5f7e7 [bundler/bundler] Remove unnecessary rubygems monkeypatch
Instead, make sure we always load the local copy of bundler during
specs, and never end up using the default copy.

https://github.com/bundler/bundler/commit/ac655ffeda
2019-08-18 13:45:35 +09:00
David Rodríguez 5a69a23afc [bundler/bundler] Don't use system bundler on this spec
If we use system bundler, when booting the "outermost" bundler process,
bundler will save the path to the system bundler in BUNDLE_BIN_PATH, and
use it again when booting the "innermost" bundler process (`bundle exec
echo foo`).

That means that second process will use the system bundler path again.
However, we have `-rsupport/hax` in RUBYOPT, so that file will load from
the local copy of bundler, and that file will load `bundler/version`
from the project (not from system), because -Ilib is in the LOAD_PATH.

That will end up causing redefinition errors because the same constant
will be loaded from two different locations.

In general, this is expected behavior, normally you will wrap the
process with `Bundler.with_original_env` to reset the environment.
However, the easiest fix here is to not use system bundler, because it's
not really necessary and thus doesn't help the readability of the spec.

https://github.com/bundler/bundler/commit/a3d72a34ab
2019-08-18 13:45:25 +09:00
David Rodríguez 0653d8c601 [bundler/bundler] Fix spec using the deprecated `bundle config` mode
https://github.com/bundler/bundler/commit/789dd1864f
2019-08-18 13:45:15 +09:00
David Rodríguez f753961611 [bundler/bundler] Remove a bunch of unneeded rubygems requires
https://github.com/bundler/bundler/commit/f9cb39e614
2019-08-18 13:44:46 +09:00
Zehan Zhao d80f5399ad [bundler/bundler] Fix open default gem error
https://github.com/bundler/bundler/commit/792d724752
2019-08-18 13:44:26 +09:00
David Rodríguez 98841b2b19 [bundler/bundler] Wrap `open` specs with a context
So I can add another context that doesn't run the `before` block.

https://github.com/bundler/bundler/commit/06d0acc45a
2019-08-18 13:44:22 +09:00
David Rodríguez e6e8d2d8c0 [bundler/bundler] Prefer `before` to `before :each`
https://github.com/bundler/bundler/commit/6678747fae
2019-08-18 13:44:13 +09:00
David Rodríguez cc644c7116 [bundler/bundler] Fix `bundle doctor` command
Previously `bundle doctor` would fail on any bundle that does not
include git gems or plugins. This is because the previously used
`Bundler.home` does not exist unless the bundle includes git gems or
plugins. For example, with `bundle config set path .bundle`, it points
to which does not exist unless this kind of gems exist in the Gemfile.

The name `Bundler.home` is really unfortunate, it should probably be
have more descriptive name, and be private. But for now I just want to
make `bundle doctor` usable.

https://github.com/bundler/bundler/commit/5531a18c1e
2019-08-18 13:44:03 +09:00
David Stosik a02dbcecb1 [bundler/bundler] Bundler displays a duplicate gem entries warning even if gems only appear once per group
https://github.com/bundler/bundler/commit/d18a83109e
2019-08-18 13:43:59 +09:00
David Rodríguez 08c58e3c0d
[bundler/bundler] Extract a `gemspec_dir` helper
https://github.com/bundler/bundler/commit/71a29e286a
2019-08-17 17:08:51 +09:00