rubygems-update 3.4.18 → 3.4.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -0
  3. data/POLICIES.md +2 -2
  4. data/bundler/CHANGELOG.md +45 -0
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/cli/binstubs.rb +1 -1
  7. data/bundler/lib/bundler/cli/info.rb +1 -1
  8. data/bundler/lib/bundler/cli/install.rb +1 -1
  9. data/bundler/lib/bundler/cli/outdated.rb +1 -1
  10. data/bundler/lib/bundler/cli/platform.rb +7 -5
  11. data/bundler/lib/bundler/cli/update.rb +1 -0
  12. data/bundler/lib/bundler/definition.rb +25 -20
  13. data/bundler/lib/bundler/dsl.rb +1 -1
  14. data/bundler/lib/bundler/env.rb +1 -1
  15. data/bundler/lib/bundler/fetcher/base.rb +2 -2
  16. data/bundler/lib/bundler/fetcher/compact_index.rb +4 -8
  17. data/bundler/lib/bundler/fetcher/dependency.rb +1 -1
  18. data/bundler/lib/bundler/fetcher/downloader.rb +2 -0
  19. data/bundler/lib/bundler/fetcher/index.rb +1 -2
  20. data/bundler/lib/bundler/fetcher.rb +42 -31
  21. data/bundler/lib/bundler/friendly_errors.rb +1 -1
  22. data/bundler/lib/bundler/gem_helper.rb +3 -4
  23. data/bundler/lib/bundler/index.rb +62 -31
  24. data/bundler/lib/bundler/installer/parallel_installer.rb +1 -1
  25. data/bundler/lib/bundler/installer/standalone.rb +8 -1
  26. data/bundler/lib/bundler/lockfile_parser.rb +3 -15
  27. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-config.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-info.1 +3 -3
  39. data/bundler/lib/bundler/man/bundle-info.1.ronn +3 -3
  40. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  49. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  50. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  51. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  54. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  55. data/bundler/lib/bundler/man/bundle.1 +1 -1
  56. data/bundler/lib/bundler/man/gemfile.5 +25 -1
  57. data/bundler/lib/bundler/man/gemfile.5.ronn +10 -0
  58. data/bundler/lib/bundler/plugin/index.rb +1 -1
  59. data/bundler/lib/bundler/plugin.rb +1 -1
  60. data/bundler/lib/bundler/resolver.rb +18 -3
  61. data/bundler/lib/bundler/retry.rb +1 -1
  62. data/bundler/lib/bundler/ruby_dsl.rb +27 -0
  63. data/bundler/lib/bundler/ruby_version.rb +2 -2
  64. data/bundler/lib/bundler/rubygems_integration.rb +1 -1
  65. data/bundler/lib/bundler/self_manager.rb +2 -0
  66. data/bundler/lib/bundler/settings.rb +37 -13
  67. data/bundler/lib/bundler/source/git/git_proxy.rb +14 -2
  68. data/bundler/lib/bundler/source/git.rb +7 -0
  69. data/bundler/lib/bundler/source/rubygems.rb +22 -25
  70. data/bundler/lib/bundler/source_list.rb +0 -4
  71. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +1 -1
  72. data/bundler/lib/bundler/ui/rg_proxy.rb +1 -1
  73. data/bundler/lib/bundler/version.rb +1 -1
  74. data/bundler/lib/bundler.rb +1 -1
  75. data/lib/rubygems/available_set.rb +1 -1
  76. data/lib/rubygems/basic_specification.rb +2 -2
  77. data/lib/rubygems/bundler_version_finder.rb +1 -1
  78. data/lib/rubygems/command.rb +16 -19
  79. data/lib/rubygems/commands/cert_command.rb +1 -1
  80. data/lib/rubygems/commands/dependency_command.rb +3 -4
  81. data/lib/rubygems/commands/owner_command.rb +8 -10
  82. data/lib/rubygems/commands/uninstall_command.rb +6 -7
  83. data/lib/rubygems/commands/unpack_command.rb +4 -6
  84. data/lib/rubygems/config_file.rb +1 -1
  85. data/lib/rubygems/core_ext/kernel_gem.rb +1 -1
  86. data/lib/rubygems/core_ext/kernel_warn.rb +4 -5
  87. data/lib/rubygems/dependency_installer.rb +8 -12
  88. data/lib/rubygems/deprecate.rb +2 -2
  89. data/lib/rubygems/gemcutter_utilities.rb +3 -4
  90. data/lib/rubygems/installer.rb +9 -11
  91. data/lib/rubygems/name_tuple.rb +1 -1
  92. data/lib/rubygems/package/tar_reader/entry.rb +18 -20
  93. data/lib/rubygems/package/tar_reader.rb +0 -5
  94. data/lib/rubygems/package.rb +11 -6
  95. data/lib/rubygems/query_utils.rb +1 -1
  96. data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
  97. data/lib/rubygems/request_set/lockfile/parser.rb +1 -1
  98. data/lib/rubygems/resolver/activation_request.rb +2 -4
  99. data/lib/rubygems/resolver/installed_specification.rb +1 -1
  100. data/lib/rubygems/resolver/local_specification.rb +1 -1
  101. data/lib/rubygems/s3_uri_signer.rb +1 -1
  102. data/lib/rubygems/security/trust_dir.rb +4 -6
  103. data/lib/rubygems/security.rb +1 -1
  104. data/lib/rubygems/source/local.rb +34 -37
  105. data/lib/rubygems/source.rb +2 -2
  106. data/lib/rubygems/source_list.rb +2 -2
  107. data/lib/rubygems/spec_fetcher.rb +29 -33
  108. data/lib/rubygems/specification.rb +36 -28
  109. data/lib/rubygems/specification_policy.rb +33 -32
  110. data/lib/rubygems/stub_specification.rb +13 -10
  111. data/lib/rubygems/uninstaller.rb +1 -1
  112. data/lib/rubygems/user_interaction.rb +4 -4
  113. data/lib/rubygems/util/licenses.rb +115 -0
  114. data/lib/rubygems/validator.rb +5 -7
  115. data/lib/rubygems.rb +6 -9
  116. data/rubygems-update.gemspec +4 -4
  117. data/test/rubygems/helper.rb +18 -20
  118. data/test/rubygems/test_gem.rb +4 -4
  119. data/test/rubygems/test_gem_commands_build_command.rb +2 -1
  120. data/test/rubygems/test_gem_commands_stale_command.rb +1 -1
  121. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.lock +28 -12
  122. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib/Cargo.toml +1 -1
  123. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +16 -14
  124. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  125. data/test/rubygems/test_gem_indexer.rb +1 -1
  126. data/test/rubygems/test_gem_package.rb +117 -2
  127. data/test/rubygems/test_gem_package_tar_header.rb +7 -7
  128. data/test/rubygems/test_gem_package_tar_reader_entry.rb +53 -1
  129. data/test/rubygems/test_gem_package_tar_writer.rb +13 -13
  130. data/test/rubygems/test_gem_remote_fetcher.rb +21 -25
  131. data/test/rubygems/test_gem_requirement.rb +1 -1
  132. data/test/rubygems/test_gem_specification.rb +42 -6
  133. data/test/rubygems/test_gem_update_suggestion.rb +14 -20
  134. data/test/rubygems/test_require.rb +4 -6
  135. data/test/rubygems/utilities.rb +2 -2
  136. metadata +31 -5
@@ -10,8 +10,8 @@ module Bundler
10
10
  i
11
11
  end
12
12
 
13
- attr_reader :specs, :all_specs, :sources
14
- protected :specs, :all_specs
13
+ attr_reader :specs, :duplicates, :sources
14
+ protected :specs, :duplicates
15
15
 
16
16
  RUBY = "ruby"
17
17
  NULL = "\0"
@@ -19,21 +19,21 @@ module Bundler
19
19
  def initialize
20
20
  @sources = []
21
21
  @cache = {}
22
- @specs = Hash.new {|h, k| h[k] = {} }
23
- @all_specs = Hash.new {|h, k| h[k] = EMPTY_SEARCH }
22
+ @specs = {}
23
+ @duplicates = {}
24
24
  end
25
25
 
26
26
  def initialize_copy(o)
27
27
  @sources = o.sources.dup
28
28
  @cache = {}
29
- @specs = Hash.new {|h, k| h[k] = {} }
30
- @all_specs = Hash.new {|h, k| h[k] = EMPTY_SEARCH }
29
+ @specs = {}
30
+ @duplicates = {}
31
31
 
32
32
  o.specs.each do |name, hash|
33
33
  @specs[name] = hash.dup
34
34
  end
35
- o.all_specs.each do |name, array|
36
- @all_specs[name] = array.dup
35
+ o.duplicates.each do |name, array|
36
+ @duplicates[name] = array.dup
37
37
  end
38
38
  end
39
39
 
@@ -46,12 +46,11 @@ module Bundler
46
46
  true
47
47
  end
48
48
 
49
- def search_all(name)
50
- all_matches = local_search(name) + @all_specs[name]
51
- @sources.each do |source|
52
- all_matches.concat(source.search_all(name))
53
- end
54
- all_matches
49
+ def search_all(name, &blk)
50
+ return enum_for(:search_all, name) unless blk
51
+ specs_by_name(name).each(&blk)
52
+ @duplicates[name]&.each(&blk)
53
+ @sources.each {|source| source.search_all(name, &blk) }
55
54
  end
56
55
 
57
56
  # Search this index's specs, and any source indexes that this index knows
@@ -61,11 +60,14 @@ module Bundler
61
60
  return results unless @sources.any?
62
61
 
63
62
  @sources.each do |source|
64
- results.concat(source.search(query))
63
+ results = safe_concat(results, source.search(query))
65
64
  end
66
- results.uniq(&:full_name)
65
+ results.uniq!(&:full_name) unless results.empty? # avoid modifying frozen EMPTY_SEARCH
66
+ results
67
67
  end
68
68
 
69
+ alias_method :[], :search
70
+
69
71
  def local_search(query)
70
72
  case query
71
73
  when Gem::Specification, RemoteSpecification, LazySpecification, EndpointSpecification then search_by_spec(query)
@@ -76,12 +78,10 @@ module Bundler
76
78
  end
77
79
  end
78
80
 
79
- alias_method :[], :search
80
-
81
- def <<(spec)
82
- @specs[spec.name][spec.full_name] = spec
83
- spec
81
+ def add(spec)
82
+ (@specs[spec.name] ||= {}).store(spec.full_name, spec)
84
83
  end
84
+ alias_method :<<, :add
85
85
 
86
86
  def each(&blk)
87
87
  return enum_for(:each) unless blk
@@ -115,15 +115,25 @@ module Bundler
115
115
  names.uniq
116
116
  end
117
117
 
118
- def use(other, override_dupes = false)
118
+ # Combines indexes proritizing existing specs, like `Hash#reverse_merge!`
119
+ # Duplicate specs found in `other` are stored in `@duplicates`.
120
+ def use(other)
119
121
  return unless other
120
- other.each do |s|
121
- if (dupes = search_by_spec(s)) && !dupes.empty?
122
- # safe to << since it's a new array when it has contents
123
- @all_specs[s.name] = dupes << s
124
- next unless override_dupes
122
+ other.each do |spec|
123
+ exist?(spec) ? add_duplicate(spec) : add(spec)
124
+ end
125
+ self
126
+ end
127
+
128
+ # Combines indexes proritizing specs from `other`, like `Hash#merge!`
129
+ # Duplicate specs found in `self` are saved in `@duplicates`.
130
+ def merge!(other)
131
+ return unless other
132
+ other.each do |spec|
133
+ if existing = find_by_spec(spec)
134
+ add_duplicate(existing)
125
135
  end
126
- self << s
136
+ add spec
127
137
  end
128
138
  self
129
139
  end
@@ -157,19 +167,40 @@ module Bundler
157
167
 
158
168
  private
159
169
 
170
+ def safe_concat(a, b)
171
+ return a if b.empty?
172
+ return b if a.empty?
173
+ a.concat(b)
174
+ end
175
+
176
+ def add_duplicate(spec)
177
+ (@duplicates[spec.name] ||= []) << spec
178
+ end
179
+
160
180
  def specs_by_name_and_version(name, version)
161
- specs_by_name(name).select {|spec| spec.version == version }
181
+ results = @specs[name]&.values
182
+ return EMPTY_SEARCH unless results
183
+ results.select! {|spec| spec.version == version }
184
+ results
162
185
  end
163
186
 
164
187
  def specs_by_name(name)
165
- @specs[name].values
188
+ @specs[name]&.values || EMPTY_SEARCH
166
189
  end
167
190
 
168
191
  EMPTY_SEARCH = [].freeze
169
192
 
170
193
  def search_by_spec(spec)
171
- spec = @specs[spec.name][spec.full_name]
194
+ spec = find_by_spec(spec)
172
195
  spec ? [spec] : EMPTY_SEARCH
173
196
  end
197
+
198
+ def find_by_spec(spec)
199
+ @specs[spec.name]&.fetch(spec.full_name, nil)
200
+ end
201
+
202
+ def exist?(spec)
203
+ @specs[spec.name]&.key?(spec.full_name)
204
+ end
174
205
  end
175
206
  end
@@ -96,7 +96,7 @@ module Bundler
96
96
  handle_error if failed_specs.any?
97
97
  @specs
98
98
  ensure
99
- worker_pool && worker_pool.stop
99
+ worker_pool&.stop
100
100
  end
101
101
 
102
102
  def check_for_unmet_dependencies
@@ -55,13 +55,20 @@ module Bundler
55
55
  if spec.source.instance_of?(Source::Path) && spec.source.path.absolute?
56
56
  full_path
57
57
  else
58
- Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
58
+ relative_path_from(Bundler.root.join(bundler_path), :to => full_path) || full_path
59
59
  end
60
60
  rescue TypeError
61
61
  error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
62
62
  raise Gem::InvalidSpecificationException.new(error_message)
63
63
  end
64
64
 
65
+ def relative_path_from(source, to:)
66
+ Pathname.new(to).relative_path_from(source).to_s
67
+ rescue ArgumentError
68
+ # on Windows, if source and destination are on different drivers, there's no relative path from one to the other
69
+ nil
70
+ end
71
+
65
72
  def define_path_helpers
66
73
  <<~'END'
67
74
  unless defined?(Gem)
@@ -110,21 +110,9 @@ module Bundler
110
110
  def parse_source(line)
111
111
  case line
112
112
  when SPECS
113
- case @type
114
- when PATH
115
- @current_source = TYPES[@type].from_lock(@opts)
116
- @sources << @current_source
117
- when GIT
118
- @current_source = TYPES[@type].from_lock(@opts)
119
- @sources << @current_source
120
- when GEM
121
- @opts["remotes"] = Array(@opts.delete("remote")).reverse
122
- @current_source = TYPES[@type].from_lock(@opts)
123
- @sources << @current_source
124
- when PLUGIN
125
- @current_source = Plugin.source_from_lock(@opts)
126
- @sources << @current_source
127
- end
113
+ return unless TYPES.key?(@type)
114
+ @current_source = TYPES[@type].from_lock(@opts)
115
+ @sources << @current_source
128
116
  when OPTIONS
129
117
  value = $2
130
118
  value = true if value == "true"
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-ADD" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-ADD" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-BINSTUBS" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-BINSTUBS" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CACHE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CACHE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CHECK" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CHECK" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CLEAN" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CLEAN" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONFIG" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CONFIG" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-config\fR \- Set bundler configuration options
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-CONSOLE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-CONSOLE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-console\fR \- Deprecated way to open an IRB session with the bundle pre\-loaded
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-DOCTOR" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-DOCTOR" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-doctor\fR \- Checks the bundle for common problems
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-EXEC" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-EXEC" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-exec\fR \- Execute a command in the context of the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-GEM" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-GEM" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-gem\fR \- Generate a project skeleton for creating a rubygem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-HELP" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-HELP" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-help\fR \- Displays detailed help for each subcommand
@@ -1,16 +1,16 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INFO" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-INFO" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-info\fR \- Show information for the given gem in your bundle
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBbundle info\fR [GEM] [\-\-path]
10
+ \fBbundle info\fR [GEM_NAME] [\-\-path]
11
11
  .
12
12
  .SH "DESCRIPTION"
13
- Print the basic information about the provided GEM such as homepage, version, path and summary\.
13
+ Given a gem name present in your bundle, print the basic information about it such as homepage, version, path and summary\.
14
14
  .
15
15
  .SH "OPTIONS"
16
16
  .
@@ -3,13 +3,13 @@ bundle-info(1) -- Show information for the given gem in your bundle
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `bundle info` [GEM]
6
+ `bundle info` [GEM_NAME]
7
7
  [--path]
8
8
 
9
9
  ## DESCRIPTION
10
10
 
11
- Print the basic information about the provided GEM such as homepage, version,
12
- path and summary.
11
+ Given a gem name present in your bundle, print the basic information about it
12
+ such as homepage, version, path and summary.
13
13
 
14
14
  ## OPTIONS
15
15
 
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INIT" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-INIT" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-init\fR \- Generates a Gemfile into the current working directory
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INJECT" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-INJECT" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-inject\fR \- Add named gem(s) with version requirements to Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-INSTALL" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-INSTALL" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-install\fR \- Install the dependencies specified in your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LIST" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-LIST" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-list\fR \- List all the gems in the bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-LOCK" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-LOCK" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-lock\fR \- Creates / Updates a lockfile without installing
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OPEN" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-OPEN" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-open\fR \- Opens the source directory for a gem in your bundle
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-OUTDATED" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-OUTDATED" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-outdated\fR \- List installed gems with newer versions available
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLATFORM" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-PLATFORM" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-platform\fR \- Displays platform compatibility information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PLUGIN" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-PLUGIN" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-plugin\fR \- Manage Bundler plugins
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-PRISTINE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-PRISTINE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-REMOVE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-REMOVE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-remove\fR \- Removes gems from the Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-SHOW" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-SHOW" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-UPDATE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-UPDATE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-update\fR \- Update your gems to the latest available versions
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VERSION" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-VERSION" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-version\fR \- Prints Bundler version information
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE\-VIZ" "1" "July 2023" "" ""
4
+ .TH "BUNDLE\-VIZ" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "BUNDLE" "1" "July 2023" "" ""
4
+ .TH "BUNDLE" "1" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBbundle\fR \- Ruby Dependency Management
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "GEMFILE" "5" "July 2023" "" ""
4
+ .TH "GEMFILE" "5" "August 2023" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
@@ -85,6 +85,30 @@ ruby "3\.1\.2"
85
85
  .
86
86
  .IP "" 0
87
87
  .
88
+ .P
89
+ If you wish to derive your Ruby version from a version file (ie \.ruby\-version), you can use the \fBfile\fR option instead\.
90
+ .
91
+ .IP "" 4
92
+ .
93
+ .nf
94
+
95
+ ruby file: "\.ruby\-version"
96
+ .
97
+ .fi
98
+ .
99
+ .IP "" 0
100
+ .
101
+ .P
102
+ The version file should conform to any of the following formats:
103
+ .
104
+ .IP "\(bu" 4
105
+ \fB3\.1\.2\fR (\.ruby\-version)
106
+ .
107
+ .IP "\(bu" 4
108
+ \fBruby 3\.1\.2\fR (\.tool\-versions, read: https://asdf\-vm\.com/manage/configuration\.html#tool\-versions)
109
+ .
110
+ .IP "" 0
111
+ .
88
112
  .SS "ENGINE"
89
113
  Each application \fImay\fR specify a Ruby engine\. If an engine is specified, an engine version \fImust\fR also be specified\.
90
114
  .
@@ -69,6 +69,16 @@ should be the Ruby version that the engine is compatible with.
69
69
 
70
70
  ruby "3.1.2"
71
71
 
72
+ If you wish to derive your Ruby version from a version file (ie .ruby-version),
73
+ you can use the `file` option instead.
74
+
75
+ ruby file: ".ruby-version"
76
+
77
+ The version file should conform to any of the following formats:
78
+
79
+ - `3.1.2` (.ruby-version)
80
+ - `ruby 3.1.2` (.tool-versions, read: https://asdf-vm.com/manage/configuration.html#tool-versions)
81
+
72
82
  ### ENGINE
73
83
 
74
84
  Each application _may_ specify a Ruby engine. If an engine is specified, an
@@ -146,7 +146,7 @@ module Bundler
146
146
  # @param [Boolean] is the index file global index
147
147
  def load_index(index_file, global = false)
148
148
  SharedHelpers.filesystem_access(index_file, :read) do |index_f|
149
- valid_file = index_f && index_f.exist? && !index_f.size.zero?
149
+ valid_file = index_f&.exist? && !index_f.size.zero?
150
150
  break unless valid_file
151
151
 
152
152
  data = index_f.read
@@ -197,7 +197,7 @@ module Bundler
197
197
  # @param [Hash] The options that are present in the lock file
198
198
  # @return [API::Source] the instance of the class that handles the source
199
199
  # type passed in locked_opts
200
- def source_from_lock(locked_opts)
200
+ def from_lock(locked_opts)
201
201
  src = source(locked_opts["type"])
202
202
 
203
203
  src.new(locked_opts.merge("uri" => locked_opts["remote"]))
@@ -37,9 +37,17 @@ module Bundler
37
37
  root_version = Resolver::Candidate.new(0)
38
38
 
39
39
  @all_specs = Hash.new do |specs, name|
40
- specs[name] = source_for(name).specs.search(name).reject do |s|
41
- s.dependencies.any? {|d| d.name == name && !d.requirement.satisfied_by?(s.version) } # ignore versions that depend on themselves incorrectly
42
- end.sort_by {|s| [s.version, s.platform.to_s] }
40
+ source = source_for(name)
41
+ matches = source.specs.search(name)
42
+
43
+ # Don't bother to check for circular deps when no dependency API are
44
+ # available, since it's too slow to be usable. That edge case won't work
45
+ # but resolution other than that should work fine and reasonably fast.
46
+ if source.respond_to?(:dependency_api_available?) && source.dependency_api_available?
47
+ matches = filter_invalid_self_dependencies(matches, name)
48
+ end
49
+
50
+ specs[name] = matches.sort_by {|s| [s.version, s.platform.to_s] }
43
51
  end
44
52
 
45
53
  @sorted_versions = Hash.new do |candidates, package|
@@ -318,6 +326,13 @@ module Bundler
318
326
  specs.reject {|s| s.version.prerelease? }
319
327
  end
320
328
 
329
+ # Ignore versions that depend on themselves incorrectly
330
+ def filter_invalid_self_dependencies(specs, name)
331
+ specs.reject do |s|
332
+ s.dependencies.any? {|d| d.name == name && !d.requirement.satisfied_by?(s.version) }
333
+ end
334
+ end
335
+
321
336
  def requirement_satisfied_by?(requirement, spec)
322
337
  requirement.satisfied_by?(spec.version) || spec.source.is_a?(Source::Gemspec)
323
338
  end