Commit graph

14676 commits

Author SHA1 Message Date
David Rodríguez
82692b32c1
[rubygems/rubygems] Log when simulate_version is enabled
Tweak version output and verbose mode to be transparent about Bundler
simulating a different version than the real one.

179354d153
2025-07-02 10:34:18 +09:00
David Rodríguez
0e1ca4962f
[rubygems/rubygems] None of the global options have default so this seems unnecessary
bea87eab0b
2025-07-02 10:34:18 +09:00
David Rodríguez
efd8b6d201
[rubygems/rubygems] Use explicit receiver when accessing settings
We have a quality spec that parses all code for explicit usages of
`Bundler.settings[<something>`, to detect undocumented settings. So
using `Bundler.settings` consistently will help catching these things.

ce01bb7cc5
2025-07-02 10:34:18 +09:00
David Rodríguez
cac7644bdb
[rubygems/rubygems] Document the simulate_version setting
1ffd83f6c2
2025-07-02 10:34:18 +09:00
David Rodríguez
daedebd64a
[rubygems/rubygems] Remove print_only_version_number setting
I don't think it makes sense to make this tiny behavior change
configurable. If someone wants to parse version output, and we have a
public setting, they are going to need to accommodate their regexps to
both values of the setting.

In addition to this, I plan to enhance version output with a note about
"simulated version", and in that case, "print_only_version_number" would
no longer hold, since what we print will be more than that anyways.

So, I'd like to remove the setting and change the output in Bundler 4
with no way to opt out.

d84e9dcf09
2025-07-02 10:34:18 +09:00
Hiroshi SHIBATA
9dc60de4fc Fixed inconsistency gemspec location
foo.gemspec should be located under the `lib/foo` directory.
2025-07-01 14:51:09 +09:00
Hiroshi SHIBATA
c3bdf7043c Use git ls-files instead of Dir.glob because optparse has optionparser.rb that is outside of lib/optparse directory
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2025-07-01 11:50:11 +09:00
Hiroshi SHIBATA
05443bb7e9 [ruby/optparse] Use Dir.glob and base keyword arg for the installer of Ruby package
24374b42d3
2025-07-01 01:02:52 +00:00
Earlopain
3071c5d04c [ruby/prism] Fix parser translator with trailing backslash in %W /%I array
https://docs.ruby-lang.org/en/master/syntax/literals_rdoc.html#label-25w+and+-25W-3A+String-Array+Literals
> %W allow escape sequences described in Escape Sequences. However the continuation line <newline> is not usable because it is interpreted as the escaped newline described above.

f5c7460ad5
2025-06-30 12:32:31 +00:00
David Rodríguez
d6bfb73fb6 [rubygems/rubygems] Update some reference to Bundler 3 to Bundler 4
53174e0aa6
2025-06-30 12:56:50 +09:00
Hiroshi SHIBATA
949f125f0f [rubygems/rubygems] Use Bundler.settings[gem.bundle]
b16511598e
2025-06-30 12:56:50 +09:00
Hiroshi SHIBATA
59585b2f43 [rubygems/rubygems] Added manpages
f2826dafce
2025-06-30 12:56:50 +09:00
Hiroshi SHIBATA
5798eeb7c7 [rubygems/rubygems] Added bundle option to method_option
1413086e92
2025-06-30 12:56:50 +09:00
Hiroshi SHIBATA
1cb1b15f77 [rubygems/rubygems] Added --bundle option for triggering bundle install automatically after bundle gem
59ac0db26b
2025-06-30 12:56:50 +09:00
David Rodríguez
9e566141cd [rubygems/rubygems] Remove "double CI" for testing Bundler 4 mode
Since now every functionality that changes in Bundler 4 is under a
setting, we can enable that setting to test the new functionality,
without having to run our full CI twice.

This can actually be seen as increasing coverage, because Bundler 4
functionality will now be tested on Windows, MacOS, or any other
environment where previously "Bundler 4 mode" was not running.

1cb3e009fc
2025-06-30 12:56:50 +09:00
Hiroshi SHIBATA
0761af2399 [rubygems/rubygems] Added push_rubygem to default scope at gem signin command
9b9ba0bf1e
2025-06-30 12:56:50 +09:00
Nobuyoshi Nakada
9598ed9d1c [ruby/optparse] JRuby does not have EXECUTABLE_EXTS in RbConfg::CONFIG
15b2f00b6b
2025-06-29 07:52:46 +00:00
Nobuyoshi Nakada
259b0233d8 [ruby/optparse] Fix OptionParser#program_name not to strip suffix unexpectedly
740ffa76c0
2025-06-29 07:52:45 +00:00
kwatch
9fd793e0bd [ruby/optparse] Enhance to support 'Set' object as an enum
(https://github.com/ruby/optparse/pull/76)

* Enhance to support 'Set' object as an enum

* Add test script for '#make_swithc()'

---------

3869000e98

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2025-06-29 07:30:58 +00:00
Nobuyoshi Nakada
dc74f9cb36
Make uplevel suitable as the option to Kernel#warn
Make Gem::BUNDLED_GEMS.uplevel returns `nil` if `require` frame is not
found, for the simplicity.
2025-06-28 22:27:30 +09:00
Nobuyoshi Nakada
baa0500140
Use symbols as level instead of strings 2025-06-28 22:24:20 +09:00
Nobuyoshi Nakada
4b1de7378d [ruby/uri] [DOC] State that uri library is needed to call Kernel#URI
So that the example works as-is.

30212d311e
2025-06-26 01:46:48 +00:00
Nobuyoshi Nakada
4eba511c1b [ruby/uri] Fix a typo
b636e83d99

Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
2025-06-26 01:39:20 +00:00
Nobuyoshi Nakada
228cc794f5 [ruby/uri] Use Lo category chars as escaped chars
TruffleRuby does not allow Symbol categories as identifiers.

5531d42375
2025-06-26 01:39:20 +00:00
Nobuyoshi Nakada
42f753d829 [ruby/uri] Escape reserved characters in scheme name
Fix https://github.com/ruby/uri/pull/89

d543c0dafa
2025-06-26 01:39:19 +00:00
David Rodríguez
90085f62fb [rubygems/rubygems] Simulate Bundler 4 in a better way
Overriding the version constant feels too magic and creates a set of
problems. For example, Bundler will lock the simulated version, and that
can cause issues when the lockfile is used under an environment not
simulating Bundler 4 (it will try to auto-install and auto-switch to a
version that does not exist).

On top of that, it can only be configured with an ENV variable which is
not too flexible.

This commit takes a different approach of using a setting, which is
configurable through ENV or `bundle config`, and pass the simulated
version to `Bundler::FeatureFlag`. The real version is still the one set
by `VERSION`, but anything that `Bundler::FeatureFlag` controls will use
the logic of the "simulated version".

In particular, all feature flags and deprecation messages will respect
the simulated version, and this is exactly the set of functionality that
we want users to be able to easily try before releasing it.

8129402193
2025-06-26 08:06:48 +09:00
David Rodríguez
18618810a2 [rubygems/rubygems] Use Gem::Version` methods instead of string splitting
75fed35264
2025-06-26 08:06:44 +09:00
David Rodríguez
f32dbc9bb0 [rubygems/rubygems] Centralize managing major version dependent behavior in FeatureFlag class
7708e5b784
2025-06-26 08:06:44 +09:00
David Rodríguez
168e7fc300 [rubygems/rubygems] Remove redundant receivers
d7b9c4532e
2025-06-26 08:06:43 +09:00
David Rodríguez
a9860b6cb1 [rubygems/rubygems] No need to reset this variable
f96fedf1f1
2025-06-26 08:06:42 +09:00
MSP-Greg
fb2f89d867 [rubygems/rubygems] Add missing require "fileutils" in lib/rubygems/installer.rb
9a9d0e423e
2025-06-25 22:41:49 +09:00
Benoit Daloze
3b602c952d [ruby/timeout] Gracefully handle a call to ensure_timeout_thread_created in a signal handler
* Fixes the issue described in
  https://github.com/ruby/timeout/issues/17#issuecomment-1461498517
  for TruffleRuby and JRuby.
* CRuby is currently unable to use Timeout in a signal handler due to
  https://bugs.ruby-lang.org/issues/19473.

7a48e1c079
2025-06-24 20:41:45 +00:00
Hiroshi SHIBATA
62aa4a6010 [ruby/resolv] v0.6.1
6b57765f8d
2025-06-24 09:32:57 +00:00
Hiroshi SHIBATA
7a5e46cff2
Revert accidentally commit with 96a0c2065a 2025-06-24 12:10:50 +09:00
David Rodríguez
7a297ad2f9
[rubygems/rubygems] Fix Bundler.original_env['GEM_HOME'] when Bundler is trampolined
4c450eb05e
2025-06-24 12:10:50 +09:00
David Rodríguez
32a9f29cc8
[rubygems/rubygems] Remove no longer necessary workarounds for restarts
Since we no longer pass ruby CLI flags in our spec commands, we no
longer need the previous workaround and can get the realworld code
tested.

fd92c855fb
2025-06-24 12:10:50 +09:00
Jean Boussier
96a0c2065a Mark RClass instance that may be namespaced with RCLASS_NAMESPACEABLE 2025-06-23 10:04:58 +01:00
Nicholas La Roux
a1d62a3b1c [rubygems/rubygems] Handle RubyGems installing to custom dir with non-existent parent dirs
4701123601
2025-06-23 11:07:03 +09:00
David Rodríguez
8f009601f9 [rubygems/rubygems] Handle Errno::EADDRNOTAVAIL gracefully
As showed by the unskiped spec, on Windows trying to use the 0.0.0.0
interface raises this error, and it's raised as a generic system error
when trying to create a `bundler.lock` file. Here's is a better place to
handle that.

e32c5a9e5c
2025-06-23 11:07:02 +09:00
David Rodríguez
7fe1fc392e [rubygems/rubygems] Make HTTP_ERRORS list look like FAIL_ERRORS list
bfa6770e39
2025-06-23 11:07:01 +09:00
David Rodríguez
c3bfce512b [rubygems/rubygems] Simplify non retriable errors list
627a7615f2
2025-06-23 11:07:00 +09:00
David Rodríguez
627ca420e9 [rubygems/rubygems] Move HTTP_ERRORS together with the other error constants
57e8ae7aa6
2025-06-23 11:07:00 +09:00
David Rodríguez
746e0d3ef4 [rubygems/rubygems] Deprecate unused Bundler#SpecSet methods
380c95ce05
2025-06-23 11:06:59 +09:00
Hiroshi SHIBATA
c2d5d2969a [ruby/weakref] v0.1.4
f6bd03ed54
2025-06-19 01:53:19 +00:00
David Rodríguez
441f18df52
Skip to Bundler 4 directly 2025-06-19 10:23:36 +09:00
Landon Grindheim
471da0f0bd
[rubygems/rubygems] Use persist-credentials: false in template
`actions/checkout` defaults this value to `true`, causing credentials to
be written to `.git/config`. By setting it to `false`, we lessen the
likelihood of secrets being written to disk.

a751d36456
2025-06-19 10:23:36 +09:00
David Rodríguez
6d8460e0a0
[rubygems/rubygems] Fix running gem commands in a bundle exec context
They should only load plugins from gems in the bundle.

a229507820
2025-06-19 10:23:36 +09:00
David Rodríguez
4281b95e53
[rubygems/rubygems] Move finding eigenclass to a method
5ad0737e77
2025-06-19 10:23:36 +09:00
David Rodríguez
382b8eadae
[rubygems/rubygems] Fix grammar in bundle config deprecation message
d23b3d61ac
2025-06-19 10:23:36 +09:00
David Rodríguez
4245d522b2
[rubygems/rubygems] Allow enabling "Bundler 3 mode" more easily
Currently to test Bundler 3 mode we have to actually edit the version
file to simulate we're running a future version. This is inconvenient.

Instead, allow passing an environment variable, `BUNDLER_3_MODE`, to set
the "working mode" Bundler should use.

This can now be set easily by end users to enable them to try out the
changes in the future version and give us feedback.

It's unclear how version auto-switching should work when this
environment variable is set, so the auto-switching feature will be
disabled in that case.

4e92e9b209
2025-06-19 10:23:36 +09:00