Commit graph

14675 commits

Author SHA1 Message Date
Nobuyoshi Nakada
1a03270a7e [ruby/uri] [DOC] Fix references
These are instance methods, not class methods.  And `URI::Parser` was
moved to URI::RFC2396_Parser at [r46491]

[r46491]: bb83f32dc3

452d74390c
2025-07-14 05:11:58 +00:00
David Rodríguez
7a03a02bee
[rubygems/rubygems] Fix more warnings when running old Bundler with latest RubyGems
Also fix platform warnings when Bundler's entrypoint is bundler's
binstub.

4b1df58403
2025-07-14 11:52:14 +09:00
David Rodríguez
c3d41492e1
[rubygems/rubygems] Avoid more warnings when using RubyGems with old Bundler
We were only avoiding them when the RUBYGEMS_GEMDEPS variable is used.
Avoid the warnings in general, whenever the entrypoint to Bundler is
`require`.

8683faef36
2025-07-14 11:52:14 +09:00
David Rodríguez
a93c684077
[rubygems/rubygems] Change helper to load only Bundler extensions to RubyGems
We'll want to reuse this helper in other situations where we don't want
all Bundler loaded.

9e7018b0a1
2025-07-14 11:52:14 +09:00
David Rodríguez
1c48aa6f4a
[rubygems/rubygems] Move loading Bundler without platform warnings to a method
e068f0649a
2025-07-14 11:52:14 +09:00
David Rodríguez
4651d235db
[rubygems/rubygems] No need to detect ancient binstubs either
346d491a11
2025-07-14 11:52:14 +09:00
David Rodríguez
15751af90b
[rubygems/rubygems] Improve some heredoc indentations
6ee3a33048
2025-07-14 11:52:13 +09:00
David Rodríguez
f1cbd58acc
[rubygems/rubygems] Stop generating binstubs with support for RubyGems before 2.6.2
RubyGems generated binstubs still provide support for this ancient
version. This makes no sense since we prevent downgrades to such old
versions.

089cdc3b77
2025-07-14 11:52:13 +09:00
David Rodríguez
7dc284189a
[rubygems/rubygems] Load RubyGems extensions in the first place
This is not currently causing any issues, but I think the most correct
thing to do is that Bundler loads the extensions to RubyGems in the
first place, so that they are available from the beginning.

88faa5c7bb
2025-07-14 11:52:13 +09:00
Nobuyoshi Nakada
cf7b871a94 [ruby/uri] Improve performance of URI::MailTo::EMAIL_REGEXP
Fix the performance regression at #172 for valid emails.

``` yml
prelude: |
  require 'uri/mailto'
  n = 1000
  re = URI::MailTo::EMAIL_REGEXP
benchmark:
  n.t..t.: re.match?("n.t..t.@docomo.ne.jp")
  example: re.match?("example@example.info")
```

|         |released| 788274b| c5974f0|    this|
|:--------|-------:|-------:|-------:|-------:|
|n.t..t.  |  3.795M|  4.864M|  4.993M|  8.739M|
|         |       -|   1.28x|   1.32x|   2.30x|
|example  |  3.911M|  3.740M|  2.838M|  3.880M|
|         |   1.38x|   1.32x|       -|   1.37x|

7363a134ac
2025-07-12 10:32:48 +00:00
Jeremy Evans
22b81b5bf5 [ruby/uri] Do not allow empty host names, as they are not allowed by RFC 3986
Pointed out by John Hawthorn.

Fixes [Bug #20686]

c0cfa04a66
2025-07-12 07:07:39 +00:00
Nobuyoshi Nakada
1add45e2a6 [ruby/uri] Prohibit successive dots in email
32335923bf
2025-07-12 07:07:05 +00:00
Nikita Levchuk
c97eba9bcd [ruby/uri] lib/uri/mailto.rb (EMAIL_REGEXP): use assertions surrounding the local part instead of a character class
2d7d2d9988
2025-07-12 03:31:54 +00:00
Nikita Levchuk
0685e8caf9 [ruby/uri] lib/uri/mailto.rb (EMAIL_REGEXP): the local part should not contain leading or trailing dots
618e2bb640
2025-07-12 03:31:53 +00:00
Nobuyoshi Nakada
f1764623db [ruby/uri] Make URI::regexp schemes case sensitive
(https://github.com/ruby/uri/pull/38)

0c2b6468fa
2025-07-12 03:24:15 +00:00
Nobuyoshi Nakada
c47a92b63d [ruby/uri] Fix the message for unexpected argument
Use just `self` instead of `self.class`, in `URI::Generic.build`.
Since this is a class method, `self.class` is always `Class` even in
inherited sub classes, and does not have `#component` method.

6f44d3d40e
2025-07-12 03:05:25 +00:00
Hiroshi SHIBATA
65a0f46880 Warn to use tsort for Ruby 3.6 that will be released at 2026 2025-07-10 16:48:16 +09:00
Hiroshi SHIBATA
8cc109a86f [rubygems/rubygems] Update vendored resolv to 0.6.2
afbbc02763
2025-07-10 15:40:07 +09:00
Sweta Sanghavi
4ed2757543 [rubygems/rubygems] Update gemspec based on provided github username when exists
* Conditionally set changelog_url if gh username passed
and enabled
* conditionally set homepage, source code uri, homepage uri when gh
  username passed in
* update documentation to say username will also be used for gemspec file

1c1ada593b
2025-07-09 13:48:37 +09:00
Peteris Rudzusiks
3feba181ed [rubygems/rubygems] Let s3_uri_signer accept the HTTP method
35fc7f9547
2025-07-09 13:48:37 +09:00
Peteris Rudzusiks
5d880b75ef [rubygems/rubygems] Correctly sign S3 HEAD requests
We sometimes send HEAD requests. The s3_uri_signer.rb code allways assumed GETs.
This lead to consistently getting 403 responses back from S3. Recently, S3
attempted to change the behaviour of how 403s are handled when TCP connections
are reused,  which escalated this bug from "just noise" to "breaks gem installs".
They've reverted that behaviour, so the severity of this problem is back to
"just noise". Either way, it's a bug in rubygems and warrants a fix it.

c38f502b73
2025-07-09 13:48:36 +09:00
Peteris Rudzusiks
af6012b942 [rubygems/rubygems] Fix date format in S3 URI signer
%M is minute of the hour.
%m is month of year.
We want the former, not the latter.

d7ca3fa279
2025-07-09 13:48:35 +09:00
David Rodríguez
c6da019770 [rubygems/rubygems] Add blank line after every question
To try make output a bit less messy.

92c8bc6769
2025-07-09 13:48:34 +09:00
David Rodríguez
9942ff7c6a [rubygems/rubygems] Use shorter questions as prompts in bundle gem
If we use long explanations as prompts, sometimes the prompt gets
printed twice due to a (I think) reline/readline bug.

987e0dfa90
2025-07-09 13:48:33 +09:00
David Rodríguez
9b0f9f8139 [rubygems/rubygems] Reword MIT explanation to make sense after reordering
Previous wording assumed explanation was displayed after the question,
not before.

04eb3430ba
2025-07-09 13:48:32 +09:00
Hiroshi SHIBATA
b9782ab893 [ruby/resolv] v0.6.2
a28aaed4cb
2025-07-08 07:25:26 +00:00
Yusuke Endoh
9aa0300db2 [ruby/resolv] Limit decompressed name length
RFC 1035 specifies the 255-octet maximum name length. This change set
checks the limit.

4c2f71b5e8
2025-07-08 07:25:26 +00:00
Nobuyoshi Nakada
680383c642 [ruby/tsort] Exclude gemspec and git-related files
bf2e3a8695
2025-07-08 06:36:18 +00:00
Nobuyoshi Nakada
51de7c75e5 [ruby/tsort] Use git magic signatures to exclude files
ab55dcb7f3
2025-07-08 06:36:17 +00:00
Nobuyoshi Nakada
7578655767 [ruby/tsort] [DOC] Document constants
1d1711ad23
2025-07-08 06:11:04 +00:00
License Update
e1d09ffe5d [rubygems/rubygems] Update SPDX license list as of 2025-07-01
56b55a198a
2025-07-07 11:53:15 +09:00
David Rodríguez
3c552881d4 [rubygems/rubygems] Document that global_gem_cache also caches compiled extensions
265f718be7
2025-07-07 11:53:14 +09:00
David Rodríguez
3eeffea28d [rubygems/rubygems] Improve sentence
"locally to the installing Ruby installation" felt a bit confusing.

c950720719
2025-07-07 11:53:13 +09:00
David Rodríguez
6a5808965b [rubygems/rubygems] Stop allowing calling #gem on random objects
4b8570ae15
2025-07-07 11:53:12 +09:00
David Rodríguez
845e878f88 [rubygems/rubygems] Add default_cli_command documentation
I suspect most experienced users won't like the change in defaults, so
document the setting to toggle back the current default.

93e2e2bef9
2025-07-07 11:53:12 +09:00
David Rodríguez
cd3389e5c2 [rubygems/rubygems] Cancel path_relative_to_cwd change
It only affected the `--path` flag which is actually getting removed, so
I don't think it makes sense to make such change. The current behavior
is reasonable and I tried to codify it with a few more specs.

6f520eb146
2025-07-07 11:53:11 +09:00
David Rodríguez
9918ca1671 [rubygems/rubygems] Remove default_install_uses_path setting
The previous default can already be configured with `bundle config
path.system true`.

cb483b79db
2025-07-07 11:53:00 +09:00
David Rodríguez
fef0051926 [rubygems/rubygems] Remove auto_clean_without_path setting
There already different ways of toggling off this behavior, like setting
`bundle config clean false`, or configuring Bundler to install to system
gems with `bundle config path.system true`.

6daa09f60a
2025-07-07 11:52:58 +09:00
David Rodríguez
81da38b308 Sync RubyGems 2025-07-03 13:43:00 +09:00
Joshua Young
8bf13f2605 Reduce allocations in Gem::BUNDLED_GEMS.warning? 2025-07-02 11:28:23 +09:00
David Rodríguez
d5b4b59500
[rubygems/rubygems] Add Errno::ENETDOWN and Errno::EHOSTUNREACH to non retryable errors
Connection errors as well, so useless to retry.

d2d211651a
2025-07-02 10:34:19 +09:00
David Rodríguez
35dd2b2994
[rubygems/rubygems] Split HTTP_ERRORS into retryable and non retryable
c241a640fc
2025-07-02 10:34:19 +09:00
David Rodríguez
c4c646d1bb
[rubygems/rubygems] Handle connection refused and Errno::EADDRNOTAVAIL as non-retryable
cd529776d5
2025-07-02 10:34:19 +09:00
David Rodríguez
b671133c06
[rubygems/rubygems] Move Bundler::Fetcher::HTTP_ERRORS to Bundler::Fetcher::DOWNLOADER
And deprecate the old constant.

It's only used in this class, and in Bundler::Fetcher there's already
FAIL_ERRORS, very similar to it. So this makes things less confusing.

d32ed63d6f
2025-07-02 10:34:19 +09:00
David Rodríguez
d2204044f4
[rubygems/rubygems] Add back and deprecate Bundler::Fetcher::NET_ERRORS
4a4e5828db
2025-07-02 10:34:19 +09:00
David Rodríguez
7f057e13e0
[rubygems/rubygems] Add a verbose setting to enable verbose output for all commands
0aa1be946f
2025-07-02 10:34:19 +09:00
David Rodríguez
29ceefe595
[rubygems/rubygems] Consistently access CLI flags with symbols
1497d3f146
2025-07-02 10:34:19 +09:00
Earlopain
560edfc8f7
[rubygems/rubygems] Fix bundle console printing bug report template on NameError during require
Followup to https://github.com/rubygems/rubygems/pull/8436

It fixed showing the template when requiring a non-existant file but
user code can do much more than just trying to require other code.

I encountered this particular case because of load order issues, where a library wasn't able
to properly require itself when loaded before some other library.

1c910e5afe
2025-07-02 10:34:19 +09:00
Edouard CHIN
098b0cd7be
[rubygems/rubygems] Update man pages for the bundle doctor ssl subcommand:
- ### Problem

  The man pages for `bundle doctor` which shows up when running
  `bundle doctor --help` are no longer in sync with the CLI.

  ### Context

  In #8624, we introduced a change that modifies the structure of
  the `bundle doctor` command.
  The change added a new subcommand as well a new flag option
  `bundle doctor --ssl`

  Bundler uses man pages to display help of Thor commands, those man
  pages are indepedent from Thor options and need to be kept in sync.

  ### Solution

  Updated the man page for `bundle doctor`. Now that this command is
  a subcommand composed of `bundle doctor diagnose` (the default) ,
  and `bundle doctor ssl`, I modified the man page to follow
  the same markdown structure as other subcommands such as
  [bundle plugin](a902381660/bundler/lib/bundler/man/bundle-plugin.1.ronn)

de047f1458
2025-07-02 10:34:19 +09:00
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