bundler 2.6.2 → 2.6.6

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.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +91 -0
  3. data/README.md +2 -2
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/checksum.rb +1 -1
  6. data/lib/bundler/cli/console.rb +8 -6
  7. data/lib/bundler/cli/doctor.rb +23 -19
  8. data/lib/bundler/cli/info.rb +4 -4
  9. data/lib/bundler/cli/inject.rb +2 -2
  10. data/lib/bundler/cli/issue.rb +1 -1
  11. data/lib/bundler/cli/lock.rb +2 -1
  12. data/lib/bundler/cli/outdated.rb +6 -4
  13. data/lib/bundler/cli/show.rb +1 -1
  14. data/lib/bundler/compact_index_client/updater.rb +2 -1
  15. data/lib/bundler/current_ruby.rb +23 -33
  16. data/lib/bundler/definition.rb +125 -112
  17. data/lib/bundler/dependency.rb +92 -47
  18. data/lib/bundler/dsl.rb +83 -78
  19. data/lib/bundler/endpoint_specification.rb +10 -3
  20. data/lib/bundler/errors.rb +22 -0
  21. data/lib/bundler/feature_flag.rb +2 -6
  22. data/lib/bundler/gem_helpers.rb +4 -10
  23. data/lib/bundler/gem_version_promoter.rb +0 -2
  24. data/lib/bundler/injector.rb +9 -9
  25. data/lib/bundler/installer.rb +16 -2
  26. data/lib/bundler/lazy_specification.rb +50 -45
  27. data/lib/bundler/man/bundle-add.1 +3 -3
  28. data/lib/bundler/man/bundle-binstubs.1 +3 -3
  29. data/lib/bundler/man/bundle-cache.1 +3 -3
  30. data/lib/bundler/man/bundle-check.1 +3 -3
  31. data/lib/bundler/man/bundle-clean.1 +3 -3
  32. data/lib/bundler/man/bundle-config.1 +8 -8
  33. data/lib/bundler/man/bundle-config.1.ronn +9 -4
  34. data/lib/bundler/man/bundle-console.1 +3 -3
  35. data/lib/bundler/man/bundle-doctor.1 +3 -3
  36. data/lib/bundler/man/bundle-env.1 +3 -3
  37. data/lib/bundler/man/bundle-exec.1 +5 -5
  38. data/lib/bundler/man/bundle-exec.1.ronn +2 -2
  39. data/lib/bundler/man/bundle-fund.1 +3 -3
  40. data/lib/bundler/man/bundle-gem.1 +3 -3
  41. data/lib/bundler/man/bundle-help.1 +3 -3
  42. data/lib/bundler/man/bundle-info.1 +3 -3
  43. data/lib/bundler/man/bundle-init.1 +3 -3
  44. data/lib/bundler/man/bundle-inject.1 +3 -3
  45. data/lib/bundler/man/bundle-install.1 +3 -3
  46. data/lib/bundler/man/bundle-issue.1 +3 -3
  47. data/lib/bundler/man/bundle-licenses.1 +3 -3
  48. data/lib/bundler/man/bundle-list.1 +3 -3
  49. data/lib/bundler/man/bundle-lock.1 +3 -3
  50. data/lib/bundler/man/bundle-open.1 +3 -3
  51. data/lib/bundler/man/bundle-outdated.1 +3 -3
  52. data/lib/bundler/man/bundle-platform.1 +3 -3
  53. data/lib/bundler/man/bundle-plugin.1 +3 -3
  54. data/lib/bundler/man/bundle-pristine.1 +3 -3
  55. data/lib/bundler/man/bundle-remove.1 +3 -3
  56. data/lib/bundler/man/bundle-show.1 +3 -3
  57. data/lib/bundler/man/bundle-update.1 +3 -3
  58. data/lib/bundler/man/bundle-version.1 +3 -3
  59. data/lib/bundler/man/bundle-viz.1 +3 -3
  60. data/lib/bundler/man/bundle.1 +3 -3
  61. data/lib/bundler/man/gemfile.5 +3 -3
  62. data/lib/bundler/match_metadata.rb +13 -0
  63. data/lib/bundler/plugin/index.rb +5 -1
  64. data/lib/bundler/resolver/base.rb +2 -1
  65. data/lib/bundler/resolver/candidate.rb +11 -8
  66. data/lib/bundler/resolver/package.rb +8 -4
  67. data/lib/bundler/resolver/spec_group.rb +1 -25
  68. data/lib/bundler/resolver.rb +14 -4
  69. data/lib/bundler/ruby_dsl.rb +12 -3
  70. data/lib/bundler/rubygems_ext.rb +82 -81
  71. data/lib/bundler/rubygems_integration.rb +2 -15
  72. data/lib/bundler/runtime.rb +19 -24
  73. data/lib/bundler/shared_helpers.rb +4 -0
  74. data/lib/bundler/source/git/git_proxy.rb +6 -0
  75. data/lib/bundler/source/git.rb +6 -1
  76. data/lib/bundler/source/rubygems/remote.rb +11 -3
  77. data/lib/bundler/source/rubygems.rb +19 -4
  78. data/lib/bundler/source.rb +2 -0
  79. data/lib/bundler/source_list.rb +4 -0
  80. data/lib/bundler/spec_set.rb +66 -29
  81. data/lib/bundler/templates/newgem/Gemfile.tt +1 -0
  82. data/lib/bundler/vendor/uri/lib/uri/common.rb +7 -3
  83. data/lib/bundler/vendor/uri/lib/uri/generic.rb +12 -11
  84. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +6 -6
  85. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  86. data/lib/bundler/version.rb +1 -1
  87. data/lib/bundler.rb +10 -30
  88. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3728802be4074809ca22f929200d5a37e70e6fc4ce6a2c532724240965347b2
4
- data.tar.gz: 02ce39fa7358e3ec4923893aa1760f27963a1620b0e62e1b304305d72a1587de
3
+ metadata.gz: 04be45da6f2c0f4d36af4bbed990919e3fafcba6d1ae0f29adff18b814bbd343
4
+ data.tar.gz: 4b2dc4d27575de59e07cfe3cbb397248c60288b0da5a3f857ef5f2ad738b46b9
5
5
  SHA512:
6
- metadata.gz: fe1caf39624053f3acd53633ac14621bc3b65fa2aa59eadca1e530fd44207bcd4a4f383fc6624ba6bb3b6663e1067ae278ed43c44a44da2434bb1c3aa6da890b
7
- data.tar.gz: 7d992c1527acea98a361fb315f201c73e01efed2034a3f6ba61004be4f722841aac5b61cb629a45c0d55d088b199a681e3288f359eb652a6c12cb2db697f1ac7
6
+ metadata.gz: a1f8470b8caa25f59bdef6c9a62b938292b6e8dc2a1799c93971f931e774aee8c766dc503007900dbd8e743a6396dad8803ea92f6d47261fb82748d46705d865
7
+ data.tar.gz: 50c0f2dabb906fe79566eea2024f1c346469026ae57936cc1c0c4d4bbaeab0321e0261c82128ad2c36985f998dbc0db21f1311c4bef2fb097ecd24d641136450
data/CHANGELOG.md CHANGED
@@ -1,3 +1,94 @@
1
+ # 2.6.6 (March 13, 2025)
2
+
3
+ ## Enhancements:
4
+
5
+ - Fix `ENAMETOOLONG` error when creating compact index cache [#5578](https://github.com/rubygems/rubygems/pull/5578)
6
+ - Use shorthand hash syntax for bundle add [#8547](https://github.com/rubygems/rubygems/pull/8547)
7
+ - Update vendored uri to 1.0.3 [#8534](https://github.com/rubygems/rubygems/pull/8534)
8
+ - Retry gracefully on blank partial response in compact index [#8524](https://github.com/rubygems/rubygems/pull/8524)
9
+ - Give a better error when trying to write the lock file on a read-only filesystem [#5920](https://github.com/rubygems/rubygems/pull/5920)
10
+ - Improve log messages when lockfile platforms are added [#8523](https://github.com/rubygems/rubygems/pull/8523)
11
+ - Allow noop `bundle install` to work on read-only or protected folders [#8519](https://github.com/rubygems/rubygems/pull/8519)
12
+
13
+ ## Bug fixes:
14
+
15
+ - Detect partial gem installs from a git source so that they are reinstalled on a successive run [#8539](https://github.com/rubygems/rubygems/pull/8539)
16
+ - Modify `bundle doctor` to not report issue when files aren't writable [#8520](https://github.com/rubygems/rubygems/pull/8520)
17
+
18
+ ## Performance:
19
+
20
+ - Optimize resolution by removing an array allocation from `Candidate#<=>` [#8559](https://github.com/rubygems/rubygems/pull/8559)
21
+
22
+ ## Documentation:
23
+
24
+ - Update docs for with/without consistency [#8555](https://github.com/rubygems/rubygems/pull/8555)
25
+ - Recommend non-deprecated methods in `bundle exec` documentation [#8537](https://github.com/rubygems/rubygems/pull/8537)
26
+ - Hint about default group when using `only` configuration option [#8536](https://github.com/rubygems/rubygems/pull/8536)
27
+
28
+ # 2.6.5 (February 20, 2025)
29
+
30
+ ## Enhancements:
31
+
32
+ - Fix lockfile platforms inconveniently added on JRuby [#8494](https://github.com/rubygems/rubygems/pull/8494)
33
+
34
+ ## Bug fixes:
35
+
36
+ - Fix resolver issue due to ill-defined version ranges being created [#8503](https://github.com/rubygems/rubygems/pull/8503)
37
+ - Make sure empty gems are not reinstalled every time [#8502](https://github.com/rubygems/rubygems/pull/8502)
38
+
39
+ # 2.6.4 (February 17, 2025)
40
+
41
+ ## Enhancements:
42
+
43
+ - Make Bundler never instantiate development dependencies [#8486](https://github.com/rubygems/rubygems/pull/8486)
44
+ - Fix some invalid options to `gem` DSL not getting reported as invalid [#8480](https://github.com/rubygems/rubygems/pull/8480)
45
+ - Add `irb` to a Gemfile for a newly created gem [#8467](https://github.com/rubygems/rubygems/pull/8467)
46
+ - Auto-heal empty installation directory [#8457](https://github.com/rubygems/rubygems/pull/8457)
47
+ - Fix `bundle console` unnecessarily trying to load IRB twice [#8443](https://github.com/rubygems/rubygems/pull/8443)
48
+ - Add ruby_34 and ruby_35 as valid platform: [#8430](https://github.com/rubygems/rubygems/pull/8430)
49
+ - Consider gems under `platform: :windows` filter in Gemfile when running on Windows with ARM architecture [#8428](https://github.com/rubygems/rubygems/pull/8428)
50
+
51
+ ## Bug fixes:
52
+
53
+ - Fix regression when running `bundle update <foo>` would sometimes downgrade a top level dependency [#8491](https://github.com/rubygems/rubygems/pull/8491)
54
+ - Fix dependency locking when Bundler finds incorrect lockfile dependencies [#8489](https://github.com/rubygems/rubygems/pull/8489)
55
+ - Raise error when lockfile is missing deps in frozen mode [#8483](https://github.com/rubygems/rubygems/pull/8483)
56
+ - Fix `bundle install --prefer-local` sometimes installing very old versions [#8484](https://github.com/rubygems/rubygems/pull/8484)
57
+ - Fix incorrect error message when running `bundle update` in frozen mode [#8481](https://github.com/rubygems/rubygems/pull/8481)
58
+ - Keep platform variants in `vendor/cache` even if incompatible with the current Ruby version [#8471](https://github.com/rubygems/rubygems/pull/8471)
59
+ - Fix `bundle console` printing bug report template incorrectly [#8436](https://github.com/rubygems/rubygems/pull/8436)
60
+ - Fix `--prefer-local` not respecting default gems [#8412](https://github.com/rubygems/rubygems/pull/8412)
61
+
62
+ ## Performance:
63
+
64
+ - Improve resolution performance [#8458](https://github.com/rubygems/rubygems/pull/8458)
65
+
66
+ ## Documentation:
67
+
68
+ - Fix more broken links [#8416](https://github.com/rubygems/rubygems/pull/8416)
69
+
70
+ # 2.6.3 (January 16, 2025)
71
+
72
+ ## Enhancements:
73
+
74
+ - Don't fallback to evaluating YAML gemspecs as Ruby code [#8404](https://github.com/rubygems/rubygems/pull/8404)
75
+ - Print message when blocking on file locks [#8299](https://github.com/rubygems/rubygems/pull/8299)
76
+ - Add support for mise version manager file [#8356](https://github.com/rubygems/rubygems/pull/8356)
77
+ - Add Ruby 3.5 to Gemfile DSL platform values [#8365](https://github.com/rubygems/rubygems/pull/8365)
78
+
79
+ ## Bug fixes:
80
+
81
+ - Revert RubyGems plugins getting loaded on `Bundler.require` [#8410](https://github.com/rubygems/rubygems/pull/8410)
82
+ - Fix platform specific gems sometimes being removed from the lockfile [#8401](https://github.com/rubygems/rubygems/pull/8401)
83
+ - Serialize gemspec when caching git source [#8403](https://github.com/rubygems/rubygems/pull/8403)
84
+ - Fix crash on read-only filesystems in Ruby 3.4 [#8372](https://github.com/rubygems/rubygems/pull/8372)
85
+ - Fix `bundle outdated <GEM>` failing if not all gems are installed [#8361](https://github.com/rubygems/rubygems/pull/8361)
86
+ - Fix `bundle install` crash on Windows [#8362](https://github.com/rubygems/rubygems/pull/8362)
87
+
88
+ ## Documentation:
89
+
90
+ - Fix broken links in the documents [#8389](https://github.com/rubygems/rubygems/pull/8389)
91
+
1
92
  # 2.6.2 (December 23, 2024)
2
93
 
3
94
  ## Bug fixes:
data/README.md CHANGED
@@ -29,7 +29,7 @@ See [bundler.io](https://bundler.io) for the full documentation.
29
29
 
30
30
  ### Troubleshooting
31
31
 
32
- For help with common problems, see [TROUBLESHOOTING](doc/TROUBLESHOOTING.md).
32
+ For help with common problems, see [TROUBLESHOOTING](../doc/bundler/TROUBLESHOOTING.md).
33
33
 
34
34
  Still stuck? Try [filing an issue](https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md).
35
35
 
@@ -41,7 +41,7 @@ To get in touch with the Bundler core team and other Bundler users, please join
41
41
 
42
42
  ### Contributing
43
43
 
44
- If you'd like to contribute to Bundler, that's awesome, and we <3 you. We've put together [the Bundler contributor guide](https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/README.md) with all of the information you need to get started.
44
+ If you'd like to contribute to Bundler, that's awesome, and we <3 you. We've put together [the Bundler contributor guide](https://github.com/rubygems/rubygems/blob/master/doc/bundler/contributing/README.md) with all of the information you need to get started.
45
45
 
46
46
  If you'd like to request a substantial change to Bundler or its documentation, refer to the [Bundler RFC process](https://github.com/rubygems/rfcs) for more information.
47
47
 
@@ -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 = "2024-12-23".freeze
8
- @git_commit_sha = "90ebd47c740".freeze
7
+ @built_at = "2025-03-13".freeze
8
+ @git_commit_sha = "25cf0763954".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -126,7 +126,7 @@ module Bundler
126
126
  end
127
127
 
128
128
  def removable?
129
- type == :lock || type == :gem
129
+ [:lock, :gem].include?(type)
130
130
  end
131
131
 
132
132
  def ==(other)
@@ -20,9 +20,14 @@ module Bundler
20
20
  require name
21
21
  get_constant(name)
22
22
  rescue LoadError
23
- Bundler.ui.error "Couldn't load console #{name}, falling back to irb"
24
- require "irb"
25
- get_constant("irb")
23
+ if name == "irb"
24
+ Bundler.ui.error "#{name} is not available"
25
+ exit 1
26
+ else
27
+ Bundler.ui.error "Couldn't load console #{name}, falling back to irb"
28
+ name = "irb"
29
+ retry
30
+ end
26
31
  end
27
32
 
28
33
  def get_constant(name)
@@ -32,9 +37,6 @@ module Bundler
32
37
  "irb" => :IRB,
33
38
  }[name]
34
39
  Object.const_get(const_name)
35
- rescue NameError
36
- Bundler.ui.error "Could not find constant #{const_name}"
37
- exit 1
38
40
  end
39
41
  end
40
42
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "rbconfig"
4
4
  require "shellwords"
5
- require "fiddle"
6
5
 
7
6
  module Bundler
8
7
  class CLI::Doctor
@@ -57,6 +56,14 @@ module Bundler
57
56
  Dir.glob("#{spec.full_gem_path}/**/*.bundle")
58
57
  end
59
58
 
59
+ def lookup_with_fiddle(path)
60
+ require "fiddle"
61
+ Fiddle.dlopen(path)
62
+ false
63
+ rescue Fiddle::DLError
64
+ true
65
+ end
66
+
60
67
  def check!
61
68
  require_relative "check"
62
69
  Bundler::CLI::Check.new({}).run
@@ -73,10 +80,7 @@ module Bundler
73
80
  definition.specs.each do |spec|
74
81
  bundles_for_gem(spec).each do |bundle|
75
82
  bad_paths = dylibs(bundle).select do |f|
76
- Fiddle.dlopen(f)
77
- false
78
- rescue Fiddle::DLError
79
- true
83
+ lookup_with_fiddle(f)
80
84
  end
81
85
  if bad_paths.any?
82
86
  broken_links[spec] ||= []
@@ -95,7 +99,7 @@ module Bundler
95
99
  end
96
100
  end.sort.each {|m| message += m }
97
101
  raise ProductionError, message
98
- elsif !permissions_valid
102
+ elsif permissions_valid
99
103
  Bundler.ui.info "No issues found with the installed bundle"
100
104
  end
101
105
  end
@@ -104,21 +108,21 @@ module Bundler
104
108
 
105
109
  def check_home_permissions
106
110
  require "find"
107
- files_not_readable_or_writable = []
108
- files_not_rw_and_owned_by_different_user = []
109
- files_not_owned_by_current_user_but_still_rw = []
111
+ files_not_readable = []
112
+ files_not_readable_and_owned_by_different_user = []
113
+ files_not_owned_by_current_user_but_still_readable = []
110
114
  broken_symlinks = []
111
115
  Find.find(Bundler.bundle_path.to_s).each do |f|
112
116
  if !File.exist?(f)
113
117
  broken_symlinks << f
114
- elsif !File.writable?(f) || !File.readable?(f)
118
+ elsif !File.readable?(f)
115
119
  if File.stat(f).uid != Process.uid
116
- files_not_rw_and_owned_by_different_user << f
120
+ files_not_readable_and_owned_by_different_user << f
117
121
  else
118
- files_not_readable_or_writable << f
122
+ files_not_readable << f
119
123
  end
120
124
  elsif File.stat(f).uid != Process.uid
121
- files_not_owned_by_current_user_but_still_rw << f
125
+ files_not_owned_by_current_user_but_still_readable << f
122
126
  end
123
127
  end
124
128
 
@@ -130,23 +134,23 @@ module Bundler
130
134
  ok = false
131
135
  end
132
136
 
133
- if files_not_owned_by_current_user_but_still_rw.any?
137
+ if files_not_owned_by_current_user_but_still_readable.any?
134
138
  Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
135
- "user, but are still readable/writable. These files are:\n - #{files_not_owned_by_current_user_but_still_rw.join("\n - ")}"
139
+ "user, but are still readable. These files are:\n - #{files_not_owned_by_current_user_but_still_readable.join("\n - ")}"
136
140
 
137
141
  ok = false
138
142
  end
139
143
 
140
- if files_not_rw_and_owned_by_different_user.any?
144
+ if files_not_readable_and_owned_by_different_user.any?
141
145
  Bundler.ui.warn "Files exist in the Bundler home that are owned by another " \
142
- "user, and are not readable/writable. These files are:\n - #{files_not_rw_and_owned_by_different_user.join("\n - ")}"
146
+ "user, and are not readable. These files are:\n - #{files_not_readable_and_owned_by_different_user.join("\n - ")}"
143
147
 
144
148
  ok = false
145
149
  end
146
150
 
147
- if files_not_readable_or_writable.any?
151
+ if files_not_readable.any?
148
152
  Bundler.ui.warn "Files exist in the Bundler home that are not " \
149
- "readable/writable by the current user. These files are:\n - #{files_not_readable_or_writable.join("\n - ")}"
153
+ "readable by the current user. These files are:\n - #{files_not_readable.join("\n - ")}"
150
154
 
151
155
  ok = false
152
156
  end
@@ -39,8 +39,8 @@ module Bundler
39
39
  path = File.expand_path("../../..", __dir__)
40
40
  else
41
41
  path = spec.full_gem_path
42
- if spec.deleted_gem?
43
- return Bundler.ui.warn "The gem #{name} has been deleted. It was installed at: #{path}"
42
+ if spec.installation_missing?
43
+ return Bundler.ui.warn "The gem #{name} is missing. It should be installed at #{path}, but was not found"
44
44
  end
45
45
  end
46
46
 
@@ -65,8 +65,8 @@ module Bundler
65
65
  gem_info << "\tDefault Gem: yes\n" if spec.respond_to?(:default_gem?) && spec.default_gem?
66
66
  gem_info << "\tReverse Dependencies: \n\t\t#{gem_dependencies.join("\n\t\t")}" if gem_dependencies.any?
67
67
 
68
- if name != "bundler" && spec.deleted_gem?
69
- return Bundler.ui.warn "The gem #{name} has been deleted. Gemspec information is still available though:\n#{gem_info}"
68
+ if name != "bundler" && spec.installation_missing?
69
+ return Bundler.ui.warn "The gem #{name} is missing. Gemspec information is still available though:\n#{gem_info}"
70
70
  end
71
71
 
72
72
  Bundler.ui.info gem_info
@@ -35,8 +35,8 @@ module Bundler
35
35
  Bundler.ui.confirm(added.map do |d|
36
36
  name = "'#{d.name}'"
37
37
  requirement = ", '#{d.requirement}'"
38
- group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
39
- source = ", :source => '#{d.source}'" unless d.source.nil?
38
+ group = ", group: #{d.groups.inspect}" if d.groups != Array(:default)
39
+ source = ", source: '#{d.source}'" unless d.source.nil?
40
40
  %(gem #{name}#{requirement}#{group}#{source})
41
41
  end.join("\n"))
42
42
  else
@@ -10,7 +10,7 @@ module Bundler
10
10
  be sure to check out these resources:
11
11
 
12
12
  1. Check out our troubleshooting guide for quick fixes to common issues:
13
- https://github.com/rubygems/rubygems/blob/master/bundler/doc/TROUBLESHOOTING.md
13
+ https://github.com/rubygems/rubygems/blob/master/doc/bundler/TROUBLESHOOTING.md
14
14
 
15
15
  2. Instructions for common Bundler uses can be found on the documentation
16
16
  site: https://bundler.io/
@@ -44,7 +44,8 @@ module Bundler
44
44
 
45
45
  Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
46
46
 
47
- options["remove-platform"].each do |platform|
47
+ options["remove-platform"].each do |platform_string|
48
+ platform = Gem::Platform.new(platform_string)
48
49
  definition.remove_platform(platform)
49
50
  end
50
51
 
@@ -26,13 +26,15 @@ module Bundler
26
26
  def run
27
27
  check_for_deployment_mode!
28
28
 
29
- gems.each do |gem_name|
30
- Bundler::CLI::Common.select_spec(gem_name)
31
- end
32
-
33
29
  Bundler.definition.validate_runtime!
34
30
  current_specs = Bundler.ui.silence { Bundler.definition.resolve }
35
31
 
32
+ gems.each do |gem_name|
33
+ if current_specs[gem_name].empty?
34
+ raise GemNotFound, "Could not find gem '#{gem_name}'."
35
+ end
36
+ end
37
+
36
38
  current_dependencies = Bundler.ui.silence do
37
39
  Bundler.load.dependencies.map {|dep| [dep.name, dep] }.to_h
38
40
  end
@@ -24,7 +24,7 @@ module Bundler
24
24
  return unless spec
25
25
  path = spec.full_gem_path
26
26
  unless File.directory?(path)
27
- return Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at: #{path}"
27
+ return Bundler.ui.warn "The gem #{gem_name} is missing. It should be installed at #{path}, but was not found"
28
28
  end
29
29
  end
30
30
  return Bundler.ui.info(path)
@@ -37,7 +37,8 @@ module Bundler
37
37
  file.digests = parse_digests(response)
38
38
  # server may ignore Range and return the full response
39
39
  if response.is_a?(Gem::Net::HTTPPartialContent)
40
- break false unless file.append(response.body.byteslice(1..-1))
40
+ tail = response.body.byteslice(1..-1)
41
+ break false unless tail && file.append(tail)
41
42
  else
42
43
  file.write(response.body)
43
44
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "rubygems_ext"
4
+
3
5
  module Bundler
4
6
  # Returns current version of Ruby
5
7
  #
@@ -9,38 +11,25 @@ module Bundler
9
11
  end
10
12
 
11
13
  class CurrentRuby
12
- KNOWN_MINOR_VERSIONS = %w[
13
- 1.8
14
- 1.9
15
- 2.0
16
- 2.1
17
- 2.2
18
- 2.3
19
- 2.4
20
- 2.5
21
- 2.6
22
- 2.7
23
- 3.0
24
- 3.1
25
- 3.2
26
- 3.3
27
- ].freeze
28
-
29
- KNOWN_MAJOR_VERSIONS = KNOWN_MINOR_VERSIONS.map {|v| v.split(".", 2).first }.uniq.freeze
30
-
31
- KNOWN_PLATFORMS = %w[
32
- jruby
33
- maglev
34
- mingw
35
- mri
36
- mswin
37
- mswin64
38
- rbx
39
- ruby
40
- truffleruby
41
- windows
42
- x64_mingw
43
- ].freeze
14
+ ALL_RUBY_VERSIONS = (18..27).to_a.concat((30..35).to_a).freeze
15
+ KNOWN_MINOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.reverse.join(".") }.freeze
16
+ KNOWN_MAJOR_VERSIONS = ALL_RUBY_VERSIONS.map {|v| v.digits.last.to_s }.uniq.freeze
17
+ PLATFORM_MAP = {
18
+ ruby: [Gem::Platform::RUBY, CurrentRuby::ALL_RUBY_VERSIONS],
19
+ mri: [Gem::Platform::RUBY, CurrentRuby::ALL_RUBY_VERSIONS],
20
+ rbx: [Gem::Platform::RUBY],
21
+ truffleruby: [Gem::Platform::RUBY],
22
+ jruby: [Gem::Platform::JAVA, [18, 19]],
23
+ windows: [Gem::Platform::WINDOWS, CurrentRuby::ALL_RUBY_VERSIONS],
24
+ # deprecated
25
+ mswin: [Gem::Platform::MSWIN, CurrentRuby::ALL_RUBY_VERSIONS],
26
+ mswin64: [Gem::Platform::MSWIN64, CurrentRuby::ALL_RUBY_VERSIONS - [18]],
27
+ mingw: [Gem::Platform::UNIVERSAL_MINGW, CurrentRuby::ALL_RUBY_VERSIONS],
28
+ x64_mingw: [Gem::Platform::UNIVERSAL_MINGW, CurrentRuby::ALL_RUBY_VERSIONS - [18, 19]],
29
+ }.each_with_object({}) do |(platform, spec), hash|
30
+ hash[platform] = spec[0]
31
+ spec[1]&.each {|version| hash[:"#{platform}_#{version}"] = spec[0] }
32
+ end.freeze
44
33
 
45
34
  def ruby?
46
35
  return true if Bundler::GemHelpers.generic_local_platform_is_ruby?
@@ -82,7 +71,8 @@ module Bundler
82
71
  RUBY_VERSION.start_with?("#{version}.")
83
72
  end
84
73
 
85
- KNOWN_PLATFORMS.each do |platform|
74
+ all_platforms = PLATFORM_MAP.keys << "maglev"
75
+ all_platforms.each do |platform|
86
76
  define_method(:"#{platform}_#{trimmed_version}?") do
87
77
  send(:"#{platform}?") && send(:"on_#{trimmed_version}?")
88
78
  end