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

1889 Коммитов

Автор SHA1 Сообщение Дата
David Rodríguez 4c5e862434 [rubygems/rubygems] Improve source gemfile/lockfile equivalence checks
Since we no longer have multiple global sources, each top level dependency is
always pinned to a single source, so it makes little sense to talk about
adding or removing a source. Instead, source changes always mean to
change the source one or more dependencies are pinned to. This logic can
now be much simpler.

https://github.com/rubygems/rubygems/commit/f1d33fa0df
2021-12-03 20:00:51 +09:00
David Rodríguez 248fae0ec4 [rubygems/rubygems] Improve sources representation
We have two representations of a source. Once used for sorting, which
should not depend on the source's state, but solely on its static
information, like remotes. Another one used for error and informational
messages, which should properly inform about the exact state of the
source when the message is printed.

This commit makes the latter be the default implementation of `to_s`, so
that error and informational messages are more accurate by default.

https://github.com/rubygems/rubygems/commit/b5f2b88957
2021-12-03 20:00:50 +09:00
David Rodríguez 7d974cc56f [rubygems/rubygems] Don't overwrite locked dependency sources too early
Otherwise we hide some useful message about dependency source changes.

https://github.com/rubygems/rubygems/commit/c926673c5b
2021-12-03 20:00:50 +09:00
David Rodríguez aa87780f8f [rubygems/rubygems] Fix incorrect order in changed sources message
https://github.com/rubygems/rubygems/commit/6f1b5f68de
2021-12-03 20:00:49 +09:00
David Rodríguez cf88271331 [rubygems/rubygems] Fix gemspec source unlocking also for prereleases like 0.0.0.SNAPSHOT
The default prerelease requirement in rubygems doesn't actually match
things like "0.0.0.SNAPSHOT".

https://github.com/rubygems/rubygems/commit/711498b342
2021-12-02 18:10:31 +09:00
David Rodríguez 2a15b28a9e [rubygems/rubygems] Fix materialization of locked 0 prereleases
Since the default requirement in rubygems is ">= 0", it was failing to
match 0 prereleases. Changing the default globally to be ">= 0.a"
instead is a major refactoring that's quite tricky to make backwards
compatible, so I'm special casing this where needed for now to fix the
regression.

https://github.com/rubygems/rubygems/commit/68fe37937c
2021-12-02 18:10:31 +09:00
Nobuyoshi Nakada a84dc9d80d [win32] skip example about STDIN encodings 2021-12-01 18:54:26 +09:00
Hiroshi SHIBATA 0b53a8895f
Merge rubygems master fd676ac464491afaa0baf5435cb11b3f86229cbd 2021-12-01 11:00:10 +09:00
Hiroshi SHIBATA 9f4bdeb403
Removed vcr files. They are needless for this repo 2021-12-01 09:53:07 +09:00
Nobuyoshi Nakada ac8647bec1
Fix `GC.total_time` example
The result may increase actually or not, since GC can finish
shorter than the timer granularity.
2021-11-30 08:49:41 +09:00
ooooooo-q af59d35570 [rubygems/rubygems] Fix escape of filenames in `bundle doctor`
https://github.com/rubygems/rubygems/commit/3ede1435ea
2021-11-30 01:29:34 +09:00
Benoit Daloze 67a1e22589 Update to ruby/spec@7f22a0b 2021-11-29 15:50:28 +01:00
Benoit Daloze e6d93a27af Update to ruby/mspec@098b320 2021-11-29 15:50:26 +01:00
David Rodríguez 59439446d9 [rubygems/rubygems] Fix missing locked specs when depended on other platform
https://github.com/rubygems/rubygems/commit/0396e899db
2021-11-27 05:31:54 +09:00
David Rodríguez f3320f164f [rubygems/rubygems] Fix `bundle info` sometimes claiming that bundler has been deleted
https://github.com/rubygems/rubygems/commit/fe1a31db31
2021-11-26 08:50:52 +09:00
David Rodríguez aace9cb162 [rubygems/rubygems] Fix bad instance variable name
Recent changes made a warning while running specs show up for some
reason, and it revealed this error.

https://github.com/rubygems/rubygems/commit/bbf55de38e
2021-11-25 04:02:21 +09:00
David Rodríguez b2b473707f [rubygems/rubygems] Check not having load system features also for successful runs
https://github.com/rubygems/rubygems/commit/4807bd19a5
2021-11-25 04:02:21 +09:00
David Rodríguez d49ee9e2c3 [rubygems/rubygems] These method should be returning a string
https://github.com/rubygems/rubygems/commit/dc391f4d87
2021-11-25 04:02:20 +09:00
David Rodríguez d123919595 [rubygems/rubygems] We should be checking raised exception, not status code here
https://github.com/rubygems/rubygems/commit/48f8cdab9c
2021-11-25 04:02:20 +09:00
David Rodríguez c4b1aa19a3 [rubygems/rubygems] Don't replace ENV twice on non Windows platforms
https://github.com/rubygems/rubygems/commit/8dc86b7096
2021-11-25 04:02:19 +09:00
Jean Boussier c0c2b31a35 Add Class#subclasses
Implements [Feature #18273]

Returns an array containing the receiver's direct subclasses without
singleton classes.
2021-11-23 10:50:44 +01:00
David Rodríguez 997adfd410 [rubygems/rubygems] Clarify `bundle viz` deprecation
https://github.com/rubygems/rubygems/commit/7f22fe56b3
2021-11-22 09:29:13 +09:00
David Rodríguez 80f39d78df [rubygems/rubygems] Allow `bundle update` to downgrade gems by changing the Gemfile
https://github.com/rubygems/rubygems/commit/6a19cca7e5
2021-11-19 10:12:10 +09:00
Jeremy Evans 75ecbda438 Make Module#{public,private,protected,module_function} return arguments
Previously, each of these methods returned self, but it is
more useful to return arguments, to allow for simpler method
decorators, such as:

```ruby
cached private def foo; some_long_calculation; end
```

Where cached sets up caching for the method.

For each of these methods, the following behavior is used:

1) No arguments returns nil
2) Single argument is returned
3) Multiple arguments are returned as an array

The single argument case is really the case we are trying to
optimize for, for the same reason that def was changed to return
a symbol for the method.

Idea and initial patch from Herwin Quarantainenet.

Implements [Feature #12495]
2021-11-18 09:47:40 -08:00
Nobuyoshi Nakada 89b440bf72
Expect bool as `sort:` option at glob [Feature #18287] 2021-11-18 21:47:18 +09:00
Yusuke Endoh 8a816fbe7b Revert "Temporary ignored the failing specs for Date"
This reverts commit 17e64cca6b.

The specs should work now.
2021-11-16 23:01:54 +09:00
Hiroshi SHIBATA 17e64cca6b
Temporary ignored the failing specs for Date 2021-11-16 21:22:28 +09:00
Hiroshi SHIBATA f3bda8987e
Merge the master branch of rubygems repo
Picked from 4b498709a0
2021-11-16 20:19:13 +09:00
David Rodríguez 3cf7130d70 [rubygems/rubygems] Remove duplicated spec
https://github.com/rubygems/rubygems/commit/86b874ed24
2021-11-12 06:05:09 +09:00
David Rodríguez 4736dec58b [rubygems/rubygems] Remove `gemfile_should_be` helper as well
https://github.com/rubygems/rubygems/commit/79f3c00caa
2021-11-12 06:05:08 +09:00
David Rodríguez 1f91009d24 [rubygems/rubygems] Remove `have_lockfile` matcher too
https://github.com/rubygems/rubygems/commit/635f3f2605
2021-11-12 06:05:08 +09:00
David Rodríguez d0f266460f [rubygems/rubygems] Remove `lockfile_should_be` helper
It doesn't add anything.

https://github.com/rubygems/rubygems/commit/ece3c864df
2021-11-12 06:05:07 +09:00
Hiroshi SHIBATA bd2674ad33 [rubygems/rubygems] Use bundler-graph instead of bundler-viz
https://github.com/rubygems/rubygems/commit/a54cca13db
2021-11-08 22:15:21 +09:00
haruuzion 82ae9b092c [rubygems/rubygems] Fix url
https://github.com/rubygems/rubygems/commit/6a5a80eff7
2021-11-06 01:39:24 +09:00
Nobuyoshi Nakada 539c42ed89 [rubygems/rubygems] Fix typos
https://github.com/rubygems/rubygems/commit/f328ef6f77
2021-11-04 23:06:25 +09:00
Nobuyoshi Nakada a202408180
Fix typos 2021-11-02 19:17:37 +09:00
David Rodríguez ed0f326e88 [rubygems/rubygems] Leave ":" after MANPATH when not set
So that system man pages still work after a gem with man pages overrides
it.

https://github.com/rubygems/rubygems/commit/1031879b87
2021-11-02 00:28:28 +09:00
David Rodríguez 4e7e057692 [rubygems/rubygems] Memoize materialized specs when requiring `bundler/setup`
Calling `Bundler.definition.specs` will memoize materialized specs.
However, requiring `bundler/setup` will end up materializing the same
set of specs, but not memoize them.

This change makes things consistent.

https://github.com/rubygems/rubygems/commit/e4c2b52824
2021-11-01 02:01:36 +09:00
David Rodríguez f634d1ee00 [rubygems/rubygems] Better error when installing a git lockfile and git not present
https://github.com/rubygems/rubygems/commit/28f4842196
2021-10-30 06:11:39 +09:00
Benoit Daloze a954f273a8 Cleanup GC.auto_compact spec
* Make the supported check more obvious.
2021-10-29 21:59:35 +02:00
Benoit Daloze 800dad6297 Skip GC.auto_compact= spec for platforms not supporting it
* See https://github.com/ruby/spec/pull/891
2021-10-29 21:54:17 +02:00
Josef Šimánek 71b370f6dd
[rubygems/rubygems] Enforce bundler platform (and default gem) to keep invalid gemspec test compatible with ruby-trunk.
https://github.com/rubygems/rubygems/commit/a77061d4e9
2021-10-29 18:00:47 +09:00
Josef Šimánek 9b7afd3cff
[rubygems/rubygems] Update mirror_probe realword specs to not rely exactly at raised HTTP exception.
- this exception differs across Ruby versions.

https://github.com/rubygems/rubygems/commit/38c6927a5f
2021-10-29 18:00:47 +09:00
Josef Šimánek 0029e0948a
[rubygems/rubygems] Install stringio for standalone spec.
- previously it was required already by net/http, but it is not anymore using ruby-trunk
- 996d18a43f
- 364044e090 (diff-a1d29a94def02829fd4f9ba591199acf079e028f5a2002a77c363eb01212e112)

https://github.com/rubygems/rubygems/commit/be1779655a
2021-10-29 18:00:46 +09:00
Josef Šimánek b179166421
[rubygems/rubygems] Assert NoMethodError message only partialy in downloader_spec.
- latest ruby adds error_highlight gem introducing backtrace into exception message

https://github.com/rubygems/rubygems/commit/08c70f9dd0
2021-10-29 18:00:46 +09:00
Josef Šimánek fd17ae8205
[rubygems/rubygems] Lock racc version in platform_spec.
- latest ruby is shipped with racc 1.6 making this spec failing
- this spec is related to platform locking, changing version should not do any harm

https://github.com/rubygems/rubygems/commit/3e18b626cb
2021-10-29 18:00:46 +09:00
Frederik Dudzik f45af5f0a4
Support gemification of tsort
Co-authored-by: Frederik Dudzik <frederik.dudzik@shopify.com>
Co-authored-by: Jacques Chester <jacques.chester@shopify.com>
2021-10-29 17:32:52 +09:00
Josef Šimánek a9be84db82 [rubygems/rubygems] Add new default gems to setup_spec exempts.
- error_highlight was introduced at e946049665
  orriginally as error_squiggle later renamed at 9438c99590

- ruby2_keywords was introduced as a placeholder gem only at 21d2463fbc

https://github.com/rubygems/rubygems/commit/c9ebe7c7d2
2021-10-29 17:22:25 +09:00
David Rodríguez 79f9053599 [rubygems/rubygems] Unskip inline spec that can pass now on the latest rubies
https://github.com/rubygems/rubygems/commit/a81d4421b4
2021-10-29 17:13:18 +09:00
Frederik Dudzik 2a90ad7aa5 [rubygems/rubygems] use Rubocop Lint/Debugger check rather than custom spec
We have a quality spec that check for debugger statements. Rubocop has a
cop that tests for the same thing. As such it makes sense to remove the
spec and activate the cop.

https://github.com/rubygems/rubygems/commit/dc1eb6eec5
2021-10-29 17:13:03 +09:00
Alan Wu e53d07f583 Rename ::YJIT to RubyVM::YJIT
Since the YJIT Ruby module is CRuby specific and not meant for general
use, it should live under RubyVM instead of at top level.
2021-10-28 13:43:02 -04:00
Benoit Daloze c75df796d8 Update to ruby/spec@21a48d9 2021-10-28 18:54:01 +02:00
David Rodríguez ed5f8eaf49 [rubygems/rubygems] Don't warn when a lockfile is locked to a dev version
Even if it's newer than the running versions. Dev versions are not
released to rubygems.org, so the warning message suggests a command that
doesn't work. And dev versions are currently non deterministic
(2.3.0.dev can be many different versions), so the warning doesn't
really make sense at the moment.

https://github.com/rubygems/rubygems/commit/6f31af27ef
2021-10-27 14:47:21 +09:00
Jean Boussier e5319dc985 pack.c: add an offset argument to unpack and unpack1
[Feature #18254]

This is useful to avoid repeteadly copying strings when parsing binary formats
2021-10-26 22:27:30 +02:00
Jeremy Evans 717ab0bb2e
Add Class#descendants
Doesn't include receiver or singleton classes.

Implements [Feature #14394]

Co-authored-by: fatkodima <fatkodima123@gmail.com>
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2021-10-26 12:35:21 -07:00
Peter Zhu a5b6598192 [Feature #18239] Implement VWA for strings
This commit adds support for embedded strings with variable capacity and
uses Variable Width Allocation to allocate strings.
2021-10-25 13:26:23 -04:00
David Rodriguez b4a43e4f57
[rubygems/rubygems] Show proper error when previous installation of gem can't be deleted
Instead of showing the bug report template with an error at a random
place.

https://github.com/rubygems/rubygems/commit/882ad3ab57
2021-10-25 20:48:51 +09:00
David Rodriguez 00412be204
[rubygems/rubygems] Show a proper error if gem path is not writable
Instead of showing the bug report place with an error at a randome
place.

https://github.com/rubygems/rubygems/commit/241854ce73
2021-10-25 20:48:51 +09:00
David Rodriguez f6d1909500
[rubygems/rubygems] Catch up with recent error message modification
https://github.com/rubygems/rubygems/commit/ae374c1f31
2021-10-25 20:48:51 +09:00
David Rodriguez f7f85c1feb
[rubygems/rubygems] Manage global gem cache directly
Previously, it was maintained in sync with the standard cache. That was
less efficient, and it caused some error messages to point to non
existent files.

https://github.com/rubygems/rubygems/commit/931f8cb8a9
2021-10-25 20:48:51 +09:00
David Rodriguez 4edcda67b3
[rubygems/rubygems] Simplify gem downloading inside bundler
We can skip most stuff in `Gem::RemoteFetcher#download`, and use
`Gem::RemoteFetcher#update_cache_path` directly.

This has the benefit of allowing us to remove some workarounds to
support several rubygems versions, but also allows us to pass the target
folder where the gem should be downloaded directly and skip the logic
inside `Gem::RemoteFetcher#download` to infer the cache path. This will
be useful later to fix some issues with the `global_gem_cache` feature
flag.

https://github.com/rubygems/rubygems/commit/8fe74a77e4
2021-10-25 20:48:51 +09:00
David Rodriguez 03a563b47e
[rubygems/rubygems] Remove unused `let`
https://github.com/rubygems/rubygems/commit/7e1316e454
2021-10-25 20:48:51 +09:00
Jean Boussier 5af3f7f357
[rubygems/rubygems] Vendor a pure ruby implementation of SHA1
This allows `Source::Git` to no longer load the `digest` gem as it is causing
issues on Ruby 3.1.

https://github.com/rubygems/rubygems/pull/4989/commits/c19a9f2ff7
2021-10-25 20:24:32 +09:00
Yusuke Endoh 86e3d77abb
Make Coverage suspendable (#4856)
* Make Coverage suspendable

Add `Coverage.suspend`, `Coverage.resume` and some methods.

[Feature #18176] [ruby-core:105321]
2021-10-25 20:00:51 +09:00
180909 66d09501c2
fix typo [ci skip] 2021-10-25 12:15:55 +09:00
TSUYUSATO Kitsune dfb47bbd17
Fix `Enumerable#each_cons` and `Enumerable#each_slice` to return a receiver
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-10-25 12:13:44 +09:00
Nobuyoshi Nakada 22a7f7ec5a
Refinement#include and Refinement#prepend have been deprecated 2021-10-22 15:06:41 +09:00
Nobuyoshi Nakada 9f4f3bd1cc
Refinement#include and Refinement#prepend have been deprecated 2021-10-22 13:53:21 +09:00
Takashi Kokubun 66a64e6f16
Fix tests with cppflags=-DYJIT_FORCE_ENABLE
0dbd95c625
2021-10-20 20:52:21 -07:00
Benoit Daloze 030b1892d5 Update to ruby/spec@254c380 2021-10-20 21:57:05 +02:00
Benoit Daloze 6aa1acb03d Add extra files from ruby/spec which were skipped due to .gitignore 2021-10-20 21:43:00 +02:00
Benoit Daloze a6c6eef04a Update to ruby/spec@d6921ef 2021-10-20 21:41:46 +02:00
Benoit Daloze 207a5a5bc1 Update to ruby/mspec@08e1275 2021-10-20 21:41:45 +02:00
Nobuyoshi Nakada 0bbfb6a37b
Fix error when srcdir not found
So that `spec/mspec/bin/mspec --help` works at least.
2021-10-18 11:44:20 +09:00
Nobuyoshi Nakada e1e3657746
Simplify srcdir fallback 2021-10-18 11:43:50 +09:00
Nobuyoshi Nakada 0871652f21
Not all environment variables can be convertible to IBM-437 2021-10-18 00:23:59 +09:00
David Rodríguez 30b6df4144 [rubygems/rubygems] Improve error messages in gem helpers
Previously they were printing the original command that was run, and
telling the user to rerun it. However, the command sometimes would not
match the exact command that was run (for example, when using the
`--local` flag), and in any case, it's simpler and more useful to print
the underlying error anyways.

https://github.com/rubygems/rubygems/commit/5bc0d51b58
2021-10-13 23:30:11 +09:00
David Rodríguez 853004e04d [rubygems/rubygems] Fix `bundle install` crash due to an incorrectly incomplete resolve
In case we have a corrupted lockfile that claims to support a platform, but
it's missing platform specific gems for it, bundler has a check that
detects the situation and forces a re-resolve. The result of this check
is kept under the `@locked_specs_incomplete_for_platformn` instance
variable in `Definition`.

The installer, however, calls `Definition#nothing_changed?` before this
instance variable has been filled, so the result of it is actually
incorrect here since it will claim that nothing has changed, but
something has changed (locked specs are incomplete for the current
platform).

The consequence of this incorrect result is that the installer thinks it
can go on without re-resolving, resulting in the incomplete resolution
from the lockfile being used, and in a crash being triggered due to
that.

The solution is to make sure the `@locked_specs_incomplete_for_platform`
instance variable is filled before `nothing_changed?` gets called.
Moving it to `initialize` makes the most sense, not because it's the
best place for it (we can refactor this later), but because all of the
other "outdated definition" checks are already set there.

https://github.com/rubygems/rubygems/commit/708afdd789
2021-10-13 21:16:40 +09:00
David Rodriguez 0f1f95a3e3 [rubygems/rubygems] Fix `bundle install` to force reinstallation of deleted gems
https://github.com/rubygems/rubygems/commit/8950631f02
2021-10-13 16:21:42 +09:00
David Rodríguez bd87397f73 [rubygems/rubygems] Use correct way to detect default gems
The other way, in particular matching a substring in the gemspec
summary, is brittle and no longer used since Ruby 2.0.

This needed rewriting the specs that depended on that way.

https://github.com/rubygems/rubygems/commit/059dbfa971
2021-10-13 16:21:42 +09:00
David Rodríguez d6627ab85c [rubygems/rubygems] Remove unnecessary code
All supported rubygems versions implement this.

https://github.com/rubygems/rubygems/commit/2130782ef6
2021-10-13 16:21:41 +09:00
David Rodriguez ad4e7308d2 [rubygems/rubygems] Make spec more realistic
The spec was just faking an installed gemspec without any installed gem
backing it up, resulting in `bundle install` claiming that the gem was
already installed when it was not.

https://github.com/rubygems/rubygems/commit/c35531d1c7
2021-10-13 16:21:41 +09:00
Kazuhiro NISHIYAMA 5deb273a1a
Fix a typo 2021-10-13 15:04:16 +09:00
David Rodriguez 0c3ac87345 [rubygems/rubygems] Show a warning in `bundle info` if gem has been deleted
https://github.com/rubygems/rubygems/commit/ff86cd7dd2
2021-10-11 19:13:16 +09:00
David Rodriguez 607efe9154 [rubygems/rubygems] Show the exact name of the gem that was deleted
If a non exact name (matched as a regexp) is passed to `bundle info`,
these strings might not match.

https://github.com/rubygems/rubygems/commit/831edf1edf
2021-10-11 19:13:15 +09:00
David Rodriguez 62d1deb0d1 [rubygems/rubygems] Match a more exact warning message
https://github.com/rubygems/rubygems/commit/80158e9d75
2021-10-11 19:13:15 +09:00
David Rodriguez 9072228a26 [ruby/rubygems] Get specs green on arm64-darwin-20
https://github.com/rubygems/rubygems/commit/7a0bd9801d
2021-10-11 00:23:54 +09:00
Nobuyoshi Nakada 7f3786c3e8
Use an isolated class
The number of all instances of `Class` may be affected by GC-able
anonymous classes created by other tests.
2021-10-10 01:20:40 +09:00
OKURA Masafumi 7e506716d2
Newly generated gems require Ruby 2.6.0
In 2021, Ruby 2.5 and older are EOL.
We can set the default required Ruby version to 2.6.0 to
encourage people to use newer Ruby.
If the command is executed with old Ruby, it falls back to 2.3.0.
It's still possible to create a gem for older Ruby just by changing
two lines of code (one in gemspec and another is in rubocop.yml).
2021-10-09 09:07:47 +09:00
David Rodríguez 91f794b516 [rubygems/rubygems] I see no harm in this, allow it
https://github.com/rubygems/rubygems/commit/01feb40283
2021-10-09 08:05:46 +09:00
David Rodríguez 991a3aad05 [rubygems/rubygems] `git commit` no longer needs to be allowed to fail
https://github.com/rubygems/rubygems/commit/12af03d32f
2021-10-09 08:05:34 +09:00
David Rodríguez a5bae843ff [rubygems/rubygems] Let `update_git` work with whatever branch is checkout out
Unless the `:branch` option is passed.

It's more efficient, and it results in less hardcoding of "master".

https://github.com/rubygems/rubygems/commit/aa5c3409ab
2021-10-09 08:05:23 +09:00
David Rodríguez 5a34b639fc [rubygems/rubygems] Make adding files and committing into a single command
For efficiency.

https://github.com/rubygems/rubygems/commit/979d1634dd
2021-10-09 08:05:11 +09:00
David Rodríguez b857a87653 [rubygems/rubygems] Keep different code in custom branch in dummy repo
This doesn't affect the outcome of the test, but it makes the `git
commit` command inside `update_git` not fail because of not having
anything to commit.

https://github.com/rubygems/rubygems/commit/ad0160ed97
2021-10-09 08:04:59 +09:00
David Rodríguez 70066196a0 [rubygems/rubygems] Fix typo
We want to update the original repo, not a fresh one.

This went undetected because the `git commit` command inside the
`update_git` method ignores failures, and in this case it was failing
because all files are untracked in the new repo.

I will fix that later but for now fix the typo.

https://github.com/rubygems/rubygems/commit/c889f1d715
2021-10-09 08:04:48 +09:00
Masataka Pocke Kuwabara d03d122ba1 [rubygems/rubygems] Improve performance of Specification#missing_extensions?
https://github.com/rubygems/rubygems/commit/90c1919f94
2021-10-09 08:04:08 +09:00
gabriele renzi ad92651d64 [rubygems/rubygems] Add glob infomation to Bundler::Source::Git#to_s
The glob information was not specified in the string representation for
a source, which led to non-deterministic behaviour when generating the
lockfile, since sources are sorted by this value.

https://github.com/rubygems/rubygems/commit/493b880abc
2021-10-09 08:03:43 +09:00
Jeremy Evans 08759edea8
Remove autoload for constant if the autoload fails
Previously, if an autoload failed (the file was loaded, but the
constant was not defined by the autoloaded file). Ruby will try
to autoload again if you delete the autoloaded file from
$LOADED_FEATURES.  With this change, the autoload and the
constant itself are removed as soon as it fails.

To handle cases where multiple threads are autoloading, when
deleting an autoload, handle the case where another thread
already deleted it.

Fixes [Bug #15790]
2021-10-08 14:54:26 -07:00
Hiroshi SHIBATA ae5dffd666
Followed up bd6e1a0f08 2021-10-07 18:34:29 +09:00
Nobuyoshi Nakada 7ed1180e00
Remove the useless platform guard 2021-10-06 12:19:52 +09:00
Nobuyoshi Nakada ddca0c6686
Fix filesystem dependent tests
Ruby cannot guarantee the resolutions of underlying filesystems.
2021-10-06 11:41:03 +09:00
Benoit Daloze b9f34062f0 Update to ruby/spec@ccf0d85 2021-10-05 19:41:44 +02:00
Jean Boussier afcbb501ac marshal.c Marshal.load accepts a freeze: true option.
Fixes [Feature #18148]

When set, all the loaded objects are returned as frozen.

If a proc is provided, it is called with the objects already frozen.
2021-10-05 18:34:56 +02:00
Jean byroot Boussier 529fc204af
marshal.c: don't call the proc with partially initialized objects. (#4866)
For cyclic objects, it requires to keep a st_table of the partially
initialized objects.
2021-09-30 16:50:31 +02:00
Hiroshi SHIBATA 2f19f4d1d8
Followed up behavior change of set
f360ebb306
2021-09-28 19:15:12 +09:00
Hiroshi SHIBATA 395da04aa6
Followed up ruby/spec examples for date.
f9f7f3a75e
2021-09-28 19:14:02 +09:00
Nobuyoshi Nakada 69ce154d6e
FL_USER flags on ohter than T_DATA are reserved [Misc #18059] 2021-09-25 15:38:38 +09:00
Nobuyoshi Nakada 225a29b9bc
FL_USER flags on ohter than T_DATA are reserved [Misc #18059] 2021-09-24 19:23:15 +09:00
fiveNinePlusR 105e037fe8 [rubygems/rubygems] Fix possible malicious website to example.com
example.com is the canonical stand in for domain examples and will never have a backing website.

via https://www.rfc-editor.org/rfc/rfc2606.html

https://github.com/rubygems/rubygems/commit/26622c81c2
2021-09-22 10:14:04 +09:00
Samuel Williams 4730a1e0ec Don't describe C function that does not exist in prior versions. 2021-09-20 22:07:34 +12:00
Samuel Williams 649c87bd86 Add C interface spec. 2021-09-20 18:30:51 +12:00
Jose Galisteo b45fe48fbb
[rubygems/rubygems] Trigger install command by default on remove
Closes https://github.com/rubygems/rubygems/issues/4889

https://github.com/rubygems/rubygems/commit/2b1754479c
2021-09-17 20:46:18 +09:00
Nobuyoshi Nakada fd918d1afa
Removed Module.allocate [Bug #17048] 2021-09-17 11:14:08 +09:00
Nobuyoshi Nakada 8f41c791b1
Add spec for MatchData#match and MatchData#match_length [Feature #18172] 2021-09-17 10:27:00 +09:00
Jean Boussier 89242279e6 Marshal.load: do not call the proc until strings have their encoding
Ref: https://bugs.ruby-lang.org/issues/18141
2021-09-15 08:00:18 +09:00
Nobuyoshi Nakada e802587433
Add printf attribute to functions call va_list format functions 2021-09-12 14:05:52 +09:00
卜部昌平 f752382688 spec/ruby/optional/capi/ext: must support GCC 5
What a silly bug.
2021-09-10 20:00:06 +09:00
卜部昌平 b0f0120267 spec/ruby/optional/capi/ext: support ruby < 3
RBIMPL_WARNING_PUSH is a 3.0 feature.  Rubyspec OTOH has to support 2.x.
2021-09-10 20:00:06 +09:00
卜部昌平 b563b9c48f spec/ruby/optional/capi/ext: suppress warnings
These warnings are okay here.
2021-09-10 20:00:06 +09:00
Benoit Daloze 258661409e Update to ruby/spec@b1e93a2 2021-09-07 19:01:07 +02:00
Benoit Daloze a375640ea5 Update to ruby/mspec@e768949 2021-09-07 19:01:03 +02:00
David Rodríguez 4bc87cb1fb [rubygems/rubygems] Remove `syck` traces from `bundler`
Same reason as in the previous commit.

https://github.com/rubygems/rubygems/commit/f00a6c8516
2021-08-31 19:06:14 +09:00
David Rodríguez c119dd2b5a [rubygems/rubygems] Fix `bundle plugin install` misdetection of installed versions
https://github.com/rubygems/rubygems/commit/9c88db949d
2021-08-31 19:06:14 +09:00
David Rodríguez 71b937d3d7 [rubygems/rubygems] Normalize setting `GEM_PATH`
https://github.com/rubygems/rubygems/commit/4188ebd568
2021-08-31 19:06:14 +09:00
David Rodríguez f934096638 [rubygems/rubygems] Make plugin installation idempotent
The error had not be caught be specs because `bundle install` was
returning a zero exit code when plugin installation errors happened. So
I fixed that issue too.

https://github.com/rubygems/rubygems/commit/90cde87856
2021-08-31 19:06:14 +09:00
Matt Larraz 2aed061384 [rubygems/rubygems] Correctly redact credentials when using x-oauth-basic
https://github.com/rubygems/rubygems/commit/290b6ab078
2021-08-31 19:06:14 +09:00
David Rodríguez f6803d2411 [rubygems/rubygems] Fix `bundle check` showing duplicated gems
If the lockfile contains multiple platforms, `bundle check` would show
duplicated missing gems.

https://github.com/rubygems/rubygems/commit/6ac5931783
2021-08-31 19:06:14 +09:00
David Rodríguez 3683781f53 [rubygems/rubygems] Restore working `bundle check` behaviour
As part of a recent bug fix where bundler was accidentally hitting the
network when not supposed to, I made some refactoring, and the commit I'm
reverting here
(d74830d00b)
was some cleanup that those refactorings allowed according to "past me".

That was completely wrong, `bundle check` should never consider cached
gems, only installed gems, so the code that was removed was necessary.

https://github.com/rubygems/rubygems/commit/5483e98305
2021-08-31 19:06:14 +09:00
Jun Aruga 71f6711351 [rubygems/rubygems] Fix some failing Bundler tests with old Git.
Use the `git branch --list` rather than the `git branch -l` for better
compatibility. Because the `git branch -l` is used to create a new branch in
Git version < 2.20.0.

https://github.com/rubygems/rubygems/commit/eac5be7d06
2021-08-31 19:06:14 +09:00
David Rodríguez 21db5876ca [rubygems/rubygems] Respect `BUNDLE_USER_HOME` for global config location
https://github.com/rubygems/rubygems/commit/58fc31442f
2021-08-31 19:06:14 +09:00
David Rodríguez ea16a0df80 [rubygems/rubygems] Disable `RUBYGEMS_GEMDEPS` for bundler spec run
Running `bundler` specs using `bundler` is not supported.

https://github.com/rubygems/rubygems/commit/cc97b6773d
2021-08-31 19:06:14 +09:00
David Rodríguez 5aee962fe3 [rubygems/rubygems] Remove `RUBYGEMS_GEMDEPS` warning
When setting the `RUBYGEMS_GEMDEPS` environment variable to allow
skipping `bundle exec`, `bundler` will print a warning about potential
incompatibility.

Initially the `RUBYGEMS_GEMDEPS` variable used a completely different
(re)implementation of `bundler` functionality. That implementation was
not battle tested and could potentially differ in behaviour from what
`bundler` does. That's why print a warning.

However, these days, all `rubygems` does when `RUBYGEMS_GEMDEPS` is set
is to require `bundler/setup`, so there's no risk of any
incompatibility, since that's just plain `bundler`.

https://github.com/rubygems/rubygems/commit/bbddc27016
2021-08-31 19:06:14 +09:00
David Rodríguez ab1edc75f8 [rubygems/rubygems] Expect the right permissions on Windows
Given Windows doesn't have executable bit.

https://github.com/rubygems/rubygems/commit/35dc3fa845
2021-08-31 19:06:14 +09:00
David Rodríguez 8adc606271 [rubygems/rubygems] Fix git repo initialization on a path with spaces
https://github.com/rubygems/rubygems/commit/a2d6e10192
2021-08-31 19:06:14 +09:00
David Rodríguez 199083dd15 [rubygems/rubygems] Simplify overkill usage of shared examples
https://github.com/rubygems/rubygems/commit/36a00144b9
2021-08-31 19:06:14 +09:00
David Rodríguez 10dcd0eb5b [rubygems/rubygems] Deprecate `bundle exec --no-keep-file-descriptors`
https://github.com/rubygems/rubygems/commit/591466d512
2021-08-31 19:06:14 +09:00
Nobuyoshi Nakada 9fc16a31d9 [rubygems/rubygems] Exclude gemspec file itself from gem
The processed YML data is included as metadata, the source gemspec
file is unused and just confusing.

https://github.com/rubygems/rubygems/commit/f444478eac
2021-08-31 19:06:14 +09:00
Tim Sutton d7c734a27e [rubygems/rubygems] typos in UI messages: fix a couple missing spaces between sentence breaks
https://github.com/rubygems/rubygems/commit/5cdda53382
2021-08-31 19:06:14 +09:00
David Rodríguez 0e01ad881a [rubygems/rubygems] The `--local` flag to `bundle install` shouldn't hit the network
If the cache was missing, `bundler` would try to re-fetch it. With the
`--local` flag, it should just look at installed gems.

https://github.com/rubygems/rubygems/commit/630d29c69e
2021-08-31 19:06:14 +09:00
David Rodríguez 7116ec6199 [rubygems/rubygems] Requiring `bundler/setup` shouldn't try to hit the network
https://github.com/rubygems/rubygems/commit/06f5efce02
2021-08-31 19:06:14 +09:00
David Rodríguez 0b4dbe2e6a [rubygems/rubygems] Improve "gem not found in source" errors
When printing sources inside these error messages, it's useful to only
consider the current state of the source. For example, when requiring
`bundler/setup`, the source shouldn't be configured to be able to hit
the network, so the error message should only mention "locally installed
gems" to make that more clear.

https://github.com/rubygems/rubygems/commit/30eb14f853
2021-08-31 19:06:14 +09:00
David Rodríguez b17cdad2f8 [rubygems/rubygems] Remove redundant part of error message
It doesn't really add much, in my opinion. We want to be helpful, but
also concise when possible.

https://github.com/rubygems/rubygems/commit/9d56009cf7
2021-08-31 19:06:14 +09:00
David Rodríguez f1c0729128 [rubygems/rubygems] Fix standalone generated script to deal with path sources
In the case of path sources, the path the source is pointing to should
be added directly to the `$LOAD_PATH` without any modifications.

https://github.com/rubygems/rubygems/commit/d3bba936f0

Co-authored-by: Daniel Niknam <mhmd.niknam@gmail.com>
2021-08-31 19:06:14 +09:00
David Rodríguez 7465b94f8a [rubygems/rubygems] Remove unnecessary `ruby_version` local variable
Under some case, this variable might not end up being used, in which
case running the script would print unused variable warnings.

https://github.com/rubygems/rubygems/commit/bf96030362
2021-08-31 19:06:14 +09:00
David Rodríguez 3aa087d533 [rubygems/rubygems] Remove unnecessary `ruby_engine` local variable
Under some case, this variable might not end up being used, in which
case running the script would print unused variable warnings.

https://github.com/rubygems/rubygems/commit/a2d6392ada
2021-08-31 19:06:14 +09:00
David Rodríguez 1d6551a02d [rubygems/rubygems] Remove unnecessary `path` local variable
We can use `__dir__` directly.

https://github.com/rubygems/rubygems/commit/0e6083ca94
2021-08-31 19:06:14 +09:00
David Rodríguez 0ab160e2e0 [rubygems/rubygems] Respect `BUNDLE_USER_CONFIG` if set
https://github.com/rubygems/rubygems/commit/f28ab141af
2021-08-31 19:06:14 +09:00
David Rodríguez c2f376bcc0 [rubygems/rubygems] Fix standalone install of default gems
Rubygems source replacement was broken.

https://github.com/rubygems/rubygems/commit/3549c122f6
2021-08-31 19:06:14 +09:00
David Rodríguez 9e7249da4e [rubygems/rubygems] This spec can pass now on ruby 3
TSort was released as a library so we can install it, and also other
gems that are loaded by the spec. Also, Ruby on Windows apparently loads
fiddle 1.0.6, so we need to also install that to make that not fail.

https://github.com/rubygems/rubygems/commit/2b8dcab99e
2021-08-31 19:06:14 +09:00
David Rodríguez 579dbe6ecb [rubygems/rubygems] Remove unnecessary test repository
These gems are built and installed to system directly as default gems.
There's no need to also build a remote repo.

https://github.com/rubygems/rubygems/commit/ad9dad4c22
2021-08-31 19:06:14 +09:00
David Rodríguez 570167eaa9 [rubygems/rubygems] Give a `bundle install` hint when `bundle list` fails
https://github.com/rubygems/rubygems/commit/98f5087e34
2021-08-31 19:06:14 +09:00
David Rodríguez 81c0643762 [rubygems/rubygems] Remove unnecessary escape sequences
Bundler formatters already take care of this.

https://github.com/rubygems/rubygems/commit/c24415fdd5
2021-08-31 19:06:14 +09:00
David Rodríguez 9a25a98c6b [rubygems/rubygems] Show all missing gems when using a bundle before installing it
Not only the first one that's missing.

This also allows us to simplify things.

https://github.com/rubygems/rubygems/commit/69718a9509
2021-08-31 19:06:14 +09:00
Nobuyoshi Nakada be9cc6c758
Fix rubyspec_capiext dependency and flags
- The file needed to link may be the import library.
- Remove duplicate flags.
2021-08-30 12:03:44 +09:00
Nobuyoshi Nakada 9f9ea28375
Fix dllimport attribute 2021-08-30 00:52:16 +09:00
Nobuyoshi Nakada d574b84182
Fix failures on non-UTF-8 environment [Bug #18077]
Call `IOSpecs.io_fixture` with the default encoding explicitly.
`IOSpecs.closed_io` calls the method without optional `mode` which
is set to UTF-8 by default, while the default external encoding
depends on the locale environment variables.
2021-08-22 12:11:45 +09:00
Lars Kanis 6594623f62 Fix Marshal.dump(closed_io) to raise TypeError and allow encoding on closed IO
Mashalling a closed IO object raised "closed stream (IOError)" before instead of TypeError.
This changes IO#(in|ex)ternal_encoding to still return the encoding even if the underlying FD is closed.

Fixes bug #18077
2021-08-22 10:33:22 +09:00
Jeremy Evans 48c8df9e0e
Allow tracing of optimized methods
This updates the trace instructions to directly dispatch to
opt_send_without_block.  So this should cause no slowdown in
non-trace mode.

To enable the tracing of the optimized methods, RUBY_EVENT_C_CALL
and RUBY_EVENT_C_RETURN are added as events to the specialized
instructions.

Fixes [Bug #14870]

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2021-08-21 10:15:01 -07:00
Kazuki Tsujimoto f96c199449
Fix test failure on spec/ruby/language/pattern_matching_spec.rb
https://github.com/ruby/ruby/runs/3369486308
2021-08-19 17:28:30 +09:00
Kazuki Tsujimoto ecb6d6a4ef
Allow omission of parentheses in one line pattern matching [Feature #16182] 2021-08-19 17:07:58 +09:00
Benoit Daloze 73085c8d8e Update to ruby/spec@330c641 2021-08-13 18:09:14 +02:00
S.H 9b3fcfbbb9
Suppress unused-result warnings
* Hide read function warning in string_spec_RSTRING_PTR_read function

* The type of `read` may be `ssize_t`

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-08-07 12:50:55 +09:00
Benoit Daloze ff6c176028 Tweak rb_str_modify_expand() + read() spec to try to find out why it fails on some platforms
* Use a longer string as <= 23 characters it's embedded on CRuby and
  the value of rb_str_capacity() is implementation-specific.
2021-07-30 11:36:20 +02:00
Jeremy Evans 64ac984129 Make RubyVM::AbstractSyntaxTree.of raise for method/proc created in eval
This changes Thread::Location::Backtrace#absolute_path to return
nil for methods/procs defined in eval.  If the realpath of an iseq
is nil, that indicates it was defined in eval, in which case you
cannot use RubyVM::AbstractSyntaxTree.of.

Fixes [Bug #16983]

Co-authored-by: Koichi Sasada <ko1@atdot.net>
2021-07-29 13:51:03 -07:00
Benoit Daloze 6998d75824 Update to ruby/spec@b65d01f 2021-07-29 22:11:21 +02:00
Benoit Daloze 15d05f8120 Update to ruby/mspec@9542a88 2021-07-29 22:11:19 +02:00
Hiroshi SHIBATA c3d31377b3
Bump unicode version for Ruby 3.1 2021-07-27 18:00:32 +09:00
Daniel Niknam bd8daa8523
[rubygems/rubygems] Remove the warning for not defining a gem server source
Bundler has deprecated gemfiles without a global source and this feature
is now obsolete. `Bundler::Definition#has_rubygems_remotes?` is removed
because it's not used anymore.

https://github.com/rubygems/rubygems/commit/d29dd2cb7b
2021-07-27 09:25:57 +09:00
Daniel Niknam 49176e8c8c
[rubygems/rubygems] Refactor Bundler::Dsl#check_rubygems_source_safety to improve readability
`check_rubygems_source_safety` is responsible for:

1. if there are multiple global sources
  - for bundle 3.x raise an error
  - for bundle 2.x print a warning
2. print a warning if there is no explicit global source

The second responsibility was added recently and now the logic could be
extracted to improve readability. Conditions are still live in the `check_rubygems_source_safety` method
since we don't want to call both functions always and that would help us achieve that.

https://github.com/rubygems/rubygems/commit/f3d7e946ee
2021-07-27 09:25:57 +09:00
Daniel Niknam 1ef360230e
[rubygems/rubygems] Deprecate Gemfile without an explicit global source
Raise a warning when parsing a Gemfile and it doesn't have a global source. Gemfiles like this, specially now that rubygems sources are are no longer merged into a single source for security, are very confusing because they generate a different lockfile depending on the gems you have locally installed. This is because bundler always use an implicit global source that defaults to locally installed gems.

https://github.com/rubygems/rubygems/commit/b7523ad21c
2021-07-27 09:25:57 +09:00
Daniel Niknam 2f9e0cf181
[rubygems/rubygems] Explicitly define a global source for tests
This is in preparation for deprecating source-less gemfiles.

https://github.com/rubygems/rubygems/commit/d6493fa3e2
2021-07-27 09:25:57 +09:00
Daniel Niknam b500e8fab4
[rubygems/rubygems] Implement Bundler::SourceList#implicit_global_source?
This method is created to tell whether any global source exist in the object or not and it will be used by `Bundler:Dsl` to print a warning if no global source has been defined in the Gemfile.

https://github.com/rubygems/rubygems/commit/422fec4438
2021-07-27 09:25:57 +09:00
Daniel Niknam 91a3f06e98
[rubygems/rubygems] Implement Bundler::Source::Rubygems#no_remotes?
This method is created to tell whether any remote exist in the object or not and it will be used by `Bundler:SourceList` to tell if a global source has been defined implicitly or not.

https://github.com/rubygems/rubygems/commit/47e3ff0e47
2021-07-27 09:25:56 +09:00
David Rodríguez 9ac89fe35e
[rubygems/rubygems] The `--quiet` should still display warnings
The is the previous intentional behaviour until
ca0676cb1c.

In my opinion, that previous behaviour was better and should be
restored, because we want our users to always see warnings and fix them.
And the original issue that motivated the change is fixable by other
means, namely through `BUNDLE_SILENCE_ROOT_WARNING`, or through
`BUNDLE_SILENCE_DEPRECATIONS` in general. Finally, the --quiet option is
still documented as "only print errors and warnings".

So this PR essentially reverts
ca0676cb1c
for the above reasons.

https://github.com/rubygems/rubygems/commit/35f2254dfc
2021-07-27 09:25:56 +09:00
David Rodríguez 24aca87def
[rubygems/rubygems] Make `--quiet` spec independent on the specific warning
We'll be removing the warning about no gem sources, so this spec will no
longer test that warnings are hidden by `--quiet`.

Test that in another way so that we don't lose the coverage when we
drop the specific warning about no gem server sources.

https://github.com/rubygems/rubygems/commit/cce4f86d28
2021-07-27 09:25:56 +09:00
David Rodríguez 6bcedabfdd
[rubygems/rubygems] Remove `gem install` hint when installing a gem fails
A fresh `gem install` might not reproduce the exact `bundle install`
environment that originally caused the error. It also makes it harder
for the user to troubleshoot the error since she needs to run a separate
command.

Instead, show the original error and backtrace directly.

https://github.com/rubygems/rubygems/commit/49c2abfec6
2021-07-27 09:25:55 +09:00
David Rodríguez 4271f4aea5
[rubygems/rubygems] Fix bundler binstub version selection
To mimic built-in rubygems behaviour, only thing that should be
approximated is the lockfile version. Other alternatives like
`BUNDLER_VERSION` should be respected exactly.

https://github.com/rubygems/rubygems/commit/dbd667d4bc
2021-07-27 09:25:55 +09:00
Daniel Niknam 90899c50c2
[rubygems/rubygems] Remove LoadError message in regards to requiring a relative file
Ruby 1.9.2 removed "." from LOAD_PATH for robustness and security reasons.
This code was introduced by 56fc830e19 commit
to helping users understand the issue and had a guard condition to include the message for `RUBY_VERSION >= "1.9"`.
However, the guard condition was removed as part of the "Ruby version leftover" cleanup by
8c9cf76e41

Ruby 1.9 development was ended a long time ago and this message is not useful anymore.

https://github.com/rubygems/rubygems/commit/a23609b15a
2021-07-27 09:25:55 +09:00
Andrew Haines 705b1bdef2
[rubygems/rubygems] Fix interrupt handling in Bundler workers
The existing interrupt handling using `SharedHelpers.trap` fails when the previous
handler for a signal is not callable (for example, when it is the string "DEFAULT").

Instead, we now handle interrupts by aborting the process when worker threads are
running, and restore the previous handler after worker threads are finished.

Fixes #4764.

https://github.com/rubygems/rubygems/commit/b9f455d487
2021-07-27 09:25:55 +09:00
Benoit Daloze c8172d0b96 rb_iterate is no longer used in ruby/spec 2021-07-26 13:24:38 +02:00
Nobuyoshi Nakada 42745ecae3
Remove meaningless IO#close_on_exec= spec [Feature #17745] 2021-07-20 21:45:11 +09:00
Nobuyoshi Nakada e0e12202c7
Use rb_block_call() instead of the deprecated rb_iterate() 2021-07-18 11:40:21 +09:00
Kazuhiro NISHIYAMA f11f9fc921
Disable spec of `pattern matching is experimental` since 3.1 2021-07-17 13:24:23 +09:00
Kazuhiro NISHIYAMA 2a5b5ff49a
Fix a spec failure
```
1)
Warning.[]= :experimental emits and suppresses warnings for :experimental FAILED
Expected "" =~ /is experimental/
to be truthy but was nil
```
2021-07-17 13:24:08 +09:00
Kazuhiro NISHIYAMA 503fa1620c
Fix a spec failure
```
1)
The -W command line option with :no-experimental suppresses experimental warnings FAILED
Expected "" =~ /is experimental/
to be truthy but was nil
```
2021-07-17 13:16:48 +09:00
Nobuyoshi Nakada 301d194ee3 Add Integer.try_convert [Feature #15211] 2021-07-16 17:49:53 +09:00
David Rodríguez 71d3c9bbfa
[rubygems/rubygems] Fix `bundle plugin install --help` showing `bundle install`'s help
https://github.com/rubygems/rubygems/commit/b7b7d16aa8
2021-07-16 15:40:08 +09:00
Andre Arko c5f78ade5a
[rubygems/rubygems] fix dangling empty hooks
it turns out that running `bundle plugin uninstall some-plugin` would remove that plugin from the list of hooks, but if the list of hooks for an event was now empty, we would serialize the empty array into yaml as an empty single bullet item. which would then get unserialized as a plugin with the name empty string. which we would then try to load and explode. 😬

https://github.com/rubygems/rubygems/commit/545ebba9a5
2021-07-16 15:40:08 +09:00
Andre Arko a3d2200b2a
[rubygems/rubygems] test loading bad plugins with nil/empty names
https://github.com/rubygems/rubygems/commit/e64b1f3497
2021-07-16 15:40:07 +09:00
Andre Arko 5cce96891e
[rubygems/rubygems] remove focus
https://github.com/rubygems/rubygems/commit/584a393812
2021-07-16 15:40:07 +09:00
David Rodríguez 227c2deff4
[rubygems/rubygems] Fix development gem unintentionally removed on an edge case
When a development dependency was duplicated inside the gemspec and
Gemfile with the same requirements, we went from printing a warning to
removing the gem altogether.

This change makes it not print a warning, but don't remove the gem
either.

https://github.com/rubygems/rubygems/commit/8bb2488131
2021-07-16 15:40:07 +09:00
Hiroshi SHIBATA 896bbb9fad Merge RubyGems/Bundler master from 8459ebd6ad65ce3397233416dc64083ae7572bb9 2021-07-14 10:48:07 +09:00
Martin Dürst 146a943d9a Fix ruby_version guards in Unicode/Emoji version specs
Correct version guards in ruby_version in Unicode/Emoji version
specs to correctly use exclusive range endings.
2021-07-08 14:45:03 +09:00
Martin Dürst ba357bace2 Add new Unicode/Emoji version checks to spec/ruby/library/rbconfig
- Limit Unicode version 12.1.0 to Ruby versions 2.6.3 - 3.0
- Check that Ruby version 3.1 has Unicode version 13.0.0
- Limit Unicode Emoji version 12.1 to Ruby versions 2.7 - 3.0
- Check that Ruby version 3.1 has Unicode Emoji version 13.0
2021-07-08 14:45:03 +09:00
Hiroshi SHIBATA c082c6eb7c Sync RubyGems and Bundler with upstream 2021-07-07 15:31:52 +09:00
David Rodríguez 6e2240a2f9 Sync latest bundler & rubygems development version 2021-07-07 13:30:20 +09:00
Yusuke Endoh e946049665 [WIP] add error_squiggle gem
```
$ ./local/bin/ruby -e '1.time {}'
-e:1:in `<main>': undefined method `time' for 1:Integer (NoMethodError)

1.time {}
 ^^^^^
Did you mean?  times
```

https://bugs.ruby-lang.org/issues/17930
2021-06-29 23:45:49 +09:00
Benoit Daloze 750f807575 Update to ruby/spec@c6e9285 2021-06-02 15:54:38 +02:00
Benoit Daloze 22e2a6a999 Update to ruby/spec@a0b7d0d 2021-06-02 14:34:07 +02:00
Benoit Daloze a4fbc7e288 Update to ruby/mspec@0091e8a 2021-06-02 14:34:01 +02:00
Jun Aruga 2048dfc5d3 Skip a `File.atime` test randomly failing on Travis ppc64le.
See <https://bugs.ruby-lang.org/issues/17926>.
2021-06-02 12:38:27 +02:00
Jeremy Evans f516379853 Fix Enumerator::ArithmeticSequence handling of float ranges
Depending on the float range, there could be an off-by-one error,
where the last result that should be in the range was missed. Fix
this by checking if the computed value for the expected value
outside the range is still inside the range, and if so, increment
the step size.

Fixes [Bug #16612]
2021-05-29 08:56:15 -07:00
Hiroshi SHIBATA 835a495608 Guard ruby/spec with spec/mspec/tool/wrap_with_guard.rb 2021-05-27 14:42:11 +09:00
Benoit Daloze 725b666076 Use a shared spec for YAML.load and YAML.unsafe_load 2021-05-17 20:17:52 +02:00
Benoit Daloze 2321ade41d Prefer respond_to? to defined? in MSpec 2021-05-17 20:12:39 +02:00
Yusuke Endoh 93fb186dd0 spec/ruby/library/yaml: Test YAML.unsafe_load instead of YAML.load in 3.1 2021-05-17 15:42:22 +09:00
Yusuke Endoh 008a63c477 Revert "Use YAML.unsafe_load instead of YAML.load."
This reverts commit a0e97b0e2e.
2021-05-17 15:32:41 +09:00
Hiroshi SHIBATA a0e97b0e2e
Use YAML.unsafe_load instead of YAML.load.
This is a temporary workaround. We should rewrite the examples with
  permitted_classes.
2021-05-17 13:36:55 +09:00
Jeremy Evans 11ae581a4a Fix handling of control/meta escapes in literal regexps
Ruby uses a recursive algorithm for handling control/meta escapes
in strings (read_escape).  However, the equivalent code for regexps
(tokadd_escape) in did not use a recursive algorithm.  Due to this,
Handling of control/meta escapes in regexp did not have the same
behavior as in strings, leading to behavior such as the following
returning nil:

```ruby
/\c\xFF/ =~ "\c\xFF"
```

Switch the code for handling \c, \C and \M in literal regexps to
use the same code as for strings (read_escape), to keep behavior
consistent between the two.

Fixes [Bug #14367]
2021-05-12 18:55:43 -07:00
Takashi Kokubun cc1ea6e023
Run nmake check on Actions (#4487)
* Run nmake check on Actions

* Skip tests not working in mswin GitHub Actions

* Override TEMP

* Revert "Skip tests not working in mswin GitHub Actions"

This reverts commit 544d2575fcdf23ae63cd25aa03fce10c28b259f2.

* Revert "Revert "Skip tests not working in mswin GitHub Actions""

This reverts commit e1f8ad7862c9c4be52dc6e1031a004621eb07e6e.

* Fix timeouts

* Skip some more broken tests

* Update windows.yml

* Add a guard for rbasic_spec

* Revert "Update windows.yml"

This reverts commit bc9694b6b3b9594d406378d15ca11723fb052bc8.

* Skip the ensure clause

* Simplify the ensure
2021-05-11 15:18:44 -07:00
David Rodríguez 5b0abba931 Sync bundler & rubygems 2021-05-11 11:29:41 +09:00
Nobuyoshi Nakada ddc29e2989
net-http no longer requires stringio 2021-05-06 22:04:14 +09:00
MSP-Greg 7a3dd05e21 spec/ruby/library/net/http/http/fixtures/http_server.rb host naming for Windows 2021-05-04 08:53:58 +09:00
Yusuke Endoh 4ca271909d spec/ruby/core/file/shared/read.rb: The behavior of FreeBSD was changed
http://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20210426T003001Z.fail.html.gz#rubyspec
2021-04-26 11:21:15 +09:00
Kazuhiro NISHIYAMA 50f17241a3
Try to fix other failures of writing XDG_CONFIG_HOME
https://github.com/ruby/actions/actions/runs/756591173
https://github.com/ruby/actions/actions/runs/759073690
https://github.com/ruby/actions/actions/runs/761341026
```
Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb
```
2021-04-19 21:40:29 +09:00
Kazuhiro NISHIYAMA d953ac1139
Fix writing XDG_CONFIG_HOME in test-bundler
https://github.com/ruby/actions/actions/runs/756591173
```
Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb
```
2021-04-17 11:54:10 +09:00
Yusuke Endoh 6268fdc662 spec/ruby/core/hash/transform_keys_spec.rb: Fix the failure of ruby_3_0
https://github.com/ruby/spec/pull/833
8290e5ad89
2021-04-16 11:04:23 +09:00
Hiroshi SHIBATA ed149dbf46 Merge the master branch of Bundler 2021-04-15 15:36:15 +09:00
Yusuke Endoh df0f60b690 spec/ruby/library/matrix/: Change the version guard to 3.1.0
[Bug #17521] won't be backported until 3.1.0.
https://github.com/ruby/spec/pull/832
2021-04-15 13:40:16 +09:00
Yusuke Endoh 93c73ab898 spec/ruby/library/matrix/: Change the version guard to 3.0.2
[Bug #17521] is not backported to 3.0.1.
2021-04-06 15:19:23 +09:00
Kenichi Kamiya 31e0382723
Keep non evaluated keys in `Hash#transform_keys!` [Bug #17735] 2021-03-28 09:14:57 +09:00
Benoit Daloze 95d9fe9538 Update to ruby/spec@fd6eddd 2021-03-27 13:02:41 +01:00
Benoit Daloze 44736a6b7a Update to ruby/mspec@d1adf59 2021-03-27 13:02:38 +01:00
Kenichi Kamiya aceb8c0b4b
Fix Enumerable#tally with some arguments pattern [Feature #17744]
* Add test cases for Enumerable#tally with hash argument

* Add ruby/spec for Enumerable#tally with hash argument

* Fix Enumerable#tally does not update given frozen hash

* Add test cases for Enumerable#tally with hash convertible arguments

* Fix SEGV when Enumerable#tally takes non Hash convertible

* FIx cosmetic damage enum.c
2021-03-27 12:55:46 +09:00
Nobuyoshi Nakada 9143d21b1b
Enumerable#tally with the resulting hash [Feature #17744] 2021-03-26 16:29:21 +09:00
Kazuhiro NISHIYAMA a5b6baae97
Fix test-bundler failures when XDG_CONFIG_HOME is not writable
https://github.com/ruby/actions/runs/2175399707?check_suite_focus=true
```
Errno::EACCES: Permission denied @ dir_s_mkdir - /home/runner/.config/irb
```
2021-03-24 15:26:49 +09:00
Nobuyoshi Nakada 82b6f89283 File.dirname optional level
* file.c (rb_file_dirname_n): chomp N level of base names.
  [Feature #12194]
2021-03-15 15:09:05 +09:00
David Rodríguez 53468cc111 Sync latest development version of bundler & rubygems 2021-03-08 13:47:35 +09:00
Benoit Daloze 80e2c45f55 Skip spec which does not work on mingw
* https://github.com/ruby/ruby/runs/1994688198
  ruby 3.1.0dev (2021-02-27T16:42:17Z master 8305a48413) [x64-mingw32]
  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
  Example took longer than the configured timeout of 60.0s
2021-02-28 12:24:42 +01:00
Benoit Daloze 36dde35e02 Update to ruby/spec@37e52e5 2021-02-27 13:00:26 +01:00
Jeremy Evans cfd162d535 Make String#{strip,lstrip}{,!} strip leading NUL bytes
The documentation already specifies that they strip whitespace
and defines whitespace to include null.

This wraps the new behavior in the appropriate guards in the specs,
but does not specify behavior for previous versions, because this
is a bug that could be backported.

Fixes [Bug #17467]
2021-02-20 11:17:47 +09:00
Kazuhiro NISHIYAMA 96228e3ed6
Fix a spec failure
http://ci.rvm.jp/logfiles/brlog.trunk-test.20210216-182358
```
1)
$LOAD_PATH.resolve_feature_path raises LoadError if feature cannot be found FAILED
Expected LoadError but no exception was raised (nil was returned)
/tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1275:in `block (3 levels) in <top (required)>'
/tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1259:in `block in <top (required)>'
/tmp/ruby/v3/src/trunk-test/spec/ruby/language/predefined_spec.rb:1258:in `<top (required)>'
```
2021-02-16 18:52:40 +09:00
Nobuyoshi Nakada 1f0e0dfb22
Thread::Queue.new should accept an Enumerable [Feature #17327]
Enumerable implements #to_a but not #to_array.
2021-02-12 12:21:49 +09:00
Chris Seaton c3b2bb0969
The Queue constructor should take an initial set of objects
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2021-02-11 19:14:18 +09:00
Kazuhiro NISHIYAMA f600226fb4
Fix failures with EditLine
On macOS with EditLine:
```
$ ruby -r readline -e 'Readline.readline("> "); p Readline::VERSION' < /dev/null
"EditLine wrapper"
```

On Linux with GNU readline:
```
$ ruby -r readline -e 'Readline.readline("> "); p Readline::VERSION' < /dev/null
> "8.0"
```
2021-02-03 14:38:31 +09:00
Kazuhiro NISHIYAMA acb6b395b6
Fix failure when build in srcdir/build
If `build` directory exists, `rake build` is `Rake::FileTask`.
So skip if exists.
2021-01-29 11:59:42 +09:00
Nobuyoshi Nakada 522adbc945 Fixed Kernel#rand spec
Float should not be compared by identity.
2021-01-29 11:36:13 +09:00
Benoit Daloze 2e32b919b4 Update to ruby/spec@8cafaa5 2021-01-28 17:08:57 +01:00
Kazuhiro NISHIYAMA 1b377b32c8
Add fallback when PWD is not set 2021-01-28 18:23:13 +09:00
Kazuhiro NISHIYAMA 763d242fcd
Use PWD instead of source_root
Because `.ext/common` is not relative from top source directory.
Fix failures with out-of-place build directory.
2021-01-28 18:01:06 +09:00
Kazuhiro NISHIYAMA 7cd97a81d1
Remove require_path from $LOADED_FEATURES
because some features are already loaded.
2021-01-28 18:00:10 +09:00
Kazuhiro NISHIYAMA 00bd645f09
Delete path including `/../` too 2021-01-28 18:00:10 +09:00
Nobuyoshi Nakada b409a34b41
Taint flags has been deprecated in 3.1 2021-01-27 14:45:31 +09:00
Gannon McGibbon 9e0075a3d9 Replace "iff" with "if and only if"
iff means if and only if, but readers without that knowledge might
assume this to be a spelling mistake. To me, this seems like
exclusionary language that is unnecessary. Simply using "if and only if"
instead should suffice.
2021-01-19 12:06:45 -08:00
Nobuyoshi Nakada c3d6bac325
Upcoming Struct#new behavior 2021-01-18 15:55:10 +09:00
Takashi Kokubun e1fee7f949
Rename RubyVM::MJIT to RubyVM::JIT
because the name "MJIT" is an internal code name, it's inconsistent with
--jit while they are related to each other, and I want to discourage future
JIT implementation-specific (e.g. MJIT-specific) APIs by this rename.

[Feature #17490]
2021-01-13 22:46:51 -08:00
Nobuyoshi Nakada 7dc0511ea4 Remove "." and ".." from Dir.glob with FNM_DOTMATCH [Bug #17280]
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
2021-01-12 20:02:43 +09:00
Nobuyoshi Nakada 5e00eeb4d4
[ruby/matrix] use an exclusive range [Bug #17521] 2021-01-11 14:00:35 +09:00
Marc-André Lafortune d8c8b79d24
[ruby/matrix] Fix 0-th power [Bug #17521] (#4047) 2021-01-10 16:21:10 -05:00
Hiroshi SHIBATA 69ed64949b Track Bundler master(2.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20 2021-01-04 13:14:43 +09:00
Nobuyoshi Nakada 64d79d333b
Suppress too big exponent warnings 2020-12-28 12:12:54 +09:00
Benoit Daloze 727c97da19 Update to ruby/spec@4ce9f41 2020-12-27 17:35:32 +01:00
Benoit Daloze 267bed0cd9 Update to ruby/mspec@a40a674 2020-12-27 17:35:30 +01:00
Marcus Stollsteimer 93a1ef6709 Fix typos 2020-12-24 23:20:04 +01:00
Jeremy Evans 1e215a66d2 Fix class of method in Method#inspect for singleton classes of classes
Previously, due to a change to fix bug 15608, Method#inspect output
changed for class methods:

Ruby 2.7
"#<Method: String.prepend(*)>"

Before change:
"#<Method: #<Class:Object>(Module)#prepend(*)>"

This is wrong because the Method object was created from String and
not Object. This is because the fix for bug 15608 assumed it was
being called on the singleton class of a instance, and would skip
the first singleton class until it got to the class itself.  For
class methods, this results in always using the superclass. Fix
behavior to not skip until the superclass if the singleton class
is the singleton class of a module or class.

After change:
"#<Method: #<Class:Object>(Module)#prepend(*)>"

Fixes [Bug #17428]
2020-12-23 19:29:19 -08:00
Hiroshi SHIBATA 339227363c Merge RubyGems 3.2.3 and Bundler 2.2.3 2020-12-23 10:17:41 +09:00
卜部昌平 fa356a798a Enumerator.new: raise unless block given
Has been deprecated since c73b6bd7eb.
[Feature #17116] [ruby-dev:50945]
2020-12-22 13:52:03 +09:00
Nobuyoshi Nakada a29b9e5efe
Remvoed no longer needed version guards 2020-12-22 07:52:14 +09:00
Nobuyoshi Nakada 8918a9cf6c Removed rb_cData entity
* Use the wrapper of rb_cObject instead of data access
* Replaced rest of extentions
* Updated the version guard for Data
* Added the version guard of rb_cData
2020-12-22 02:51:49 +09:00
卜部昌平 c30f03d328 Data: delete
Has been deprecated since 684bdf6171.

Matz says in [ruby-core:83954] that Data should be an alias of Object.
Because rb_cData has not been deprecated, let us deprecate the constant
to make it a C-level synonym of rb_cObject.
2020-12-22 02:51:49 +09:00
Kazuhiro NISHIYAMA 63849a1cd9
Fix misspellings [ci skip] 2020-12-21 10:54:24 +09:00
Nobuyoshi Nakada 9c73c75624
Use Integer instead of Fixnum/Bignum 2020-12-21 01:19:55 +09:00
Nobuyoshi Nakada fb8f011422
Fixed indefinite articles before "Integer" [ci skip] 2020-12-21 01:19:55 +09:00
Nobuyoshi Nakada ad534a677a
Fixnum as a Symbol was an old feature until 1.6 2020-12-21 01:19:55 +09:00
Nobuyoshi Nakada ed4381d941
BigDecimal#precs is deprecated 2020-12-20 03:14:58 +09:00
Radosław Bułat eb8ea336d3 Feature 17314: allow to pass array to public, protected and private methods 2020-12-19 18:19:49 +09:00
Marc-Andre Lafortune 0d3dc2ec80 Make `Hash#except` always return a Hash
[Feature #15822]
2020-12-19 03:59:51 -05:00
Radosław Bułat 51bcd50915 Feature 17314: alias_method returns symbol 2020-12-19 12:23:58 +09:00
Yusuke Endoh 346bf0f5a5 spec/ruby/core/module/attr_*: Add version guards 2020-12-19 03:16:20 +09:00
Radosław Bułat 5944c4b3cf
attr_reader, attr_writer, attr_accessor and attr methods returns array of symbols (#3935)
Co-authored-by: Yusuke Endoh <mame@ruby-lang.org>
2020-12-19 03:11:35 +09:00
Yusuke Endoh 982443e6e3 Revert "Better cooperation between public/protected/private with attr* and alias_method"
This reverts commit 81739ad4fd.
2020-12-18 16:08:55 +09:00
Hiroshi SHIBATA 0e40cc9b19 Merge RubyGems 3.2.2 and Bundler 2.2.2 2020-12-18 13:33:18 +09:00
Radosław Bułat 81739ad4fd Better cooperation between public/protected/private with attr* and alias_method 2020-12-17 12:46:02 -05:00
Marc-Andre Lafortune d5f0d338c7 Optimize `Enumerable#grep{_v}`
[Bug #17030]
2020-12-15 12:54:45 -05:00
Hiroshi SHIBATA 2fa9f3c032 Prepare to release rubygems-3.2.1 and bundler-2.2.1 2020-12-15 10:54:09 +09:00
Benoit Daloze f5c89c1660 Deprecate Random::DEFAULT
* Closes [Feature #17351].
2020-12-14 20:29:50 +01:00
Kazuki Tsujimoto a8cf526ae9
Don't emit warning when the pattern of one-line pattern matching is just a variable pattern
https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20201210Japan.md#feature-17371-reintroduce-expr-in-pat-ktsj
2020-12-13 11:51:49 +09:00
Yusuke Endoh 7ef5226520 spec: suppress deprecations of "lambda(&proc_block)" pattern 2020-12-12 23:25:15 +09:00
nicholas a. evans 31e8de2920 Let Fiber#raise work with transferring fibers
This automatically choosess whether to use transfer on a transferring
fiber or resume on a yielding fiber.  If the fiber is resuming, it
raises a FiberError.
2020-12-12 10:18:19 +13:00
Nobuyoshi Nakada dea600046a
Ad-hoc fix of test-bundler 2020-12-09 13:10:28 +09:00
Hiroshi SHIBATA 473f9d2df0 Merge prepare version of Bundler 2.2.0 2020-12-08 17:30:02 +09:00
Lars Kanis ca76337a00
Windows: Read ENV names and values as UTF-8 encoded Strings (#3818)
* Windows: Read ENV names and values as UTF-8 encoded Strings

Implements issue #12650: fix https://bugs.ruby-lang.org/issues/12650

This also removes the special encoding for ENV['PATH'] and some
complexity in the code that is unnecessary now.

* Windows: Improve readablity of getenv() encoding

getenv() did use the expected codepage as an implicit parameter of the macro.
This is mis-leading since include/ruby/win32.h has a different definition.
Using the "cp" variable explicit (like the other function calls) makes it
more readable and consistent.

* Windows: Change external C-API macros getenv() and execv() to use UTF-8

They used to process and return strings with locale encoding,
but since all ruby-internal spawn and environment functions use UTF-8,
it makes sense to change the C-API equally.
2020-12-08 02:00:39 +09:00
Lars Kanis 94b6933d1c
Set default for Encoding.default_external to UTF-8 on Windows (#2877)
* Use UTF-8 as default for Encoding.default_external on Windows
* Document UTF-8 change on Windows to Encoding.default_external

fix https://bugs.ruby-lang.org/issues/16604
2020-12-08 01:48:37 +09:00
Nobuyoshi Nakada 7817a438eb Removed deprecated Time#succ 2020-12-07 18:38:59 +09:00
Nobuyoshi Nakada 20d53dad47
Update the version guard to 3.0 2020-12-07 18:35:59 +09:00
卜部昌平 547c71dec4
Hash#index: delete
Has been deprecated since 0c97c8e335.
2020-12-07 18:35:58 +09:00
Benoit Daloze 9dbb2bfd73 Wrap SortedSet with `ruby_version_is ""..."3.0"`
* Using $ spec/mspec/tool/wrap_with_guard.rb 'ruby_version_is ""..."3.0"' spec/ruby/library/set/sortedset/**/*_spec.rb
2020-12-05 11:40:00 +01:00
Benoit Daloze bb3d705819 Add MSpec tool to automatically wrap spec files with a guard 2020-12-05 11:39:33 +01:00
Benoit Daloze d0bd43c332 Revert "SortedSet was removed at a3db08d7b6ff119223f77e3df00b4f6deac971e2"
* This reverts commit b06ffce4ae.
* Do not revert specs, wrap them with `ruby_version_is` (tool for that in next commit).
2020-12-05 11:17:22 +01:00
Benoit Daloze 9ea1055eab 2.8 -> 3.0 in specs 2020-12-04 16:32:14 +01:00
Hiroshi SHIBATA e666bd1c5a
Skip subclass spec with SortedSet 2020-12-04 19:36:30 +09:00
Hiroshi SHIBATA b06ffce4ae
SortedSet was removed at a3db08d7b6 2020-12-04 19:36:12 +09:00
卜部昌平 43b95bafd5
delete deprecated IO-like methods
This commit deletes
{IO,ARGF,StringIO,Zib::GZipReader}#{bytes,chars,lines,codepoints}, which
have been deprecated since c47c095b97.

Note that String also has those methods.  They are neither depreacted
nor deleted because they are not aliases of counterpart each_something.
2020-12-03 12:47:51 +09:00
卜部昌平 12a121cc0f
ENV.index: delete
Has been deprecated since 373282f665.
2020-12-02 20:17:11 +09:00
Benoit Daloze ddb1736bfc Update to ruby/spec@c4170a3 2020-11-27 15:47:17 +01:00
Benoit Daloze f02d2f82bf Update to ruby/spec@ac878ad 2020-11-27 14:55:31 +01:00
Benoit Daloze f0bfa266d7 Update to ruby/mspec@b58e665 2020-11-27 14:55:29 +01:00
Benoit Daloze f0e2ea2859 Clarify spec and change of behavior for Random::DEFAULT 2020-11-27 10:29:39 +01:00
Koichi Sasada 2db2fb9f6c per-ractor Random::DEFAULT
Random generators are not Ractor-safe, so we need to prepare
per-ractor default random genearators. This patch set
`Random::DEFAULT = Randm` (not a Random instance, but the Random
class) and singleton methods like `Random.rand()` use a per-ractor
random generator.

[Feature #17322]
2020-11-27 17:03:30 +09:00
Nobuyoshi Nakada 82e836dc7d
Use hex-encoded binaries instead of UTF-8
Which UTF-8 char corresponds to the binary representation is
nonsense for other encodings, and just confusing.
2020-11-22 22:51:28 +09:00
Lars Kanis d403591b34
Add string encoding IBM720 alias CP720 (#3803)
The mapping table is generated from the ICU project:
  https://github.com/unicode-org/icu/blob/master/icu4c/source/data/mappings/ibm-720_P100-1997.ucm

Fixes bug 16233 : https://bugs.ruby-lang.org/issues/16233
2020-11-22 22:23:40 +09:00
Nobuyoshi Nakada 7c879cbb3f
Suppress a unused-variable warning 2020-11-22 19:10:58 +09:00
Jeremy Evans 58325daae3 Make String methods return String instances when called on a subclass instance
This modifies the following String methods to return String instances
instead of subclass instances:

* String#*
* String#capitalize
* String#center
* String#chomp
* String#chop
* String#delete
* String#delete_prefix
* String#delete_suffix
* String#downcase
* String#dump
* String#each/#each_line
* String#gsub
* String#ljust
* String#lstrip
* String#partition
* String#reverse
* String#rjust
* String#rpartition
* String#rstrip
* String#scrub
* String#slice!
* String#slice/#[]
* String#split
* String#squeeze
* String#strip
* String#sub
* String#succ/#next
* String#swapcase
* String#tr
* String#tr_s
* String#upcase

This also fixes a bug in String#swapcase where it would return the
receiver instead of a copy of the receiver if the receiver was the
empty string.

Some string methods were left to return subclass instances:

* String#+@
* String#-@

Both of these methods will return the receiver (subclass instance)
in some cases, so it is best to keep the returned class consistent.

Fixes [#10845]
2020-11-20 16:30:23 -08:00
Jeremy Evans ce9beb9d20 Improve error message when subclassing non-Class
Fixes [Bug #14726]
2020-11-13 07:06:13 -08:00
Benoit Daloze 6d05967468 Update to ruby/spec@b0b7f53 2020-11-13 13:17:24 +01:00
Benoit Daloze acbe7aa197 Update to ruby/mspec@f8b0618 2020-11-13 13:17:22 +01:00
Hiroshi SHIBATA 69c5474e10
Fixup 957efa95cc 2020-11-13 13:19:38 +09:00
Yusuke Endoh 6325866421 spec/ruby/core/file/utime_spec.rb: XFS seems to have Year 2038 problem
https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20201112T123004Z.fail.html.gz
```
1)
File.utime allows Time instances in the far future to set mtime and
atime (but some filesystems limit it up to 2446-05-10) FAILED
Expected [559444, 2446].include? 2038
to be truthy but was false
/home/chkbuild/chkbuild/tmp/build/20201112T123004Z/ruby/spec/ruby/core/file/utime_spec.rb:80:in
`block (4 levels) in <top (required)>'
/home/chkbuild/chkbuild/tmp/build/20201112T123004Z/ruby/spec/ruby/core/file/utime_spec.rb:3:in
`<top (required)>'
```

```
$ touch foo
$ ./miniruby -e 'time = Time.at(1<<44); File.utime(time, time, "foo")'
$ ls -l foo
-rw-r--r--. 1 mame wheel 0 Jan 19  2038 foo
```
2020-11-12 23:39:27 +09:00
Kazuki Tsujimoto 5823f6c25b
Fix indentation 2020-11-07 22:12:22 +09:00
Kazuki Tsujimoto 640fd94eff
Fix and remove spec testing undefined behavior 2020-11-07 22:05:20 +09:00
Marc-Andre Lafortune 6f24be8565 Revert "Make `marshal_load` public"
This reverts commit ee7cc6ac35.

I'm not sure I agree with the spec, but I just tweaked it.
2020-11-04 17:52:03 -05:00
Jeremy Evans 2a294d499b
Make Array methods return Array instances instead of subclass instances
This changes the following methods to return Array instances instead
of subclass instances:

* Array#drop
* Array#drop_while
* Array#flatten
* Array#slice!
* Array#slice/#[]
* Array#take
* Array#take_while
* Array#uniq
* Array#*

Fixes [Bug #6087]
2020-11-03 14:01:38 -08:00
Kazuki Tsujimoto 963359a762
Use the suppress_warning helper instead of doing it manually 2020-11-01 19:00:22 +09:00
Kazuki Tsujimoto 7282f3113d
Suppress "One-line pattern matching is experimental" warning 2020-11-01 18:19:58 +09:00
Kazuki Tsujimoto e0e2492cd3
Fix Rubyspec (ruby-2.7) failures
https://github.com/ruby/ruby/runs/1337845174
2020-11-01 17:37:03 +09:00
Koichi Sasada 0e33028d69 use one-line pattern matching for warning tests 2020-11-01 13:55:54 +09:00
Nobuyoshi Nakada 52c630da00
Assoc pattern matching (#3703)
[Feature #17260] One-line pattern matching using tASSOC

R-assignment is rejected instead.
2020-10-26 18:00:24 +09:00
Benoit Daloze cffdacb15a Ignore <internal: entries from core library methods for Kernel#warn(message, uplevel: n)
* Fixes [Bug #17259]
2020-10-26 08:47:33 +01:00
Benoit Daloze fbb2d30ee6 Add specs that #caller and #caller_locations include core library methods defined in Ruby 2020-10-26 08:47:33 +01:00
Benoit Daloze 3673c3eafc Update to ruby/spec@b164536 2020-10-26 08:20:48 +01:00
Benoit Daloze ba24aee292 Remove spec which is too difficult to get working with various compilers
* The spec means to use an actual system library function, not a wrapper.
2020-10-26 08:06:33 +01:00
Nobuyoshi Nakada b6d0b3dfaf
Use gcc-specific pragma only on gcc (and the family) 2020-10-26 08:16:51 +09:00
Nobuyoshi Nakada 25a332f5cf
Fix compilation on MSVC
* cast scalar value instead of function
* use `rb_pid_t` for the portability
2020-10-25 22:07:09 +09:00
Benoit Daloze 99e067eac6 Try to fix compilation on MSVC 2020-10-25 11:42:20 +01:00
Benoit Daloze 148961adcd Update to ruby/spec@4f59d86 2020-10-24 15:53:53 +02:00
Benoit Daloze 342fbae83c Update to ruby/mspec@b56e7a2 2020-10-24 15:53:53 +02:00
Kenta Murata f754b42285
numeric.c, range.c: prohibit zero step
* numeric.c: prohibit zero step in Numeric#step

* range.c: prohibit zero step in Range#step

* Fix ruby-spec

[Feature #15573]
2020-10-23 15:26:51 +09:00
Kazuhiro NISHIYAMA ce62850334
Fix typos [ci skip] 2020-10-19 13:20:34 +09:00
Hiroshi SHIBATA b68c22b3c6 Partly reverted test failing with https://github.com/rubygems/rubygems/pull/3921 2020-10-15 17:19:02 +09:00
Hiroshi SHIBATA d386a58f6f Merge bundler-2.2.0.rc.2 2020-10-15 17:19:02 +09:00
Yusuke Endoh 0b1b0f134e spec/ruby/library/socket/socket/listen_spec.rb: Allow both EACCES and EOPNOSUPP
on Android
2020-10-12 23:36:52 +09:00
Koichi Sasada bf3b2a4374 relax Fiber#transfer's restriction
Using Fiber#transfer with Fiber#resume for a same Fiber is
limited (once Fiber#transfer is called for a fiber, the fiber
can not be resumed more). This restriction was introduced to
protect the resume/yield chain, but we realized that it is too much
to protect the chain. Instead of the current restriction, we
introduce some other protections.

(1) can not transfer to the resuming fiber.
(2) can not transfer to the yielding fiber.
(3) can not resume transferred fiber.
(4) can not yield from not-resumed fiber.

[Bug #17221]

Also at the end of a transferred fiber, it had continued on root fiber.
However, if the root fiber resumed a fiber (and that fiber can resumed
another fiber), this behavior also breaks the resume/yield chain.
So at the end of a transferred fiber, switch to the edge of resume
chain from root fiber.
For example, root fiber resumed f1 and f1 resumed f2, transferred to
f3 and f3 terminated, then continue from the fiber f2 (it was continued
from root fiber without this patch).
2020-10-12 22:58:41 +09:00
Yusuke Endoh 2fd71112fb Make the test suite pass on real Android/Termux environment
Attempting to create a hard link raises EACCES
2020-10-12 21:26:05 +09:00
Nobuyoshi Nakada c881678cd7
Removed meaningless system dependent tests
As [Bug #16662] lchmod available in linux since glibc 2.31.9000, a
system call may exist or not exist depending on the version.  It
is not a spec nor responsibility of Ruby.
2020-10-02 08:43:33 +09:00
Yusuke Endoh ab99a2ac44 spec/ruby/core/process/spawn_spec.rb: skip a test on Android
On Android, STDERR seems to be open even its invoker closes it.

http://rubyci.s3.amazonaws.com/android29-x86_64/ruby-master/log/20201001T014315Z.fail.html.gz

```
1)
Process.spawn closes STDERR in the child if :err => :close FAILED
Expected (59840): "out\nrescued\n"
         but got: "out\n"
```
2020-10-01 13:27:32 +09:00
Marc-Andre Lafortune b36a45c05c [ruby/ostruct] Improved YAML serialization.
Patch adapted from Pietro Monteiro [Fixes bug#8382]
2020-09-30 18:11:24 -04:00
Benoit Daloze 65e8a29389 Update to ruby/spec@bfd843a 2020-09-30 13:43:19 +02:00
Benoit Daloze bbecf1eb6b Update to ruby/mspec@e154fa1 2020-09-30 13:43:17 +02:00
Benoit Daloze 8dab56ea86 Update to ruby/spec@681e8cf 2020-09-30 12:39:20 +02:00
Benoit Daloze 31636bbddc Update to ruby/mspec@4120a62 2020-09-30 12:39:18 +02:00
Benoit Daloze 201d501640 Update to ruby/spec@9277d27 2020-09-30 12:21:48 +02:00
Jeremy Evans 346301e232 Add rb_category_warn{,ing} for warning messages with categories
This adds the following C-API functions that can be used to emit
warnings with categories included:

```c
void rb_category_warn(const char *, const char*, ...)
void rb_category_warning(const char*, const char*, ...)
```

Internally in error.c, there is an rb_warn_category function
that will call Warning.warn with the string and the category
keyword if it doesn't have an arity of 1, and will call
Warning.warn with just the string if it has an arity of 1.
This refactors the rb_warn_deprecated{,_to_remove} functions
to use rb_warn_category.

This makes Kernel#warn accept a category keyword and pass it
to Warning.warn, so that Ruby methods can more easily emit
warnings with categories.  rb_warn_category makes sure that
the passed category is a already defined category symbol
before calling Warning.warn.

The only currently defined warning category is :deprecated,
since that is what is already used.  More categories can be
added in later commits.
2020-09-28 08:38:06 -07:00
Benoit Daloze f2c6a3513f Clarify spec description for Hash#{each,each_pair} 2020-09-28 11:29:15 +02:00
Steven Peckins 8863bfb1f4 [rubygems/rubygems] Move comment below shebang in bin/console template
In an executable script, the shebang line should be the first line (the
file needs to start with the bytes 0x23 0x21).  Putting a comment above
it will break the script.

(Regression test included per @deivid-rodriguez)

https://github.com/rubygems/rubygems/commit/962e669feb
2020-09-28 14:54:22 +09:00
Koichi Sasada 0096d2b895 freeze all Range objects.
Matz want to try to freeze all Range objects.
[Feature #15504]
2020-09-25 22:16:55 +09:00
Koichi Sasada fde136152e should not check taint flag on rubyspec.
Now taint flag is obsolete and it is used fro shareaable flag.
So we should not check this flag.
2020-09-25 12:52:53 +09:00
Nobuyoshi Nakada 996af2ce08 Disable deprecation warning by the default [Feature #16345]
And `-w` option turns it on.
2020-09-25 09:50:33 +09:00
Hiroshi SHIBATA a46841612c
bump Bundler's version to 2.2.0.rc.1 2020-09-23 21:06:29 +09:00
Jeremy Evans 179384a668 Revert "Prevent SystemStackError when calling super in module with activated refinement"
This reverts commit eeef16e190.

This also reverts the spec change.

Preventing the SystemStackError would be nice, but there is valid
code that the fix breaks, and it is probably more common than cases
that cause the SystemStackError.

Fixes [Bug #17182]
2020-09-22 12:04:48 -07:00
Benoit Daloze 82998918ef Make Thread#join always convert its argument, as before 70f08f1eed 2020-09-21 16:22:04 +02:00