Commit graph

14659 commits

Author SHA1 Message Date
Samuel Giddins
c0a1e877b3
Move most of Bundler::GemHelpers to Gem::Platform
This will help centralize wheel platform selection logic eventually

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
2025-06-06 10:22:18 +09:00
Thomas Marshall
ee55b82b34
[rubygems/rubygems] Cache commit SHA ref revisions
If the `ref` option is a specific commit SHA, we can check to see if
it's already fetched locally. If it is, then we don't need to re-fetch
it from the remote.

The `ref` option might not be a commit SHA, so we're using the `#commit`
method which returns the full SHA if it's a commit ref, or the locked
revision, or nil.

This is a small improvement that will make `bundle update` slightly
faster in cases for git-sourced gems pinned to a specific commit.

f434c2e66c
2025-06-06 10:09:14 +09:00
David Rodríguez
b9e3edb3e6 [rubygems/rubygems] Slightly simplify locked specification source replacement
22f0a07377
2025-06-05 19:12:46 +09:00
David Rodríguez
970eac1530 [rubygems/rubygems] Fix git source unlocking for multi-gem repositories like Rails
If you have

```
gem "rails", git: "https://github.com/rails/rails"
```

and then explicitly pin to an older ref, like

```
gem "rails", git: "https://github.com/rails/rails", ref: "99bacb5aa8"
```

Then `bundle install` fails, because locked sources fail to be updated
to use the new source.

This commit fixes the problem by making sure get their source properly
replaced.

5de8c2e0cf
2025-06-05 19:12:46 +09:00
David Rodríguez
e4933e1d93 [rubygems/rubygems] Fix bundle update --bundler when restarts disabled
There's no reason why we should not update bundler as requested, even if
restarts are disabled.

e59acd2a0d
2025-06-05 19:12:45 +09:00
David Rodríguez
5cf07c1e8f [rubygems/rubygems] Look in configured path when checking if self-update version is installed
1ce0882e6f
2025-06-05 19:12:44 +09:00
David Rodríguez
0e6805eb31 [rubygems/rubygems] Refactor restarts to not need memoizing the restart version
a9d80a7dcb
2025-06-05 19:12:43 +09:00
David Rodríguez
e74008bfc9 [rubygems/rubygems] Reduce duplication a bit
0574c62fc0
2025-06-05 19:12:40 +09:00
Antoine Marguerie
11492bd88d [rubygems/rubygems] Fix headings levels in Changelogs
And adapt release scripts and configuration to the new structure.

3deb1aedae
2025-06-05 19:12:39 +09:00
Nicholas La Roux
803dae70cb [rubygems/rubygems] Deprecate x64-mingw32 legacy Windows platform in favor of x64-mingw-ucrt
71c969be44
2025-06-05 19:12:37 +09:00
Hiroshi SHIBATA
a84f734343
Added warning for CGI.parse 2025-06-04 12:47:29 +09:00
TangRufus
204e3c58e1 [rubygems/rubygems] Only ignore .gitignore when generating gems with git
aec5a7887d
2025-06-03 08:06:39 +09:00
TangRufus
9024caa1d6 [rubygems/rubygems] Ignore Gemfile, gems.rb & gems.locked according to init_gems_rb preference
88aeb66f41
2025-06-03 08:06:31 +09:00
TangRufus
2667df27e9 [rubygems/rubygems] Remove .git from spec.files default ignore list
4f96e12ff3
2025-06-03 08:06:13 +09:00
TangRufus
ab63fb0e3b [rubygems/rubygems] Rename ignore_files to ignore_paths
c07e3a88aa
2025-06-03 08:06:05 +09:00
TangRufus
636ff31c4e [rubygems/rubygems] Add .gitignore, gems.rb & gems.locked into spec.files default ignore list
6390ed7a2b
2025-06-03 08:05:49 +09:00
TangRufus
63ae1d289a [rubygems/rubygems] Remove features/ from spec.files default ignore list
77ba4192a7
2025-06-03 08:05:39 +09:00
TangRufus
68345e2930 [rubygems/rubygems] Only ignore test/ when generating gems with minitest or test-unit
c464f2036a
2025-06-03 08:05:31 +09:00
TangRufus
959bde8643 [rubygems/rubygems] Suffix .circleci with / in spec.files in the .gemspec template
e48c6beaf6
2025-06-03 08:05:07 +09:00
TangRufus
3691c5409d [rubygems/rubygems] Suffix .github with / in spec.files in the .gemspec template
edf13f7e60
2025-06-03 08:04:59 +09:00
TangRufus
68d64f464a [rubygems/rubygems] Exclude spec from spec.files in the .gemspec template only when using RSpec
a42387b8be
2025-06-03 08:04:49 +09:00
TangRufus
6b2088cf90 [rubygems/rubygems] Exclude .rspec from spec.files in the .gemspec template
331901941d
2025-06-03 08:04:39 +09:00
TangRufus
a7be563d0b [rubygems/rubygems] Exclude .rubocop.yml and .standard.yml from spec.files in the .gemspec template
9d937d4f7f
2025-06-03 08:04:32 +09:00
TangRufus
4802571729 [rubygems/rubygems] Remove appveyor from spec.files default ignore list
2f2046c97b
2025-06-03 08:04:18 +09:00
TangRufus
04a396409d [rubygems/rubygems] Refactor spec.files ignore list generation
c11539f325
2025-06-03 08:04:04 +09:00
Matthew Hively
21a14ea230
[rubygems/rubygems] Moved the REMEMBERING OPTIONS section to be after CONFIGURATION KEYS
Since the remembering options are discouraged, the preferred method should be explained first.

Slight tweak to wording

Fix documentation spec test as per suggested patch

9f082ccf31
2025-06-03 07:47:14 +09:00
Matthew Hively
f4a5247ce4
[rubygems/rubygems] Clarify how BUNDLE_DEPLOYMENT, BUNDLE_FROZEN and BUNDLE_PATH are connected
9ed20bddab
2025-06-03 07:47:14 +09:00
John Bampton
a763716a96
[rubygems/rubygems] misc: fix spelling
0e40e7d938
2025-06-03 07:47:14 +09:00
Nobuyoshi Nakada
5e64d5c7d9 [ruby/prism] [DOC] Markup __FILE__ as code, not emphasis
571ba378f5
2025-05-29 04:45:59 +00:00
Nobuyoshi Nakada
82c74e4282 [ruby/prism] [DOC] Stop rdoc from processing non-rdoc comments
de1faa1680
2025-05-29 04:45:59 +00:00
Nobuyoshi Nakada
22451f370e [ruby/prism] [DOC] Add code fences
641775e5fe
2025-05-29 04:45:58 +00:00
Nobuyoshi Nakada
991cf2dd4d [ruby/prism] [DOC] Specify markdown mode to RDoc
12af4e144e
2025-05-29 04:45:58 +00:00
John Bampton
bb4d9f3f61 [ruby/resolv] Update resolv.rb - fix spelling
65ce7f214b
2025-05-28 22:01:04 +00:00
Samuel Giddins
485ee6d7a3
[rubygems/rubygems] Remove backport of LATEST_RUBY_WITHOUT_PATCH_VERSIONS
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

24c8073b24
2025-05-26 11:46:12 +09:00
Samuel Giddins
d8d0da5713
[rubygems/rubygems] Remove platform backports from bundler
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

9336d3811c
2025-05-26 11:46:12 +09:00
Samuel Giddins
af27688697
[rubygems/rubygems] Remove reference to validate_rust_builder_rubygems_version
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

f8baf13ab0
2025-05-26 11:46:12 +09:00
Samuel Giddins
c9ba3d0bac
[rubygems/rubygems] Bump required_ruby_version to 3.2
Ruby 3.1 was EOL March 2025

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

29c21b1e78
2025-05-26 11:46:12 +09:00
Nathan Ladd
3ac239f790 [rubygems/rubygems] Copy prerelease attribute to dependency resolver sets
5956e7f8e5
2025-05-21 11:33:32 +09:00
Earlopain
a82e7132df Fix uplevel for cgi under bundler
Since there is `bundled_gems.rb` it is not always one. Fixes the following:
```sh
$ ruby -w -rbundler/inline -e "gemfile {}; require 'cgi'"
/home/earlopain/.rbenv/versions/ruby-dev/lib/ruby/3.5.0+0/bundled_gems.rb:59: warning: CGI library is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features.
If you need to use the full features of CGI library, Please install cgi gem.
```

into:

```sh
$ ruby -w -rbundler/inline -e "gemfile {}; require 'cgi'"
-e:1: warning: CGI library is removed from Ruby 3.5. Please use cgi/escape instead for CGI.escape and CGI.unescape features.
If you need to use the full features of CGI library, Please install cgi gem.
```
2025-05-20 18:22:41 +09:00
Jeremy Evans
c52f4eea56 Remove SortedSet autoload and set/sorted_set
Implements [Feature #21287]
2025-05-20 13:34:31 +09:00
David Rodríguez
aea603615f [rubygems/rubygems] Missing tweak
407c1cbcfe
2025-05-19 11:15:30 +09:00
Samuel Giddins
4be199e435 [rubygems/rubygems] Simplify Gem::Platform#initialize
Based on PR feedback

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

562d7aa087
2025-05-19 11:15:29 +09:00
Samuel Giddins
8f61e17556 [rubygems/rubygems] RuboCop
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

768784910b
2025-05-19 11:15:29 +09:00
Samuel Giddins
eb48418b40 [rubygems/rubygems] Ensure that Gem::Platform parses strings to a fix point
The issue was that the property that

```ruby
platform = Gem::Platform.new $string
platform == Gem::Platform.new(platform.to_s)
```

was not always true.

This property (of acchieving a fix point) is important,
since `Gem::Platform` gets serialized to a string and
then deserialized back to a `Gem::Platform` object.
If it doesn't deserialize to the same object, then
different platforms are used for the initial serialization
than subsequent runs.

I used https://github.com/segiddins/Scratch/blob/main/2025/03/rubygems-platform.rb
to find the failing cases and then fixed them.
With this patch, the prop check test now passes.

313fb4bcec
2025-05-19 11:15:28 +09:00
Daisuke Aritomo
aa0f689bf4 [ruby/net-http] Freeze some constants to improve Ractor compatibility
Freeze `Net::HTTP::SSL_IVNAMES`, `Net::HTTPResponse::CODE_CLASS_TO_OBJ`
and `Net::HTTPResponse::CODE_TO_OBJ` to improve Ractor compatibility.

This change allows the following code to work:

    Ractor.new {
      uri = URI.parse('http://example.com')
      http = Net::HTTP.new(uri.host, uri.port)
      http.open_timeout = nil
      http.read_timeout = nil
      http.get('/index.html')
    }

9f0f5e4b4d
2025-05-17 00:42:12 +00:00
Takashi Kokubun
57f8dde0f2 [ruby/erb] Version 5.0.1
42f389dc45
2025-05-14 17:10:04 +00:00
Hiroshi SHIBATA
f855bcc6b2
Applied rake vendor:install 2025-05-14 15:13:45 +09:00
Takashi Kokubun
1d3221ad28 [ruby/erb] Give up on using resolve_feature_path
Apparently `$LOAD_PATH.resolve_feature_path('erb/escape')` returns true
for miniruby but `require 'erb/escape'` fails on it.

I still don't want to check it and rescue LoadError at the same time
because the code looks too complicated. Let me just rescue LoadError for
platforms that don't build native extensions.

3081c6b20f
2025-05-13 23:54:02 +00:00
Takashi Kokubun
e8e7daa71a [ruby/erb] Reapply "Refactor the logic of require 'erb/escape'
(https://github.com/ruby/erb/pull/61)"

This reverts commit 1c9200aab0.

Now that we've bumped BASERUBY, we shouldn't need to rescue the
LoadError.

846b20fe0e
2025-05-13 23:31:02 +00:00
Takashi Kokubun
cbaf85cb32 [ruby/erb] Update the reason why we need to rescue LoadError
c2d1f82817
2025-05-13 18:23:04 +00:00