rubygems-update 4.0.0.beta1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd1ea2419f2ef3948df14231dfd3235c479fecfba6bdcf1daacb7dca268dd444
4
- data.tar.gz: 4039fbf0f8cf521d76e0bb3f68e6da28e311805fbad1e4673aac117a994eedf1
3
+ metadata.gz: e3a33e757835b567451e625eb60fd87dc9d40b5710c96f6a548cf493bb930f03
4
+ data.tar.gz: 95b7748028d7563f74e22aac82e4eab9766ba4aca0b29596af58264ac42721e6
5
5
  SHA512:
6
- metadata.gz: 7df7f0a7e27074db3a5d1f8ca9944d0e61f0137f3ea87f4913b72ae0c3a52f1c2f236eaa888d2cb749c3c0dac337360b091c1e264b69836a7d331a4776d77546
7
- data.tar.gz: e76d09561ab310ac1458bc1f28d0b4d59adcc52fbe138e06ba1d4fb9e40b09b6b9d74d40aa336151a4a2eecb1e5a0e195a0a35d3c630c6e869039b0a157c443f
6
+ metadata.gz: 86a9a29465975044bfc0ad313700a2037a3ef33182f905134df80ab09b43bb753ccd5512bc0cdcc4c8838648ed7e01cfa47d9348d3d482d43c6a045584119be4
7
+ data.tar.gz: aaa0136052ccb1ca34cbedc2d45707f34b82820d1b72859c9de97f959b861bddae87e77801a47a50c79f5b5fb3fe2ce56d8fc46c47506646e554629c3bb41cf4
data/CHANGELOG.md CHANGED
@@ -1,37 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## 4.0.0.beta1 / 2025-11-20
4
-
5
- ### Security:
6
-
7
- * Bump up vendored URI to 1.0.4. Pull request
8
- [#9031](https://github.com/ruby/rubygems/pull/9031) by hsbt
9
-
10
- ### Breaking changes:
11
-
12
- * Removed deprecated `-C` option from gem build. Pull request
13
- [#9088](https://github.com/ruby/rubygems/pull/9088) by hsbt
14
- * Removed deprecated Gem::Specification#has_rdoc, has_rdoc= and has_rdoc?.
15
- Pull request [#9084](https://github.com/ruby/rubygems/pull/9084) by hsbt
16
- * Removed deprecated `gem query` command. Pull request
17
- [#9083](https://github.com/ruby/rubygems/pull/9083) by hsbt
18
- * Removed deprecated Gem::DependencyInstaller#find_gems_with_sources. Pull
19
- request [#9082](https://github.com/ruby/rubygems/pull/9082) by hsbt
20
- * Remove deprecated methods of RubyGems. Pull request
21
- [#9081](https://github.com/ruby/rubygems/pull/9081) by hsbt
22
- * Make verification methods private. Pull request
23
- [#9051](https://github.com/ruby/rubygems/pull/9051) by tenderlove
24
- * Deprecate `--default` option from install command. Pull request
25
- [#7588](https://github.com/ruby/rubygems/pull/7588) by hsbt
26
- * Switch to 4.0.0.dev in development version. Pull request
27
- [#9002](https://github.com/ruby/rubygems/pull/9002) by hsbt
28
- * Removed `compatibility.rb` for RG 4.0. Pull request
29
- [#8899](https://github.com/ruby/rubygems/pull/8899) by hsbt
30
-
31
- ### Deprecations:
32
-
33
- * Deprecate `Gem::Specification#datadir`. Pull request
34
- [#8900](https://github.com/ruby/rubygems/pull/8900) by hsbt
3
+ ## 4.0.0 / 2025-12-03
35
4
 
36
5
  ### Features:
37
6
 
@@ -44,6 +13,8 @@
44
13
 
45
14
  ### Performance:
46
15
 
16
+ * Add `MAKEFLAGS=-j` by default before compiling. Pull request
17
+ [#9131](https://github.com/ruby/rubygems/pull/9131) by Edouard-chin
47
18
  * Remove some memoization. Pull request
48
19
  [#9017](https://github.com/ruby/rubygems/pull/9017) by tenderlove
49
20
  * Pull `Gem.win_platform?` out of a hot path. Pull request
@@ -63,13 +34,9 @@
63
34
  [#9089](https://github.com/ruby/rubygems/pull/9089) by hsbt
64
35
  * Removed unused `Gem::Deprecate`. Pull request
65
36
  [#9090](https://github.com/ruby/rubygems/pull/9090) by hsbt
66
- * Test all tests of `make test-all` by ruby core. Pull request
67
- [#9075](https://github.com/ruby/rubygems/pull/9075) by hsbt
68
37
  * Add debug logging information to see the time it took to download and
69
38
  install a gem. Pull request
70
39
  [#9066](https://github.com/ruby/rubygems/pull/9066) by Edouard-chin
71
- * Use `assert_ractor` for testing Ractor. Pull request
72
- [#9069](https://github.com/ruby/rubygems/pull/9069) by hsbt
73
40
  * Fix constants in TAR to be frozen. Pull request
74
41
  [#9041](https://github.com/ruby/rubygems/pull/9041) by tenderlove
75
42
  * Remove open-ended and prerelease dependency warnings when building gems.
@@ -79,16 +46,81 @@
79
46
  [#8753](https://github.com/ruby/rubygems/pull/8753) by cfis
80
47
  * Restrict what schemes are acceptable in the remote fetcher. Pull request
81
48
  [#9022](https://github.com/ruby/rubygems/pull/9022) by tenderlove
49
+ * `gem sources --prepend` and `--append` allow finer grained control of
50
+ sources. Pull request [#8901](https://github.com/ruby/rubygems/pull/8901)
51
+ by martinemde
52
+ * Improve `gem sources --remove` output. Pull request
53
+ [#8909](https://github.com/ruby/rubygems/pull/8909) by deivid-rodriguez
54
+ * Make `gem sources` output more clear. Pull request
55
+ [#8938](https://github.com/ruby/rubygems/pull/8938) by deivid-rodriguez
82
56
  * Don't fail if there is no makefile, simply don't do anything. Pull
83
57
  request [#8879](https://github.com/ruby/rubygems/pull/8879) by ioquatix
84
- * Installs bundler 4.0.0.beta1 as a default gem.
58
+ * Use IMDSv2 for S3 instance credentials. Pull request
59
+ [#7709](https://github.com/ruby/rubygems/pull/7709) by folbricht-stripe
60
+ * Fix regression in presence of RVM gems. Pull request
61
+ [#8854](https://github.com/ruby/rubygems/pull/8854) by deivid-rodriguez
62
+ * Restore parsing "--" as an unknown platform rather than crashing. Pull
63
+ request [#8846](https://github.com/ruby/rubygems/pull/8846) by
64
+ deivid-rodriguez
65
+ * Installs bundler 4.0.0 as a default gem.
66
+
67
+ ### Bug fixes:
68
+
69
+ * Fix test failure of mswin and nmake. Pull request
70
+ [#9135](https://github.com/ruby/rubygems/pull/9135) by hsbt
71
+ * Respect `BUNDLE_VERSION` config at Gem::BundlerVersionFinder. Pull
72
+ request [#9106](https://github.com/ruby/rubygems/pull/9106) by hsbt
73
+ * Fix "did you mean" suggestions for unknown commands. Pull request
74
+ [#8948](https://github.com/ruby/rubygems/pull/8948) by deivid-rodriguez
75
+ * Fix trailing slashes not considered by `gem sources --remove`. Pull
76
+ request [#8939](https://github.com/ruby/rubygems/pull/8939) by
77
+ deivid-rodriguez
78
+
79
+ ### Security:
80
+
81
+ * Bump up vendored URI to 1.0.4. Pull request
82
+ [#9031](https://github.com/ruby/rubygems/pull/9031) by hsbt
83
+
84
+ ### Breaking changes:
85
+
86
+ * Removed deprecated `-C` option from gem build. Pull request
87
+ [#9088](https://github.com/ruby/rubygems/pull/9088) by hsbt
88
+ * Removed deprecated Gem::Specification#has_rdoc, has_rdoc= and has_rdoc?.
89
+ Pull request [#9084](https://github.com/ruby/rubygems/pull/9084) by hsbt
90
+ * Removed deprecated `gem query` command. Pull request
91
+ [#9083](https://github.com/ruby/rubygems/pull/9083) by hsbt
92
+ * Removed deprecated Gem::DependencyInstaller#find_gems_with_sources. Pull
93
+ request [#9082](https://github.com/ruby/rubygems/pull/9082) by hsbt
94
+ * Remove deprecated methods of RubyGems. Pull request
95
+ [#9081](https://github.com/ruby/rubygems/pull/9081) by hsbt
96
+ * Make verification methods private. Pull request
97
+ [#9051](https://github.com/ruby/rubygems/pull/9051) by tenderlove
98
+ * Deprecate `--default` option from install command. Pull request
99
+ [#7588](https://github.com/ruby/rubygems/pull/7588) by hsbt
100
+ * Removed `compatibility.rb` for RG 4.0. Pull request
101
+ [#8899](https://github.com/ruby/rubygems/pull/8899) by hsbt
102
+
103
+ ### Deprecations:
104
+
105
+ * Deprecate `Gem::Specification#datadir`. Pull request
106
+ [#8900](https://github.com/ruby/rubygems/pull/8900) by hsbt
85
107
 
86
108
  ### Documentation:
87
109
 
110
+ * Unified UPGRADING.md and extract blog.rubygems.org. Pull request
111
+ [#9148](https://github.com/ruby/rubygems/pull/9148) by hsbt
112
+ * Remove italic formatting from changelog section headers. Pull request
113
+ [#9128](https://github.com/ruby/rubygems/pull/9128) by hsbt
88
114
  * [DOC] Fix the location of Gem::Deprecate document. Pull request
89
115
  [#9065](https://github.com/ruby/rubygems/pull/9065) by nobu
90
116
  * Fix typo. Pull request
91
117
  [#9012](https://github.com/ruby/rubygems/pull/9012) by etiennebarrie
118
+ * Added document for Gem::Uninstaller. Pull request
119
+ [#8904](https://github.com/ruby/rubygems/pull/8904) by hsbt
120
+ * Use mailto link in Code of Conduct. Pull request
121
+ [#8849](https://github.com/ruby/rubygems/pull/8849) by deivid-rodriguez
122
+ * Update Code of Conduct email to conduct@rubygems.org. Pull request
123
+ [#8848](https://github.com/ruby/rubygems/pull/8848) by indirect
92
124
 
93
125
  ## 3.7.2 / 2025-09-09
94
126
 
data/Manifest.txt CHANGED
@@ -352,10 +352,9 @@ bundler/lib/bundler/vlad.rb
352
352
  bundler/lib/bundler/worker.rb
353
353
  bundler/lib/bundler/yaml_serializer.rb
354
354
  doc/MAINTAINERS.txt
355
- doc/bundler/UPGRADING.md
355
+ doc/UPGRADING.md
356
356
  doc/rubygems/CONTRIBUTING.md
357
357
  doc/rubygems/POLICIES.md
358
- doc/rubygems/UPGRADING.md
359
358
  exe/gem
360
359
  exe/update_rubygems
361
360
  hide_lib_for_update/note.txt
data/README.md CHANGED
@@ -65,7 +65,7 @@ To upgrade to the latest RubyGems, run:
65
65
 
66
66
  $ gem update --system
67
67
 
68
- See [UPGRADING](doc/rubygems/UPGRADING.md) for more details and alternative instructions.
68
+ See [UPGRADING](doc/UPGRADING.md) for more details and alternative instructions.
69
69
 
70
70
  ## Release policy
71
71
 
data/bundler/CHANGELOG.md CHANGED
@@ -1,6 +1,62 @@
1
1
  # Changelog
2
2
 
3
- ## 4.0.0.beta1 (2025-11-20)
3
+ ## 4.0.0 (2025-12-03)
4
+
5
+ ### Features:
6
+
7
+ - Support bundle install --lockfile option [#9111](https://github.com/ruby/rubygems/pull/9111)
8
+ - Add support for lockfile in Gemfile and bundle install --no-lock [#9059](https://github.com/ruby/rubygems/pull/9059)
9
+ - Add `--ext=go` to `bundle gem` [#8183](https://github.com/ruby/rubygems/pull/8183)
10
+ - Update Bundler::CurrentRuby::ALL_RUBY_VERSIONS [#9058](https://github.com/ruby/rubygems/pull/9058)
11
+ - Introduce `bundle list --format=json` [#8728](https://github.com/ruby/rubygems/pull/8728)
12
+
13
+ ### Performance:
14
+
15
+ - Run git operations in parallel to speed things up: [#9100](https://github.com/ruby/rubygems/pull/9100)
16
+ - Replace instance method look up in plugin installer [#9094](https://github.com/ruby/rubygems/pull/9094)
17
+ - Adjust the API_REQUEST_LIMIT to make less network roundtrip [#9071](https://github.com/ruby/rubygems/pull/9071)
18
+
19
+ ### Enhancements:
20
+
21
+ - Make BUNDLE_LOCKFILE environment variable have precedence over lockfile method in Gemfile [#9146](https://github.com/ruby/rubygems/pull/9146)
22
+ - Improve banner message for the default command [#9145](https://github.com/ruby/rubygems/pull/9145)
23
+ - Introduce `install_or_cli_help` and use it default `bundle` command [#9136](https://github.com/ruby/rubygems/pull/9136)
24
+ - Add go_gem/rake_task for Go native extension gem skeleton [#9105](https://github.com/ruby/rubygems/pull/9105)
25
+ - Warn users that `bundle` now display the help: [#9092](https://github.com/ruby/rubygems/pull/9092)
26
+ - Use DidYouMean::SpellChecker for gem suggestions in Bundler [#3857](https://github.com/ruby/rubygems/pull/3857)
27
+ - Update all vendored libraries to latest version [#9089](https://github.com/ruby/rubygems/pull/9089)
28
+ - We don't need to allow some warning now [#9074](https://github.com/ruby/rubygems/pull/9074)
29
+ - Support to embedded Pathname [#9056](https://github.com/ruby/rubygems/pull/9056)
30
+ - Enforce activation of irb when running with bundle console [#9033](https://github.com/ruby/rubygems/pull/9033)
31
+ - Update Magnus version in Rust extension gem template [#9025](https://github.com/ruby/rubygems/pull/9025)
32
+ - Add checksum of gems hosted on private servers: [#9004](https://github.com/ruby/rubygems/pull/9004)
33
+ - Loading support on Windows [#8254](https://github.com/ruby/rubygems/pull/8254)
34
+ - Improve error message when the same source is specified through `gemspec` and `path` [#8460](https://github.com/ruby/rubygems/pull/8460)
35
+ - Raise an error in frozen mode if some registry gems have empty checksums [#8888](https://github.com/ruby/rubygems/pull/8888)
36
+ - Bump vendored thor to 1.4.0 [#8883](https://github.com/ruby/rubygems/pull/8883)
37
+ - Delay default path and global cache changes to Bundler 5 [#8867](https://github.com/ruby/rubygems/pull/8867)
38
+ - Fix spacing in bundle gem newgem.gemspec.tt [#8865](https://github.com/ruby/rubygems/pull/8865)
39
+ - Add some missing deprecation messages [#8844](https://github.com/ruby/rubygems/pull/8844)
40
+
41
+ ### Bug fixes:
42
+
43
+ - Fixed checksums generation issue when no source is specified [#9133](https://github.com/ruby/rubygems/pull/9133)
44
+ - Check for file existence before deletion from cache [#9095](https://github.com/ruby/rubygems/pull/9095)
45
+ - Use method_defined?(:method, false) [#9098](https://github.com/ruby/rubygems/pull/9098)
46
+ - Handle BUNDLER_VERSION being set to an empty string [#6928](https://github.com/ruby/rubygems/pull/6928)
47
+ - Fix `bundle install` when the Gemfile contains "install_if" git gems: [#8992](https://github.com/ruby/rubygems/pull/8992)
48
+ - Fix installation issue related to path sources and precompiled gems [#8973](https://github.com/ruby/rubygems/pull/8973)
49
+ - Fix outdated lockfile during `bundle lock` when source changes [#8962](https://github.com/ruby/rubygems/pull/8962)
50
+ - Raise error on missing version file [#8963](https://github.com/ruby/rubygems/pull/8963)
51
+ - Fix `bundle cache --frozen` and `bundle cache --no-prune` not printing a deprecation message [#8926](https://github.com/ruby/rubygems/pull/8926)
52
+ - Fix local installation incorrectly forced if there's a `vendor/cache` directory and frozen mode is set [#8925](https://github.com/ruby/rubygems/pull/8925)
53
+ - Fix `bundle lock --update <gem>` with `--lockfile` flag updating all gems [#8922](https://github.com/ruby/rubygems/pull/8922)
54
+ - Fix `bundle show --verbose` and recommend it as an alternative to `bundle show --outdated` [#8915](https://github.com/ruby/rubygems/pull/8915)
55
+ - Fix `bundle cache --no-all` not printing a deprecation warning [#8912](https://github.com/ruby/rubygems/pull/8912)
56
+ - Fix `bundle update foo` unable to update foo in an edge case [#8897](https://github.com/ruby/rubygems/pull/8897)
57
+ - Fix Bundler printing more flags than actually passed in verbose mode [#8914](https://github.com/ruby/rubygems/pull/8914)
58
+ - Fix bundler failing to install sorbet-static in truffleruby when there's no lockfile [#8872](https://github.com/ruby/rubygems/pull/8872)
59
+ - Cancel deprecation of `--force` flag to `bundle install` and `bundle update` [#8843](https://github.com/ruby/rubygems/pull/8843)
4
60
 
5
61
  ### Security:
6
62
 
@@ -14,14 +70,12 @@
14
70
  - Pick and add extra changes for 4.0.0 version [#9018](https://github.com/ruby/rubygems/pull/9018)
15
71
  - Replaced Bundler::SharedHelpers.major_deprecation to feature_removed! or feature_deprecated! [#9016](https://github.com/ruby/rubygems/pull/9016)
16
72
  - Removed legacy_check option from SpecSet#for [#9015](https://github.com/ruby/rubygems/pull/9015)
17
- - Removed deprecated legacy windows platform support [#9013](https://github.com/ruby/rubygems/pull/9013)
18
73
  - Make update_requires_all_flag to settings [#9011](https://github.com/ruby/rubygems/pull/9011)
19
74
  - Make default cli command settings [#9010](https://github.com/ruby/rubygems/pull/9010)
20
75
  - Make global_gem_cache flag to settings [#9009](https://github.com/ruby/rubygems/pull/9009)
21
76
  - Consolidate removal of `Bundler.rubygems.all_specs` [#9008](https://github.com/ruby/rubygems/pull/9008)
22
77
  - Consolidate removal of `Bundler::SpecSet#-` and `Bundler::SpecSet#<<` [#9007](https://github.com/ruby/rubygems/pull/9007)
23
78
  - Replaced Bundler.feature_flag.plugins? to Bundler.settings [#9006](https://github.com/ruby/rubygems/pull/9006)
24
- - Switch to 4.0.0.dev in development version [#9002](https://github.com/ruby/rubygems/pull/9002)
25
79
  - Make `bundle show --outdated` raise an error [#8980](https://github.com/ruby/rubygems/pull/8980)
26
80
  - Make `--local-git` flag to `bundle plugin install` raise an error [#8979](https://github.com/ruby/rubygems/pull/8979)
27
81
  - Switch `cache_all` to be `true` by default [#8975](https://github.com/ruby/rubygems/pull/8975)
@@ -38,40 +92,17 @@
38
92
  - Remove deprecated `bundle viz` and `bundle inject` commands [#8923](https://github.com/ruby/rubygems/pull/8923)
39
93
  - Removed to workaround for Bundler 2.2 [#8903](https://github.com/ruby/rubygems/pull/8903)
40
94
 
41
- ### Features:
42
-
43
- - Update Bundler::CurrentRuby::ALL_RUBY_VERSIONS [#9058](https://github.com/ruby/rubygems/pull/9058)
44
- - Introduce `bundle list --format=json` [#8728](https://github.com/ruby/rubygems/pull/8728)
45
-
46
- ### Performance:
47
-
48
- - Replace instance method look up in plugin installer [#9094](https://github.com/ruby/rubygems/pull/9094)
49
- - Adjust the API_REQUEST_LIMIT to make less network roundtrip [#9071](https://github.com/ruby/rubygems/pull/9071)
50
-
51
- ### Enhancements:
52
-
53
- - Use DidYouMean::SpellChecker for gem suggestions in Bundler [#3857](https://github.com/ruby/rubygems/pull/3857)
54
- - Update all vendored libraries to latest version [#9089](https://github.com/ruby/rubygems/pull/9089)
55
- - We don't need to allow some warning now [#9074](https://github.com/ruby/rubygems/pull/9074)
56
- - Shell out fewer times [#9068](https://github.com/ruby/rubygems/pull/9068)
57
- - Build gems directly instead of shelling out [#9053](https://github.com/ruby/rubygems/pull/9053)
58
- - Support to embedded Pathname [#9056](https://github.com/ruby/rubygems/pull/9056)
59
- - Forcely activate irb when running with bundle console [#9033](https://github.com/ruby/rubygems/pull/9033)
60
- - Update Magnus version in Rust extension gem template [#9025](https://github.com/ruby/rubygems/pull/9025)
61
- - Postpone to remove legacy mingw platform [#9023](https://github.com/ruby/rubygems/pull/9023)
62
- - Add checksum of gems hosted on private servers: [#9004](https://github.com/ruby/rubygems/pull/9004)
63
- - Loading support on Windows [#8254](https://github.com/ruby/rubygems/pull/8254)
64
-
65
- ### Bug fixes:
66
-
67
- - Fix `bundle install` when the Gemfile contains "install_if" git gems: [#8992](https://github.com/ruby/rubygems/pull/8992)
68
- - Fix installation issue related to path sources and precompiled gems [#8973](https://github.com/ruby/rubygems/pull/8973)
69
- - Fix outdated lockfile during `bundle lock` when source changes [#8962](https://github.com/ruby/rubygems/pull/8962)
70
- - Raise error on missing version file [#8963](https://github.com/ruby/rubygems/pull/8963)
71
-
72
95
  ### Documentation:
73
96
 
97
+ - Unified UPGRADING.md and extract blog.rubygems.org [#9148](https://github.com/ruby/rubygems/pull/9148)
98
+ - Remove italic formatting from changelog section headers [#9128](https://github.com/ruby/rubygems/pull/9128)
74
99
  - Small clarifications to Bundler 4 upgrade docs [#8964](https://github.com/ruby/rubygems/pull/8964)
100
+ - Improve documentation of `bundle doctor`, `bundle plugin`, and `bundle config` [#8919](https://github.com/ruby/rubygems/pull/8919)
101
+ - Make sure all CLI flags and subcommands are documented [#8861](https://github.com/ruby/rubygems/pull/8861)
102
+ - Clarify documentation about new default gem installation directory in Bundler 4 [#8857](https://github.com/ruby/rubygems/pull/8857)
103
+ - Use mailto link in Code of Conduct [#8849](https://github.com/ruby/rubygems/pull/8849)
104
+ - Update Code of Conduct email to conduct@rubygems.org [#8848](https://github.com/ruby/rubygems/pull/8848)
105
+ - Add missing link to `irb` repo in DEBUGGING.md [#8842](https://github.com/ruby/rubygems/pull/8842)
75
106
 
76
107
  ## 2.7.2 (2025-09-09)
77
108
 
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2025-11-20".freeze
8
- @git_commit_sha = "9be811c01a".freeze
7
+ @built_at = "2025-12-03".freeze
8
+ @git_commit_sha = "64d0dfe695".freeze
9
9
  # end ivars
10
10
 
11
11
  # A hash representation of the build metadata.
@@ -44,6 +44,8 @@ module Bundler
44
44
  # (rather than some optimizations we perform at app runtime).
45
45
  definition = Bundler.definition(strict: true)
46
46
  definition.validate_runtime!
47
+ definition.lockfile = options["lockfile"] if options["lockfile"]
48
+ definition.lockfile = false if options["no-lock"]
47
49
 
48
50
  installer = Installer.install(Bundler.root, definition, options)
49
51
 
@@ -59,17 +59,29 @@ module Bundler
59
59
  def initialize(*args)
60
60
  super
61
61
 
62
+ current_cmd = args.last[:current_command].name
63
+
62
64
  custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
63
65
  if custom_gemfile && !custom_gemfile.empty?
64
66
  Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
65
- Bundler.reset_settings_and_root!
67
+ reset_settings = true
68
+ end
69
+
70
+ # lock --lockfile works differently than install --lockfile
71
+ unless current_cmd == "lock"
72
+ custom_lockfile = options[:lockfile] || ENV["BUNDLE_LOCKFILE"] || Bundler.settings[:lockfile]
73
+ if custom_lockfile && !custom_lockfile.empty?
74
+ Bundler::SharedHelpers.set_env "BUNDLE_LOCKFILE", File.expand_path(custom_lockfile)
75
+ reset_settings = true
76
+ end
66
77
  end
67
78
 
79
+ Bundler.reset_settings_and_root! if reset_settings
80
+
68
81
  Bundler.auto_switch
69
82
 
70
83
  Bundler.settings.set_command_option_if_given :retry, options[:retry]
71
84
 
72
- current_cmd = args.last[:current_command].name
73
85
  Bundler.auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
74
86
  rescue UnknownArgumentError => e
75
87
  raise InvalidOption, e.message
@@ -108,20 +120,28 @@ module Bundler
108
120
  self.class.send(:class_options_help, shell)
109
121
  end
110
122
 
123
+ desc "install_or_cli_help", "Tries to run bundle install but prints a summary of bundler commands if there is no Gemfile", hide: true
124
+ def install_or_cli_help
125
+ invoke_other_command("install")
126
+ rescue GemfileNotFound => error
127
+ Bundler.ui.error error.message, wrap: true
128
+ invoke_other_command("cli_help")
129
+ end
130
+
111
131
  def self.default_command(meth = nil)
112
132
  return super if meth
113
133
 
114
- default_cli_command = Bundler.settings[:default_cli_command]
115
- return default_cli_command if default_cli_command
116
-
117
- Bundler.ui.warn(<<~MSG)
118
- In the next version of Bundler, running `bundle` without argument will no longer run `bundle install`.
119
- Instead, the `help` command will be displayed.
120
-
121
- If you'd like to keep the previous behaviour please run `bundle config set default_cli_command install --global`.
122
- MSG
134
+ unless Bundler.settings[:default_cli_command]
135
+ Bundler.ui.info <<-MSG
136
+ In a future version of Bundler, running `bundle` without argument will no longer run `bundle install`.
137
+ Instead, the `cli_help` command will be displayed. Please use `bundle install` explicitly for scripts like CI/CD.
138
+ You can use the future behavior now with `bundle config set default_cli_command cli_help --global`,
139
+ or you can continue to use the current behavior with `bundle config set default_cli_command install_or_cli_help --global`.
140
+ This message will be removed after a default_cli_command value is set.
141
+ MSG
142
+ end
123
143
 
124
- "install"
144
+ Bundler.settings[:default_cli_command] || "install_or_cli_help"
125
145
  end
126
146
 
127
147
  class_option "no-color", type: :boolean, desc: "Disable colorization in output"
@@ -232,8 +252,10 @@ module Bundler
232
252
  method_option "gemfile", type: :string, banner: "Use the specified gemfile instead of Gemfile"
233
253
  method_option "jobs", aliases: "-j", type: :numeric, banner: "Specify the number of jobs to run in parallel"
234
254
  method_option "local", type: :boolean, banner: "Do not attempt to fetch gems remotely and use the gem cache instead"
255
+ method_option "lockfile", type: :string, banner: "Use the specified lockfile instead of the default."
235
256
  method_option "prefer-local", type: :boolean, banner: "Only attempt to fetch gems remotely if not present locally, even if newer versions are available remotely"
236
257
  method_option "no-cache", type: :boolean, banner: "Don't update the existing gem cache."
258
+ method_option "no-lock", type: :boolean, banner: "Don't create a lockfile."
237
259
  method_option "force", type: :boolean, aliases: "--redownload", banner: "Force reinstalling every gem, even if already installed"
238
260
  method_option "no-prune", type: :boolean, banner: "Don't remove stale gems from the cache (removed)."
239
261
  method_option "path", type: :string, banner: "Specify a different path than the system default, namely, $BUNDLE_PATH or $GEM_HOME (removed)."
@@ -260,8 +282,10 @@ module Bundler
260
282
  end
261
283
 
262
284
  require_relative "cli/install"
285
+ options = self.options.dup
286
+ options["lockfile"] ||= ENV["BUNDLE_LOCKFILE"]
263
287
  Bundler.settings.temporary(no_install: false) do
264
- Install.new(options.dup).run
288
+ Install.new(options).run
265
289
  end
266
290
  end
267
291
 
@@ -709,6 +733,19 @@ module Bundler
709
733
  config[:current_command]
710
734
  end
711
735
 
736
+ def invoke_other_command(name)
737
+ _, _, config = @_initializer
738
+ original_command = config[:current_command]
739
+ command = self.class.all_commands[name]
740
+ config[:current_command] = command
741
+ send(name)
742
+ ensure
743
+ config[:current_command] = original_command
744
+ end
745
+
746
+ def current_command=(command)
747
+ end
748
+
712
749
  def print_command
713
750
  return unless Bundler.ui.debug?
714
751
  cmd = current_command
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "lockfile_parser"
4
+ require_relative "worker"
4
5
 
5
6
  module Bundler
6
7
  class Definition
@@ -9,6 +10,8 @@ module Bundler
9
10
  attr_accessor :no_lock
10
11
  end
11
12
 
13
+ attr_writer :lockfile
14
+
12
15
  attr_reader(
13
16
  :dependencies,
14
17
  :locked_checksums,
@@ -379,7 +382,7 @@ module Bundler
379
382
  end
380
383
 
381
384
  def write_lock(file, preserve_unknown_sections)
382
- return if Definition.no_lock || file.nil?
385
+ return if Definition.no_lock || !lockfile || file.nil?
383
386
 
384
387
  contents = to_lock
385
388
 
@@ -536,6 +539,8 @@ module Bundler
536
539
  end
537
540
 
538
541
  def add_checksums
542
+ require "rubygems/package"
543
+
539
544
  @locked_checksums = true
540
545
 
541
546
  setup_domain!(add_checksums: true)
@@ -1100,7 +1105,23 @@ module Bundler
1100
1105
  @source_requirements ||= find_source_requirements
1101
1106
  end
1102
1107
 
1108
+ def preload_git_source_worker
1109
+ @preload_git_source_worker ||= Bundler::Worker.new(5, "Git source preloading", ->(source, _) { source.specs })
1110
+ end
1111
+
1112
+ def preload_git_sources
1113
+ sources.git_sources.each {|source| preload_git_source_worker.enq(source) }
1114
+ ensure
1115
+ preload_git_source_worker.stop
1116
+ end
1117
+
1103
1118
  def find_source_requirements
1119
+ if Gem.ruby_version >= Gem::Version.new("3.3")
1120
+ # Ruby 3.2 has a bug that incorrectly triggers a circular dependency warning. This version will continue to
1121
+ # fetch git repositories one by one.
1122
+ preload_git_sources
1123
+ end
1124
+
1104
1125
  # Record the specs available in each gem's source, so that those
1105
1126
  # specs will be available later when the resolver knows where to
1106
1127
  # look for that gemspec (or its dependencies)
@@ -9,8 +9,9 @@ module Bundler
9
9
 
10
10
  def self.evaluate(gemfile, lockfile, unlock)
11
11
  builder = new
12
+ builder.lockfile(lockfile)
12
13
  builder.eval_gemfile(gemfile)
13
- builder.to_definition(lockfile, unlock)
14
+ builder.to_definition(builder.lockfile_path, unlock)
14
15
  end
15
16
 
16
17
  VALID_PLATFORMS = Bundler::CurrentRuby::PLATFORM_MAP.keys.freeze
@@ -38,6 +39,7 @@ module Bundler
38
39
  @gemspecs = []
39
40
  @gemfile = nil
40
41
  @gemfiles = []
42
+ @lockfile = nil
41
43
  add_git_sources
42
44
  end
43
45
 
@@ -101,6 +103,15 @@ module Bundler
101
103
  add_dependency(name, version, options)
102
104
  end
103
105
 
106
+ # For usage in Dsl.evaluate, since lockfile is used as part of the Gemfile.
107
+ def lockfile_path
108
+ @lockfile
109
+ end
110
+
111
+ def lockfile(file)
112
+ @lockfile = file
113
+ end
114
+
104
115
  def source(source, *args, &blk)
105
116
  options = args.last.is_a?(Hash) ? args.pop.dup : {}
106
117
  options = normalize_hash(options)
@@ -175,6 +186,7 @@ module Bundler
175
186
 
176
187
  def to_definition(lockfile, unlock)
177
188
  check_primary_source_safety
189
+ lockfile = @lockfile unless @lockfile.nil?
178
190
  Definition.new(lockfile, @dependencies, @sources, unlock, @ruby_version, @optional_groups, @gemfiles)
179
191
  end
180
192
 
@@ -415,8 +427,8 @@ module Bundler
415
427
  windows_platforms = platforms.select {|pl| pl.to_s.match?(/mingw|mswin/) }
416
428
  if windows_platforms.any?
417
429
  windows_platforms = windows_platforms.map! {|pl| ":#{pl}" }.join(", ")
418
- removed_message = "Platform #{windows_platforms} has been removed. Please use platform :windows instead."
419
- Bundler::SharedHelpers.feature_removed! removed_message
430
+ deprecated_message = "Platform #{windows_platforms} will be removed in the future. Please use platform :windows instead."
431
+ Bundler::SharedHelpers.feature_deprecated! deprecated_message
420
432
  end
421
433
 
422
434
  # Save sources passed in a key
@@ -6,6 +6,7 @@ module Bundler
6
6
  BUNDLER_KEYS = %w[
7
7
  BUNDLE_BIN_PATH
8
8
  BUNDLE_GEMFILE
9
+ BUNDLE_LOCKFILE
9
10
  BUNDLER_VERSION
10
11
  BUNDLER_SETUP
11
12
  GEM_HOME
@@ -44,12 +44,14 @@ def gemfile(force_latest_compatible = false, options = {}, &gemfile)
44
44
  raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
45
45
 
46
46
  old_gemfile = ENV["BUNDLE_GEMFILE"]
47
+ old_lockfile = ENV["BUNDLE_LOCKFILE"]
47
48
 
48
49
  Bundler.unbundle_env!
49
50
 
50
51
  begin
51
52
  Bundler.instance_variable_set(:@bundle_path, Pathname.new(Gem.dir))
52
53
  Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", "Gemfile"
54
+ Bundler::SharedHelpers.set_env "BUNDLE_LOCKFILE", "Gemfile.lock"
53
55
 
54
56
  Bundler::Plugin.gemfile_install(&gemfile) if Bundler.settings[:plugins]
55
57
  builder = Bundler::Dsl.new
@@ -94,5 +96,11 @@ def gemfile(force_latest_compatible = false, options = {}, &gemfile)
94
96
  else
95
97
  ENV["BUNDLE_GEMFILE"] = ""
96
98
  end
99
+
100
+ if old_lockfile
101
+ ENV["BUNDLE_LOCKFILE"] = old_lockfile
102
+ else
103
+ ENV["BUNDLE_LOCKFILE"] = ""
104
+ end
97
105
  end
98
106
  end
@@ -145,6 +145,9 @@ Generate a \fBgems\.rb\fR instead of a \fBGemfile\fR when running \fBbundle init
145
145
  \fBjobs\fR (\fBBUNDLE_JOBS\fR)
146
146
  The number of gems Bundler can install in parallel\. Defaults to the number of available processors\.
147
147
  .TP
148
+ \fBlockfile\fR (\fBBUNDLE_LOCKFILE\fR)
149
+ The path to the lockfile that bundler should use\. By default, Bundler adds \fB\.lock\fR to the end of the \fBgemfile\fR entry\. Can be set to \fBfalse\fR in the Gemfile to disable lockfile creation entirely (see gemfile(5))\.
150
+ .TP
148
151
  \fBlockfile_checksums\fR (\fBBUNDLE_LOCKFILE_CHECKSUMS\fR)
149
152
  Whether Bundler should include a checksums section in new lockfiles, to protect from compromised gem sources\. Defaults to true\.
150
153
  .TP
@@ -189,6 +189,10 @@ learn more about their operation in [bundle install(1)](bundle-install.1.html).
189
189
  * `jobs` (`BUNDLE_JOBS`):
190
190
  The number of gems Bundler can install in parallel. Defaults to the number of
191
191
  available processors.
192
+ * `lockfile` (`BUNDLE_LOCKFILE`):
193
+ The path to the lockfile that bundler should use. By default, Bundler adds
194
+ `.lock` to the end of the `gemfile` entry. Can be set to `false` in the
195
+ Gemfile to disable lockfile creation entirely (see gemfile(5)).
192
196
  * `lockfile_checksums` (`BUNDLE_LOCKFILE_CHECKSUMS`):
193
197
  Whether Bundler should include a checksums section in new lockfiles, to protect from compromised gem sources. Defaults to true.
194
198
  * `no_install` (`BUNDLE_NO_INSTALL`):
@@ -4,7 +4,7 @@
4
4
  .SH "NAME"
5
5
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
6
6
  .SH "SYNOPSIS"
7
- \fBbundle install\fR [\-\-force] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-local] [\-\-no\-cache] [\-\-prefer\-local] [\-\-quiet] [\-\-retry=NUMBER] [\-\-standalone[=GROUP[ GROUP\|\.\|\.\|\.]]] [\-\-trust\-policy=TRUST\-POLICY] [\-\-target\-rbconfig=TARGET\-RBCONFIG]
7
+ \fBbundle install\fR [\-\-force] [\-\-full\-index] [\-\-gemfile=GEMFILE] [\-\-jobs=NUMBER] [\-\-local] [\-\-lockfile=LOCKFILE] [\-\-no\-cache] [\-\-no\-lock] [\-\-prefer\-local] [\-\-quiet] [\-\-retry=NUMBER] [\-\-standalone[=GROUP[ GROUP\|\.\|\.\|\.]]] [\-\-trust\-policy=TRUST\-POLICY] [\-\-target\-rbconfig=TARGET\-RBCONFIG]
8
8
  .SH "DESCRIPTION"
9
9
  Install the gems specified in your Gemfile(5)\. If this is the first time you run bundle install (and a \fBGemfile\.lock\fR does not exist), Bundler will fetch all remote sources, resolve dependencies and install all needed gems\.
10
10
  .P
@@ -28,12 +28,20 @@ The maximum number of parallel download and install jobs\. The default is the nu
28
28
  \fB\-\-local\fR
29
29
  Do not attempt to connect to \fBrubygems\.org\fR\. Instead, Bundler will use the gems already present in Rubygems' cache or in \fBvendor/cache\fR\. Note that if an appropriate platform\-specific gem exists on \fBrubygems\.org\fR it will not be found\.
30
30
  .TP
31
+ \fB\-\-lockfile=LOCKFILE\fR
32
+ The location of the lockfile which Bundler should use\. This defaults to the Gemfile location with \fB\.lock\fR appended\.
33
+ .TP
31
34
  \fB\-\-prefer\-local\fR
32
35
  Force using locally installed gems, or gems already present in Rubygems' cache or in \fBvendor/cache\fR, when resolving, even if newer versions are available remotely\. Only attempt to connect to \fBrubygems\.org\fR for gems that are not present locally\.
33
36
  .TP
34
37
  \fB\-\-no\-cache\fR
35
38
  Do not update the cache in \fBvendor/cache\fR with the newly bundled gems\. This does not remove any gems in the cache but keeps the newly bundled gems from being cached during the install\.
36
39
  .TP
40
+ \fB\-\-no\-lock\fR
41
+ Do not create a lockfile\. Useful if you want to install dependencies but not lock versions of gems\. Recommended for library development, and other situations where the code is expected to work with a range of dependency versions\.
42
+ .IP
43
+ This has the same effect as using \fBlockfile false\fR in the Gemfile\. See gemfile(5) for more information\.
44
+ .TP
37
45
  \fB\-\-quiet\fR
38
46
  Do not print progress information to the standard output\.
39
47
  .TP