rubygems-update 3.5.6 → 3.5.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +204 -1
  3. data/CODE_OF_CONDUCT.md +79 -28
  4. data/CONTRIBUTING.md +2 -2
  5. data/Manifest.txt +9 -4
  6. data/POLICIES.md +75 -6
  7. data/bundler/CHANGELOG.md +156 -0
  8. data/bundler/lib/bundler/build_metadata.rb +2 -2
  9. data/bundler/lib/bundler/cli/binstubs.rb +1 -1
  10. data/bundler/lib/bundler/cli/fund.rb +1 -1
  11. data/bundler/lib/bundler/cli/gem.rb +7 -14
  12. data/bundler/lib/bundler/cli/install.rb +1 -1
  13. data/bundler/lib/bundler/cli/plugin.rb +3 -2
  14. data/bundler/lib/bundler/cli.rb +14 -31
  15. data/bundler/lib/bundler/compact_index_client/cache.rb +47 -72
  16. data/bundler/lib/bundler/compact_index_client/parser.rb +84 -0
  17. data/bundler/lib/bundler/compact_index_client.rb +51 -80
  18. data/bundler/lib/bundler/constants.rb +8 -1
  19. data/bundler/lib/bundler/definition.rb +114 -71
  20. data/bundler/lib/bundler/dependency.rb +2 -1
  21. data/bundler/lib/bundler/dsl.rb +16 -1
  22. data/bundler/lib/bundler/endpoint_specification.rb +11 -0
  23. data/bundler/lib/bundler/env.rb +1 -1
  24. data/bundler/lib/bundler/environment_preserver.rb +2 -20
  25. data/bundler/lib/bundler/errors.rb +14 -0
  26. data/bundler/lib/bundler/fetcher/compact_index.rb +15 -24
  27. data/bundler/lib/bundler/gem_helper.rb +1 -1
  28. data/bundler/lib/bundler/gem_helpers.rb +14 -7
  29. data/bundler/lib/bundler/gem_version_promoter.rb +42 -38
  30. data/bundler/lib/bundler/injector.rb +3 -5
  31. data/bundler/lib/bundler/installer/gem_installer.rb +0 -1
  32. data/bundler/lib/bundler/installer/standalone.rb +0 -3
  33. data/bundler/lib/bundler/installer.rb +9 -11
  34. data/bundler/lib/bundler/lazy_specification.rb +1 -0
  35. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-check.1 +3 -1
  39. data/bundler/lib/bundler/man/bundle-check.1.ronn +3 -0
  40. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-config.1 +2 -4
  42. data/bundler/lib/bundler/man/bundle-config.1.ronn +1 -4
  43. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-gem.1 +7 -1
  47. data/bundler/lib/bundler/man/bundle-gem.1.ronn +11 -0
  48. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  49. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  50. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-install.1 +3 -3
  53. data/bundler/lib/bundler/man/bundle-install.1.ronn +2 -2
  54. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  55. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  56. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  58. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  59. data/bundler/lib/bundler/man/bundle-plugin.1 +7 -4
  60. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +7 -3
  61. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  62. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  63. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  64. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  65. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  66. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  67. data/bundler/lib/bundler/man/bundle.1 +1 -1
  68. data/bundler/lib/bundler/man/gemfile.5 +3 -3
  69. data/bundler/lib/bundler/man/gemfile.5.ronn +2 -2
  70. data/bundler/lib/bundler/plugin/installer/path.rb +18 -0
  71. data/bundler/lib/bundler/plugin/installer.rb +36 -16
  72. data/bundler/lib/bundler/plugin/source_list.rb +4 -4
  73. data/bundler/lib/bundler/resolver/base.rb +4 -0
  74. data/bundler/lib/bundler/resolver/candidate.rb +5 -17
  75. data/bundler/lib/bundler/resolver/package.rb +4 -0
  76. data/bundler/lib/bundler/resolver/spec_group.rb +20 -2
  77. data/bundler/lib/bundler/resolver.rb +72 -33
  78. data/bundler/lib/bundler/rubygems_ext.rb +98 -10
  79. data/bundler/lib/bundler/rubygems_gem_installer.rb +35 -2
  80. data/bundler/lib/bundler/rubygems_integration.rb +16 -2
  81. data/bundler/lib/bundler/runtime.rb +1 -1
  82. data/bundler/lib/bundler/self_manager.rb +22 -2
  83. data/bundler/lib/bundler/settings.rb +22 -16
  84. data/bundler/lib/bundler/setup.rb +6 -0
  85. data/bundler/lib/bundler/shared_helpers.rb +6 -4
  86. data/bundler/lib/bundler/source/git/git_proxy.rb +8 -0
  87. data/bundler/lib/bundler/source/git.rb +14 -0
  88. data/bundler/lib/bundler/source/metadata.rb +2 -0
  89. data/bundler/lib/bundler/source/path.rb +0 -13
  90. data/bundler/lib/bundler/source/rubygems.rb +31 -30
  91. data/bundler/lib/bundler/source_list.rb +26 -2
  92. data/bundler/lib/bundler/spec_set.rb +15 -13
  93. data/bundler/lib/bundler/stub_specification.rb +8 -0
  94. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  95. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -3
  96. data/bundler/lib/bundler/templates/newgem/rubocop.yml.tt +0 -5
  97. data/bundler/lib/bundler/vendor/pub_grub/lib/pub_grub/static_package_source.rb +1 -0
  98. data/bundler/lib/bundler/vendored_net_http.rb +20 -5
  99. data/bundler/lib/bundler/vendored_timeout.rb +7 -3
  100. data/bundler/lib/bundler/version.rb +1 -1
  101. data/bundler/lib/bundler/yaml_serializer.rb +1 -8
  102. data/bundler/lib/bundler.rb +26 -1
  103. data/exe/update_rubygems +1 -1
  104. data/lib/rubygems/basic_specification.rb +27 -0
  105. data/lib/rubygems/bundler_version_finder.rb +1 -1
  106. data/lib/rubygems/command.rb +1 -1
  107. data/lib/rubygems/command_manager.rb +2 -1
  108. data/lib/rubygems/commands/build_command.rb +2 -11
  109. data/lib/rubygems/commands/help_command.rb +2 -2
  110. data/lib/rubygems/commands/pristine_command.rb +12 -9
  111. data/lib/rubygems/commands/rdoc_command.rb +1 -8
  112. data/lib/rubygems/commands/rebuild_command.rb +264 -0
  113. data/lib/rubygems/commands/setup_command.rb +2 -0
  114. data/lib/rubygems/commands/uninstall_command.rb +1 -1
  115. data/lib/rubygems/commands/update_command.rb +8 -9
  116. data/lib/rubygems/config_file.rb +33 -16
  117. data/lib/rubygems/defaults.rb +4 -4
  118. data/lib/rubygems/dependency.rb +3 -15
  119. data/lib/rubygems/dependency_list.rb +1 -1
  120. data/lib/rubygems/deprecate.rb +79 -77
  121. data/lib/rubygems/ext/cargo_builder.rb +2 -17
  122. data/lib/rubygems/gemcutter_utilities/webauthn_poller.rb +3 -1
  123. data/lib/rubygems/gemcutter_utilities.rb +1 -1
  124. data/lib/rubygems/gemspec_helpers.rb +19 -0
  125. data/lib/rubygems/installer.rb +9 -8
  126. data/lib/rubygems/package/tar_header.rb +20 -4
  127. data/lib/rubygems/package.rb +13 -8
  128. data/lib/rubygems/platform.rb +3 -2
  129. data/lib/rubygems/remote_fetcher.rb +1 -1
  130. data/lib/rubygems/request.rb +1 -1
  131. data/lib/rubygems/request_set.rb +1 -1
  132. data/lib/rubygems/requirement.rb +2 -2
  133. data/lib/rubygems/resolver/spec_specification.rb +7 -0
  134. data/lib/rubygems/s3_uri_signer.rb +1 -1
  135. data/lib/rubygems/safe_yaml.rb +10 -1
  136. data/lib/rubygems/security.rb +1 -1
  137. data/lib/rubygems/specification.rb +55 -124
  138. data/lib/rubygems/specification_policy.rb +26 -6
  139. data/lib/rubygems/specification_record.rb +212 -0
  140. data/lib/rubygems/stub_specification.rb +21 -0
  141. data/lib/rubygems/uninstaller.rb +27 -20
  142. data/lib/rubygems/util/licenses.rb +68 -0
  143. data/lib/rubygems/vendor/molinillo/lib/molinillo/dependency_graph.rb +1 -1
  144. data/lib/rubygems/vendored_net_http.rb +5 -0
  145. data/lib/rubygems/vendored_timeout.rb +5 -0
  146. data/lib/rubygems/yaml_serializer.rb +1 -8
  147. data/lib/rubygems.rb +28 -15
  148. data/rubygems-update.gemspec +1 -1
  149. metadata +12 -7
  150. data/lib/rubygems/net/http.rb +0 -3
  151. data/lib/rubygems/timeout.rb +0 -3
  152. /data/lib/rubygems/{optparse.rb → vendored_optparse.rb} +0 -0
  153. /data/lib/rubygems/{tsort.rb → vendored_tsort.rb} +0 -0
@@ -92,6 +92,17 @@ module Bundler
92
92
  end
93
93
  end
94
94
 
95
+ # needed for `bundle fund`
96
+ def metadata
97
+ if @remote_specification
98
+ @remote_specification.metadata
99
+ elsif _local_specification
100
+ _local_specification.metadata
101
+ else
102
+ super
103
+ end
104
+ end
105
+
95
106
  def _local_specification
96
107
  return unless @loaded_from && File.exist?(local_specification_path)
97
108
  eval(File.read(local_specification_path), nil, local_specification_path).tap do |spec|
@@ -120,7 +120,7 @@ module Bundler
120
120
  specs = Bundler.rubygems.find_name(name)
121
121
  out << [" #{name}", "(#{specs.map(&:version).join(",")})"] unless specs.empty?
122
122
  end
123
- if (exe = caller.last.split(":").first)&.match? %r{(exe|bin)/bundler?\z}
123
+ if (exe = caller_locations.last.absolute_path)&.match? %r{(exe|bin)/bundler?\z}
124
124
  shebang = File.read(exe).lines.first
125
125
  shebang.sub!(/^#!\s*/, "")
126
126
  unless shebang.start_with?(Gem.ruby, "/usr/bin/env ruby")
@@ -19,14 +19,7 @@ module Bundler
19
19
  BUNDLER_PREFIX = "BUNDLER_ORIG_"
20
20
 
21
21
  def self.from_env
22
- new(env_to_hash(ENV), BUNDLER_KEYS)
23
- end
24
-
25
- def self.env_to_hash(env)
26
- to_hash = env.to_hash
27
- return to_hash unless Gem.win_platform?
28
-
29
- to_hash.each_with_object({}) {|(k,v), a| a[k.upcase] = v }
22
+ new(ENV.to_hash, BUNDLER_KEYS)
30
23
  end
31
24
 
32
25
  # @param env [Hash]
@@ -39,18 +32,7 @@ module Bundler
39
32
 
40
33
  # Replaces `ENV` with the bundler environment variables backed up
41
34
  def replace_with_backup
42
- unless Gem.win_platform?
43
- ENV.replace(backup)
44
- return
45
- end
46
-
47
- # Fallback logic for Windows below to workaround
48
- # https://bugs.ruby-lang.org/issues/16798. Can be dropped once all
49
- # supported rubies include the fix for that.
50
-
51
- ENV.clear
52
-
53
- backup.each {|k, v| ENV[k] = v }
35
+ ENV.replace(backup)
54
36
  end
55
37
 
56
38
  # @return [Hash]
@@ -230,4 +230,18 @@ module Bundler
230
230
 
231
231
  status_code(38)
232
232
  end
233
+
234
+ class CorruptBundlerInstallError < BundlerError
235
+ def initialize(loaded_spec)
236
+ @loaded_spec = loaded_spec
237
+ end
238
+
239
+ def message
240
+ "The running version of Bundler (#{Bundler::VERSION}) does not match the version of the specification installed for it (#{@loaded_spec.version}). " \
241
+ "This can be caused by reinstalling Ruby without removing previous installation, leaving around an upgraded default version of Bundler. " \
242
+ "Reinstalling Ruby from scratch should fix the problem."
243
+ end
244
+
245
+ status_code(39)
246
+ end
233
247
  end
@@ -4,8 +4,6 @@ require_relative "base"
4
4
  require_relative "../worker"
5
5
 
6
6
  module Bundler
7
- autoload :CompactIndexClient, File.expand_path("../compact_index_client", __dir__)
8
-
9
7
  class Fetcher
10
8
  class CompactIndex < Base
11
9
  def self.compact_index_request(method_name)
@@ -36,15 +34,8 @@ module Bundler
36
34
 
37
35
  until remaining_gems.empty?
38
36
  log_specs { "Looking up gems #{remaining_gems.inspect}" }
39
-
40
- deps = begin
41
- parallel_compact_index_client.dependencies(remaining_gems)
42
- rescue TooManyRequestsError
43
- @bundle_worker&.stop
44
- @bundle_worker = nil # reset it. Not sure if necessary
45
- serial_compact_index_client.dependencies(remaining_gems)
46
- end
47
- next_gems = deps.flat_map {|d| d[3].flat_map(&:first) }.uniq
37
+ deps = fetch_gem_infos(remaining_gems).flatten(1)
38
+ next_gems = deps.flat_map {|d| d[CompactIndexClient::INFO_DEPS].flat_map(&:first) }.uniq
48
39
  deps.each {|dep| gem_info << dep }
49
40
  complete_gems.concat(deps.map(&:first)).uniq!
50
41
  remaining_gems = next_gems - complete_gems
@@ -61,7 +52,7 @@ module Bundler
61
52
  return nil
62
53
  end
63
54
  # Read info file checksums out of /versions, so we can know if gems are up to date
64
- compact_index_client.update_and_parse_checksums!
55
+ compact_index_client.available?
65
56
  rescue CompactIndexClient::Updater::MismatchedChecksumError => e
66
57
  Bundler.ui.debug(e.message)
67
58
  nil
@@ -81,20 +72,20 @@ module Bundler
81
72
  end
82
73
  end
83
74
 
84
- def parallel_compact_index_client
85
- compact_index_client.execution_mode = lambda do |inputs, &blk|
86
- func = lambda {|object, _index| blk.call(object) }
87
- worker = bundle_worker(func)
88
- inputs.each {|input| worker.enq(input) }
89
- inputs.map { worker.deq }
90
- end
91
-
92
- compact_index_client
75
+ def fetch_gem_infos(names)
76
+ in_parallel(names) {|name| compact_index_client.info(name) }
77
+ rescue TooManyRequestsError # rubygems.org is rate limiting us, slow down.
78
+ @bundle_worker&.stop
79
+ @bundle_worker = nil # reset it. Not sure if necessary
80
+ compact_index_client.reset!
81
+ names.map {|name| compact_index_client.info(name) }
93
82
  end
94
83
 
95
- def serial_compact_index_client
96
- compact_index_client.sequential_execution_mode!
97
- compact_index_client
84
+ def in_parallel(inputs, &blk)
85
+ func = lambda {|object, _index| blk.call(object) }
86
+ worker = bundle_worker(func)
87
+ inputs.each {|input| worker.enq(input) }
88
+ inputs.map { worker.deq }
98
89
  end
99
90
 
100
91
  def bundle_worker(func = nil)
@@ -47,7 +47,7 @@ module Bundler
47
47
  built_gem_path = build_gem
48
48
  end
49
49
 
50
- desc "Generate SHA512 checksum if #{name}-#{version}.gem into the checksums directory."
50
+ desc "Generate SHA512 checksum of #{name}-#{version}.gem into the checksums directory."
51
51
  task "build:checksum" => "build" do
52
52
  build_checksum(built_gem_path)
53
53
  end
@@ -46,19 +46,26 @@ module Bundler
46
46
  end
47
47
  module_function :platform_specificity_match
48
48
 
49
- def select_best_platform_match(specs, platform)
50
- matching = specs.select {|spec| spec.match_platform(platform) }
49
+ def select_best_platform_match(specs, platform, force_ruby: false, prefer_locked: false)
50
+ matching = if force_ruby
51
+ specs.select {|spec| spec.match_platform(Gem::Platform::RUBY) && spec.force_ruby_platform! }
52
+ else
53
+ specs.select {|spec| spec.match_platform(platform) }
54
+ end
55
+
56
+ if prefer_locked
57
+ locked_originally = matching.select {|spec| spec.is_a?(LazySpecification) }
58
+ return locked_originally if locked_originally.any?
59
+ end
51
60
 
52
61
  sort_best_platform_match(matching, platform)
53
62
  end
54
63
  module_function :select_best_platform_match
55
64
 
56
- def force_ruby_platform(specs)
57
- matching = specs.select {|spec| spec.match_platform(Gem::Platform::RUBY) && spec.force_ruby_platform! }
58
-
59
- sort_best_platform_match(matching, Gem::Platform::RUBY)
65
+ def select_best_local_platform_match(specs, force_ruby: false)
66
+ select_best_platform_match(specs, local_platform, force_ruby: force_ruby).map(&:materialize_for_installation).compact
60
67
  end
61
- module_function :force_ruby_platform
68
+ module_function :select_best_local_platform_match
62
69
 
63
70
  def sort_best_platform_match(matching, platform)
64
71
  exact = matching.select {|spec| spec.platform == platform }
@@ -45,17 +45,37 @@ module Bundler
45
45
 
46
46
  # Given a Resolver::Package and an Array of Specifications of available
47
47
  # versions for a gem, this method will return the Array of Specifications
48
- # sorted (and possibly truncated if strict is true) in an order to give
49
- # preference to the current level (:major, :minor or :patch) when resolution
50
- # is deciding what versions best resolve all dependencies in the bundle.
48
+ # sorted in an order to give preference to the current level (:major, :minor
49
+ # or :patch) when resolution is deciding what versions best resolve all
50
+ # dependencies in the bundle.
51
51
  # @param package [Resolver::Package] The package being resolved.
52
52
  # @param specs [Specification] An array of Specifications for the package.
53
- # @return [Specification] A new instance of the Specification Array sorted and
54
- # possibly filtered.
53
+ # @return [Specification] A new instance of the Specification Array sorted.
55
54
  def sort_versions(package, specs)
56
- specs = filter_dep_specs(specs, package) if strict
55
+ locked_version = package.locked_version
57
56
 
58
- sort_dep_specs(specs, package)
57
+ result = specs.sort do |a, b|
58
+ unless package.prerelease_specified? || pre?
59
+ a_pre = a.prerelease?
60
+ b_pre = b.prerelease?
61
+
62
+ next 1 if a_pre && !b_pre
63
+ next -1 if b_pre && !a_pre
64
+ end
65
+
66
+ if major? || locked_version.nil?
67
+ b <=> a
68
+ elsif either_version_older_than_locked?(a, b, locked_version)
69
+ b <=> a
70
+ elsif segments_do_not_match?(a, b, :major)
71
+ a <=> b
72
+ elsif !minor? && segments_do_not_match?(a, b, :minor)
73
+ a <=> b
74
+ else
75
+ b <=> a
76
+ end
77
+ end
78
+ post_sort(result, package.unlock?, locked_version)
59
79
  end
60
80
 
61
81
  # @return [bool] Convenience method for testing value of level variable.
@@ -73,9 +93,18 @@ module Bundler
73
93
  pre == true
74
94
  end
75
95
 
76
- private
96
+ # Given a Resolver::Package and an Array of Specifications of available
97
+ # versions for a gem, this method will truncate the Array if strict
98
+ # is true. That means filtering out downgrades from the version currently
99
+ # locked, and filtering out upgrades that go past the selected level (major,
100
+ # minor, or patch).
101
+ # @param package [Resolver::Package] The package being resolved.
102
+ # @param specs [Specification] An array of Specifications for the package.
103
+ # @return [Specification] A new instance of the Specification Array
104
+ # truncated.
105
+ def filter_versions(package, specs)
106
+ return specs unless strict
77
107
 
78
- def filter_dep_specs(specs, package)
79
108
  locked_version = package.locked_version
80
109
  return specs if locked_version.nil? || major?
81
110
 
@@ -89,32 +118,7 @@ module Bundler
89
118
  end
90
119
  end
91
120
 
92
- def sort_dep_specs(specs, package)
93
- locked_version = package.locked_version
94
-
95
- result = specs.sort do |a, b|
96
- unless package.prerelease_specified? || pre?
97
- a_pre = a.prerelease?
98
- b_pre = b.prerelease?
99
-
100
- next -1 if a_pre && !b_pre
101
- next 1 if b_pre && !a_pre
102
- end
103
-
104
- if major? || locked_version.nil?
105
- a <=> b
106
- elsif either_version_older_than_locked?(a, b, locked_version)
107
- a <=> b
108
- elsif segments_do_not_match?(a, b, :major)
109
- b <=> a
110
- elsif !minor? && segments_do_not_match?(a, b, :minor)
111
- b <=> a
112
- else
113
- a <=> b
114
- end
115
- end
116
- post_sort(result, package.unlock?, locked_version)
117
- end
121
+ private
118
122
 
119
123
  def either_version_older_than_locked?(a, b, locked_version)
120
124
  a.version < locked_version || b.version < locked_version
@@ -133,13 +137,13 @@ module Bundler
133
137
  if unlock || locked_version.nil?
134
138
  result
135
139
  else
136
- move_version_to_end(result, locked_version)
140
+ move_version_to_beginning(result, locked_version)
137
141
  end
138
142
  end
139
143
 
140
- def move_version_to_end(result, version)
144
+ def move_version_to_beginning(result, version)
141
145
  move, keep = result.partition {|s| s.version.to_s == version.to_s }
142
- keep.concat(move)
146
+ move.concat(keep)
143
147
  end
144
148
  end
145
149
  end
@@ -23,10 +23,7 @@ module Bundler
23
23
  # @param [Pathname] lockfile_path The lockfile in which to inject the new dependency.
24
24
  # @return [Array]
25
25
  def inject(gemfile_path, lockfile_path)
26
- if Bundler.frozen_bundle?
27
- # ensure the lock and Gemfile are synced
28
- Bundler.definition.ensure_equivalent_gemfile_and_lockfile(true)
29
- end
26
+ Bundler.definition.ensure_equivalent_gemfile_and_lockfile(true)
30
27
 
31
28
  # temporarily unfreeze
32
29
  Bundler.settings.temporary(deployment: false, frozen: false) do
@@ -120,9 +117,10 @@ module Bundler
120
117
  github = ", :github => \"#{d.github}\"" unless d.github.nil?
121
118
  branch = ", :branch => \"#{d.branch}\"" unless d.branch.nil?
122
119
  ref = ", :ref => \"#{d.ref}\"" unless d.ref.nil?
120
+ glob = ", :glob => \"#{d.glob}\"" unless d.glob.nil?
123
121
  require_path = ", :require => #{convert_autorequire(d.autorequire)}" unless d.autorequire.nil?
124
122
 
125
- %(gem #{name}#{requirement}#{group}#{source}#{path}#{git}#{github}#{branch}#{ref}#{require_path})
123
+ %(gem #{name}#{requirement}#{group}#{source}#{path}#{git}#{github}#{branch}#{ref}#{glob}#{require_path})
126
124
  end.join("\n")
127
125
  end
128
126
 
@@ -54,7 +54,6 @@ module Bundler
54
54
  spec.source.install(
55
55
  spec,
56
56
  force: force,
57
- ensure_builtin_gems_cached: standalone,
58
57
  build_args: Array(spec_settings),
59
58
  previous_spec: previous_spec,
60
59
  )
@@ -58,9 +58,6 @@ module Bundler
58
58
  else
59
59
  SharedHelpers.relative_path_to(full_path, from: Bundler.root.join(bundler_path))
60
60
  end
61
- rescue TypeError
62
- error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
63
- raise Gem::InvalidSpecificationException.new(error_message)
64
61
  end
65
62
 
66
63
  def prevent_gem_activation
@@ -69,9 +69,7 @@ module Bundler
69
69
  Bundler.create_bundle_path
70
70
 
71
71
  ProcessLock.lock do
72
- if Bundler.frozen_bundle?
73
- @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
74
- end
72
+ @definition.ensure_equivalent_gemfile_and_lockfile(options[:deployment])
75
73
 
76
74
  if @definition.dependencies.empty?
77
75
  Bundler.ui.warn "The Gemfile specifies no dependencies"
@@ -249,15 +247,15 @@ module Bundler
249
247
 
250
248
  # returns whether or not a re-resolve was needed
251
249
  def resolve_if_needed(options)
252
- @definition.resolution_mode = options
253
-
254
- if !@definition.unlocking? && !options["force"] && !Bundler.settings[:inline] && Bundler.default_lockfile.file?
255
- return false if @definition.nothing_changed? && !@definition.missing_specs?
250
+ @definition.prefer_local! if options["prefer-local"]
251
+
252
+ if options["local"] || (@definition.no_resolve_needed? && !@definition.missing_specs?)
253
+ @definition.resolve_with_cache!
254
+ false
255
+ else
256
+ @definition.resolve_remotely!
257
+ true
256
258
  end
257
-
258
- @definition.setup_sources_for_resolve
259
-
260
- true
261
259
  end
262
260
 
263
261
  def lock
@@ -4,6 +4,7 @@ require_relative "force_platform"
4
4
 
5
5
  module Bundler
6
6
  class LazySpecification
7
+ include MatchMetadata
7
8
  include MatchPlatform
8
9
  include ForcePlatform
9
10
 
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-ADD" "1" "December 2023" ""
3
+ .TH "BUNDLE\-ADD" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-BINSTUBS" "1" "December 2023" ""
3
+ .TH "BUNDLE\-BINSTUBS" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CACHE" "1" "December 2023" ""
3
+ .TH "BUNDLE\-CACHE" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CHECK" "1" "December 2023" ""
3
+ .TH "BUNDLE\-CHECK" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
6
6
  .SH "SYNOPSIS"
@@ -9,6 +9,8 @@
9
9
  \fBcheck\fR searches the local machine for each of the gems requested in the Gemfile\. If all gems are found, Bundler prints a success message and exits with a status of 0\.
10
10
  .P
11
11
  If not, the first missing gem is listed and Bundler exits status 1\.
12
+ .P
13
+ If the lockfile needs to be updated then it will be resolved using the gems installed on the local machine, if they satisfy the requirements\.
12
14
  .SH "OPTIONS"
13
15
  .TP
14
16
  \fB\-\-dry\-run\fR
@@ -15,6 +15,9 @@ a status of 0.
15
15
 
16
16
  If not, the first missing gem is listed and Bundler exits status 1.
17
17
 
18
+ If the lockfile needs to be updated then it will be resolved using the gems
19
+ installed on the local machine, if they satisfy the requirements.
20
+
18
21
  ## OPTIONS
19
22
 
20
23
  * `--dry-run`:
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CLEAN" "1" "December 2023" ""
3
+ .TH "BUNDLE\-CLEAN" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CONFIG" "1" "December 2023" ""
3
+ .TH "BUNDLE\-CONFIG" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-config\fR \- Set bundler configuration options
6
6
  .SH "SYNOPSIS"
@@ -95,8 +95,6 @@ Any periods in the configuration keys must be replaced with two underscores when
95
95
  .SH "LIST OF AVAILABLE KEYS"
96
96
  The following is a list of all configuration keys and their purpose\. You can learn more about their operation in bundle install(1) \fIbundle\-install\.1\.html\fR\.
97
97
  .IP "\(bu" 4
98
- \fBallow_deployment_source_credential_changes\fR (\fBBUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES\fR): When in deployment mode, allow changing the credentials to a gem's source\. Ex: \fBhttps://some\.host\.com/gems/path/\fR \-> \fBhttps://user_name:password@some\.host\.com/gems/path\fR
99
- .IP "\(bu" 4
100
98
  \fBallow_offline_install\fR (\fBBUNDLE_ALLOW_OFFLINE_INSTALL\fR): Allow Bundler to use cached data when installing without network access\.
101
99
  .IP "\(bu" 4
102
100
  \fBauto_clean_without_path\fR (\fBBUNDLE_AUTO_CLEAN_WITHOUT_PATH\fR): Automatically run \fBbundle clean\fR after installing when an explicit \fBpath\fR has not been set and Bundler is not installing into the system gems\.
@@ -309,7 +307,7 @@ Any \fB\.\fR characters in a host name are mapped to a double underscore (\fB__\
309
307
  .P
310
308
  This means that if you have a gem server named \fBmy\.gem\-host\.com\fR, you'll need to use the \fBBUNDLE_MY__GEM___HOST__COM\fR variable to configure credentials for it through ENV\.
311
309
  .SH "CONFIGURE BUNDLER DIRECTORIES"
312
- Bundler's home, config, cache and plugin directories are able to be configured through environment variables\. The default location for Bundler's home directory is \fB~/\.bundle\fR, which all directories inherit from by default\. The following outlines the available environment variables and their default values
310
+ Bundler's home, cache and plugin directories and config file can be configured through environment variables\. The default location for Bundler's home directory is \fB~/\.bundle\fR, which all directories inherit from by default\. The following outlines the available environment variables and their default values
313
311
  .IP "" 4
314
312
  .nf
315
313
  BUNDLE_USER_HOME : $HOME/\.bundle
@@ -137,9 +137,6 @@ the environment variable `BUNDLE_LOCAL__RACK`.
137
137
  The following is a list of all configuration keys and their purpose. You can
138
138
  learn more about their operation in [bundle install(1)](bundle-install.1.html).
139
139
 
140
- * `allow_deployment_source_credential_changes` (`BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES`):
141
- When in deployment mode, allow changing the credentials to a gem's source.
142
- Ex: `https://some.host.com/gems/path/` -> `https://user_name:password@some.host.com/gems/path`
143
140
  * `allow_offline_install` (`BUNDLE_ALLOW_OFFLINE_INSTALL`):
144
141
  Allow Bundler to use cached data when installing without network access.
145
142
  * `auto_clean_without_path` (`BUNDLE_AUTO_CLEAN_WITHOUT_PATH`):
@@ -400,7 +397,7 @@ through ENV.
400
397
 
401
398
  ## CONFIGURE BUNDLER DIRECTORIES
402
399
 
403
- Bundler's home, config, cache and plugin directories are able to be configured
400
+ Bundler's home, cache and plugin directories and config file can be configured
404
401
  through environment variables. The default location for Bundler's home directory is
405
402
  `~/.bundle`, which all directories inherit from by default. The following
406
403
  outlines the available environment variables and their default values
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-CONSOLE" "1" "December 2023" ""
3
+ .TH "BUNDLE\-CONSOLE" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-DOCTOR" "1" "December 2023" ""
3
+ .TH "BUNDLE\-DOCTOR" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-EXEC" "1" "December 2023" ""
3
+ .TH "BUNDLE\-EXEC" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-GEM" "1" "December 2023" ""
3
+ .TH "BUNDLE\-GEM" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
6
6
  .SH "SYNOPSIS"
@@ -44,6 +44,8 @@ When Bundler is configured to not generate tests, an interactive prompt will be
44
44
  .IP
45
45
  When Bundler is unconfigured, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for future \fBbundle gem\fR use\.
46
46
  .IP "\(bu" 4
47
+ \fB\-\-no\-test\fR: Do not use a test framework (overrides \fB\-\-test\fR specified in the global config)\.
48
+ .IP "\(bu" 4
47
49
  \fB\-\-ci\fR, \fB\-\-ci=github\fR, \fB\-\-ci=gitlab\fR, \fB\-\-ci=circle\fR: Specify the continuous integration service that Bundler should use when generating the project\. Acceptable values are \fBgithub\fR, \fBgitlab\fR and \fBcircle\fR\. A configuration file will be generated in the project directory\. Given no option is specified:
48
50
  .IP
49
51
  When Bundler is configured to generate CI files, this defaults to Bundler's global config setting \fBgem\.ci\fR\.
@@ -52,6 +54,8 @@ When Bundler is configured to not generate CI files, an interactive prompt will
52
54
  .IP
53
55
  When Bundler is unconfigured, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for future \fBbundle gem\fR use\.
54
56
  .IP "\(bu" 4
57
+ \fB\-\-no\-ci\fR: Do not use a continuous integration service (overrides \fB\-\-ci\fR specified in the global config)\.
58
+ .IP "\(bu" 4
55
59
  \fB\-\-linter\fR, \fB\-\-linter=rubocop\fR, \fB\-\-linter=standard\fR: Specify the linter and code formatter that Bundler should add to the project's development dependencies\. Acceptable values are \fBrubocop\fR and \fBstandard\fR\. A configuration file will be generated in the project directory\. Given no option is specified:
56
60
  .IP
57
61
  When Bundler is configured to add a linter, this defaults to Bundler's global config setting \fBgem\.linter\fR\.
@@ -60,6 +64,8 @@ When Bundler is configured not to add a linter, an interactive prompt will be di
60
64
  .IP
61
65
  When Bundler is unconfigured, an interactive prompt will be displayed and the answer will be saved in Bundler's global config for future \fBbundle gem\fR use\.
62
66
  .IP "\(bu" 4
67
+ \fB\-\-no\-linter\fR: Do not add a linter (overrides \fB\-\-linter\fR specified in the global config)\.
68
+ .IP "\(bu" 4
63
69
  \fB\-e\fR, \fB\-\-edit[=EDITOR]\fR: Open the resulting GEM_NAME\.gemspec in EDITOR, or the default editor if not specified\. The default is \fB$BUNDLER_EDITOR\fR, \fB$VISUAL\fR, or \fB$EDITOR\fR\.
64
70
  .IP "" 0
65
71
  .SH "SEE ALSO"
@@ -76,6 +76,10 @@ configuration file using the following names:
76
76
  the answer will be saved in Bundler's global config for future `bundle gem`
77
77
  use.
78
78
 
79
+ * `--no-test`:
80
+ Do not use a test framework (overrides `--test` specified in the global
81
+ config).
82
+
79
83
  * `--ci`, `--ci=github`, `--ci=gitlab`, `--ci=circle`:
80
84
  Specify the continuous integration service that Bundler should use when
81
85
  generating the project. Acceptable values are `github`, `gitlab`
@@ -92,6 +96,10 @@ configuration file using the following names:
92
96
  the answer will be saved in Bundler's global config for future `bundle gem`
93
97
  use.
94
98
 
99
+ * `--no-ci`:
100
+ Do not use a continuous integration service (overrides `--ci` specified in
101
+ the global config).
102
+
95
103
  * `--linter`, `--linter=rubocop`, `--linter=standard`:
96
104
  Specify the linter and code formatter that Bundler should add to the
97
105
  project's development dependencies. Acceptable values are `rubocop` and
@@ -108,6 +116,9 @@ configuration file using the following names:
108
116
  the answer will be saved in Bundler's global config for future `bundle gem`
109
117
  use.
110
118
 
119
+ * `--no-linter`:
120
+ Do not add a linter (overrides `--linter` specified in the global config).
121
+
111
122
  * `-e`, `--edit[=EDITOR]`:
112
123
  Open the resulting GEM_NAME.gemspec in EDITOR, or the default editor if not
113
124
  specified. The default is `$BUNDLER_EDITOR`, `$VISUAL`, or `$EDITOR`.
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-HELP" "1" "December 2023" ""
3
+ .TH "BUNDLE\-HELP" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-help\fR \- Displays detailed help for each subcommand
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INFO" "1" "December 2023" ""
3
+ .TH "BUNDLE\-INFO" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INIT" "1" "December 2023" ""
3
+ .TH "BUNDLE\-INIT" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
6
6
  .SH "SYNOPSIS"
@@ -1,6 +1,6 @@
1
1
  .\" generated with nRonn/v0.11.1
2
2
  .\" https://github.com/n-ronn/nronn/tree/0.11.1
3
- .TH "BUNDLE\-INJECT" "1" "December 2023" ""
3
+ .TH "BUNDLE\-INJECT" "1" "June 2024" ""
4
4
  .SH "NAME"
5
5
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
6
6
  .SH "SYNOPSIS"