rubygems-update 3.5.10 → 3.5.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +60 -1
  3. data/CODE_OF_CONDUCT.md +79 -28
  4. data/CONTRIBUTING.md +2 -2
  5. data/Manifest.txt +2 -0
  6. data/bundler/CHANGELOG.md +48 -0
  7. data/bundler/lib/bundler/build_metadata.rb +2 -2
  8. data/bundler/lib/bundler/cli/install.rb +1 -1
  9. data/bundler/lib/bundler/cli.rb +5 -8
  10. data/bundler/lib/bundler/compact_index_client/cache.rb +47 -72
  11. data/bundler/lib/bundler/compact_index_client/parser.rb +84 -0
  12. data/bundler/lib/bundler/compact_index_client.rb +51 -80
  13. data/bundler/lib/bundler/constants.rb +8 -1
  14. data/bundler/lib/bundler/definition.rb +21 -27
  15. data/bundler/lib/bundler/errors.rb +14 -0
  16. data/bundler/lib/bundler/fetcher/compact_index.rb +15 -24
  17. data/bundler/lib/bundler/gem_helper.rb +1 -1
  18. data/bundler/lib/bundler/installer/gem_installer.rb +0 -1
  19. data/bundler/lib/bundler/installer.rb +8 -8
  20. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  21. data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
  22. data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
  23. data/bundler/lib/bundler/man/bundle-check.1 +1 -1
  24. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  25. data/bundler/lib/bundler/man/bundle-config.1 +2 -2
  26. data/bundler/lib/bundler/man/bundle-config.1.ronn +1 -1
  27. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-plugin.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  45. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  46. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  47. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  48. data/bundler/lib/bundler/man/bundle.1 +1 -1
  49. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  50. data/bundler/lib/bundler/rubygems_ext.rb +20 -12
  51. data/bundler/lib/bundler/rubygems_integration.rb +14 -0
  52. data/bundler/lib/bundler/self_manager.rb +6 -1
  53. data/bundler/lib/bundler/settings.rb +12 -8
  54. data/bundler/lib/bundler/setup.rb +3 -0
  55. data/bundler/lib/bundler/shared_helpers.rb +6 -4
  56. data/bundler/lib/bundler/source/git/git_proxy.rb +8 -0
  57. data/bundler/lib/bundler/source/git.rb +14 -0
  58. data/bundler/lib/bundler/source/metadata.rb +2 -0
  59. data/bundler/lib/bundler/source/path.rb +0 -13
  60. data/bundler/lib/bundler/source/rubygems.rb +32 -15
  61. data/bundler/lib/bundler/source_list.rb +13 -2
  62. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +77 -29
  63. data/bundler/lib/bundler/version.rb +1 -1
  64. data/bundler/lib/bundler/yaml_serializer.rb +1 -8
  65. data/bundler/lib/bundler.rb +6 -1
  66. data/exe/update_rubygems +1 -1
  67. data/lib/rubygems/basic_specification.rb +27 -0
  68. data/lib/rubygems/commands/pristine_command.rb +12 -9
  69. data/lib/rubygems/commands/setup_command.rb +2 -0
  70. data/lib/rubygems/commands/uninstall_command.rb +1 -1
  71. data/lib/rubygems/dependency.rb +1 -13
  72. data/lib/rubygems/ext/cargo_builder.rb +1 -16
  73. data/lib/rubygems/installer.rb +1 -1
  74. data/lib/rubygems/package/tar_header.rb +20 -4
  75. data/lib/rubygems/package.rb +0 -1
  76. data/lib/rubygems/platform.rb +1 -0
  77. data/lib/rubygems/specification.rb +45 -118
  78. data/lib/rubygems/specification_policy.rb +3 -1
  79. data/lib/rubygems/specification_record.rb +212 -0
  80. data/lib/rubygems/stub_specification.rb +21 -0
  81. data/lib/rubygems/uninstaller.rb +26 -19
  82. data/lib/rubygems/util/licenses.rb +25 -0
  83. data/lib/rubygems/yaml_serializer.rb +1 -8
  84. data/lib/rubygems.rb +8 -1
  85. data/rubygems-update.gemspec +1 -1
  86. metadata +5 -3
@@ -2,83 +2,131 @@
2
2
 
3
3
  ## Our Pledge
4
4
 
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
6
11
 
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
8
14
 
9
15
  ## Our Standards
10
16
 
11
- Examples of behavior that contributes to a positive environment for our community include:
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
12
19
 
13
20
  * Demonstrating empathy and kindness toward other people
14
21
  * Being respectful of differing opinions, viewpoints, and experiences
15
22
  * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
18
27
 
19
28
  Examples of unacceptable behavior include:
20
29
 
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
23
32
  * Trolling, insulting or derogatory comments, and personal or political attacks
24
33
  * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
27
36
  * Other conduct which could reasonably be considered inappropriate in a
28
37
  professional setting
29
38
 
30
39
  ## Enforcement Responsibilities
31
40
 
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
33
45
 
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
35
50
 
36
51
  ## Scope
37
52
 
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
39
58
 
40
59
  ## Enforcement
41
60
 
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at <%= config[:email] %>. All complaints will be reviewed and investigated promptly and fairly.
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
43
65
 
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
45
68
 
46
69
  ## Enforcement Guidelines
47
70
 
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
49
73
 
50
74
  ### 1. Correction
51
75
 
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
53
78
 
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
55
82
 
56
83
  ### 2. Warning
57
84
 
58
- **Community Impact**: A violation through a single incident or series of actions.
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
59
87
 
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
61
94
 
62
95
  ### 3. Temporary Ban
63
96
 
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
65
99
 
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
67
105
 
68
106
  ### 4. Permanent Ban
69
107
 
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
71
111
 
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
73
114
 
74
115
  ## Attribution
75
116
 
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
78
120
 
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
82
123
 
83
124
  For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.5.10".freeze
4
+ VERSION = "2.5.12".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
@@ -60,7 +60,6 @@ module Bundler
60
60
  indent, key, quote, val = match.captures
61
61
  val = strip_comment(val)
62
62
 
63
- convert_to_backward_compatible_key!(key)
64
63
  depth = indent.size / 2
65
64
  if quote.empty? && val.empty?
66
65
  new_hash = {}
@@ -92,14 +91,8 @@ module Bundler
92
91
  end
93
92
  end
94
93
 
95
- # for settings' keys
96
- def convert_to_backward_compatible_key!(key)
97
- key << "/" if /https?:/i.match?(key) && !%r{/\Z}.match?(key)
98
- key.gsub!(".", "__")
99
- end
100
-
101
94
  class << self
102
- private :dump_hash, :convert_to_backward_compatible_key!
95
+ private :dump_hash
103
96
  end
104
97
  end
105
98
  end
@@ -42,6 +42,7 @@ module Bundler
42
42
  autoload :Checksum, File.expand_path("bundler/checksum", __dir__)
43
43
  autoload :CLI, File.expand_path("bundler/cli", __dir__)
44
44
  autoload :CIDetector, File.expand_path("bundler/ci_detector", __dir__)
45
+ autoload :CompactIndexClient, File.expand_path("bundler/compact_index_client", __dir__)
45
46
  autoload :Definition, File.expand_path("bundler/definition", __dir__)
46
47
  autoload :Dependency, File.expand_path("bundler/dependency", __dir__)
47
48
  autoload :Deprecate, File.expand_path("bundler/deprecate", __dir__)
@@ -166,6 +167,10 @@ module Bundler
166
167
  end
167
168
  end
168
169
 
170
+ def auto_switch
171
+ self_manager.restart_with_locked_bundler_if_needed
172
+ end
173
+
169
174
  # Automatically install dependencies if Bundler.settings[:auto_install] exists.
170
175
  # This is set through config cmd `bundle config set --global auto_install 1`.
171
176
  #
@@ -356,7 +361,7 @@ module Bundler
356
361
  def settings
357
362
  @settings ||= Settings.new(app_config_path)
358
363
  rescue GemfileNotFound
359
- @settings = Settings.new(Pathname.new(".bundle").expand_path)
364
+ @settings = Settings.new
360
365
  end
361
366
 
362
367
  # @return [Hash] Environment present before Bundler was activated
data/exe/update_rubygems CHANGED
@@ -34,5 +34,5 @@ else
34
34
  update_dir = File.dirname(update_dir)
35
35
  Dir.chdir update_dir
36
36
  ENV["GEM_PREV_VER"] = Gem::VERSION
37
- abort unless system(Gem.ruby, "setup.rb", *ARGV)
37
+ abort unless system(Gem.ruby, "--disable-gems", "setup.rb", *ARGV)
38
38
  end
@@ -98,6 +98,20 @@ class Gem::BasicSpecification
98
98
  File.dirname(loaded_from) == Gem.default_specifications_dir
99
99
  end
100
100
 
101
+ ##
102
+ # Regular gems take precedence over default gems
103
+
104
+ def default_gem_priority
105
+ default_gem? ? 1 : -1
106
+ end
107
+
108
+ ##
109
+ # Gems higher up in +gem_path+ take precedence
110
+
111
+ def base_dir_priority(gem_path)
112
+ gem_path.index(base_dir) || gem_path.size
113
+ end
114
+
101
115
  ##
102
116
  # Returns full path to the directory where gem's extensions are installed.
103
117
 
@@ -143,6 +157,19 @@ class Gem::BasicSpecification
143
157
  end
144
158
  end
145
159
 
160
+ ##
161
+ # Returns the full name of this Gem (see `Gem::BasicSpecification#full_name`).
162
+ # Information about where the gem is installed is also included if not
163
+ # installed in the default GEM_HOME.
164
+
165
+ def full_name_with_location
166
+ if base_dir != Gem.dir
167
+ "#{full_name} in #{base_dir}"
168
+ else
169
+ full_name
170
+ end
171
+ end
172
+
146
173
  ##
147
174
  # Full paths in the gem to add to <code>$LOAD_PATH</code> when this gem is
148
175
  # activated.
@@ -57,7 +57,7 @@ class Gem::Commands::PristineCommand < Gem::Command
57
57
  end
58
58
 
59
59
  add_option("-i", "--install-dir DIR",
60
- "Gem repository to get binstubs and plugins installed") do |value, options|
60
+ "Gem repository to get gems restored") do |value, options|
61
61
  options[:install_dir] = File.expand_path(value)
62
62
  end
63
63
 
@@ -103,21 +103,25 @@ extensions will be restored.
103
103
  end
104
104
 
105
105
  def execute
106
+ install_dir = options[:install_dir]
107
+
108
+ specification_record = install_dir ? Gem::SpecificationRecord.from_path(install_dir) : Gem::Specification.specification_record
109
+
106
110
  specs = if options[:all]
107
- Gem::Specification.map
111
+ specification_record.map
108
112
 
109
113
  # `--extensions` must be explicitly given to pristine only gems
110
114
  # with extensions.
111
115
  elsif options[:extensions_set] &&
112
116
  options[:extensions] && options[:args].empty?
113
- Gem::Specification.select do |spec|
117
+ specification_record.select do |spec|
114
118
  spec.extensions && !spec.extensions.empty?
115
119
  end
116
120
  elsif options[:only_missing_extensions]
117
- Gem::Specification.select(&:missing_extensions?)
121
+ specification_record.select(&:missing_extensions?)
118
122
  else
119
123
  get_all_gem_names.sort.map do |gem_name|
120
- Gem::Specification.find_all_by_name(gem_name, options[:version]).reverse
124
+ specification_record.find_all_by_name(gem_name, options[:version]).reverse
121
125
  end.flatten
122
126
  end
123
127
 
@@ -144,7 +148,7 @@ extensions will be restored.
144
148
  end
145
149
 
146
150
  unless spec.extensions.empty? || options[:extensions] || options[:only_executables] || options[:only_plugins]
147
- say "Skipped #{spec.full_name}, it needs to compile an extension"
151
+ say "Skipped #{spec.full_name_with_location}, it needs to compile an extension"
148
152
  next
149
153
  end
150
154
 
@@ -153,7 +157,7 @@ extensions will be restored.
153
157
  unless File.exist?(gem) || options[:only_executables] || options[:only_plugins]
154
158
  require_relative "../remote_fetcher"
155
159
 
156
- say "Cached gem for #{spec.full_name} not found, attempting to fetch..."
160
+ say "Cached gem for #{spec.full_name_with_location} not found, attempting to fetch..."
157
161
 
158
162
  dep = Gem::Dependency.new spec.name, spec.version
159
163
  found, _ = Gem::SpecFetcher.fetcher.spec_for_dependency dep
@@ -176,7 +180,6 @@ extensions will be restored.
176
180
  end
177
181
 
178
182
  bin_dir = options[:bin_dir] if options[:bin_dir]
179
- install_dir = options[:install_dir] if options[:install_dir]
180
183
 
181
184
  installer_options = {
182
185
  wrappers: true,
@@ -198,7 +201,7 @@ extensions will be restored.
198
201
  installer.install
199
202
  end
200
203
 
201
- say "Restored #{spec.full_name}"
204
+ say "Restored #{spec.full_name_with_location}"
202
205
  end
203
206
  end
204
207
  end
@@ -585,6 +585,8 @@ abort "#{deprecation_message}"
585
585
 
586
586
  args = %w[--all --only-executables --silent]
587
587
  args << "--bindir=#{bindir}"
588
+ args << "--install-dir=#{default_dir}"
589
+
588
590
  if options[:env_shebang]
589
591
  args << "--env-shebang"
590
592
  end
@@ -184,7 +184,7 @@ that is a dependency of an existing gem. You can use the
184
184
  rescue Gem::GemNotInHomeException => e
185
185
  spec = e.spec
186
186
  alert("In order to remove #{spec.name}, please execute:\n" \
187
- "\tgem uninstall #{spec.name} --install-dir=#{spec.installation_path}")
187
+ "\tgem uninstall #{spec.name} --install-dir=#{spec.base_dir}")
188
188
  rescue Gem::UninstallError => e
189
189
  spec = e.spec
190
190
  alert_error("Error: unable to successfully uninstall '#{spec.name}' which is " \
@@ -271,15 +271,7 @@ class Gem::Dependency
271
271
  end
272
272
 
273
273
  def matching_specs(platform_only = false)
274
- env_req = Gem.env_requirement(name)
275
- matches = Gem::Specification.stubs_for(name).find_all do |spec|
276
- requirement.satisfied_by?(spec.version) && env_req.satisfied_by?(spec.version)
277
- end.map(&:to_spec)
278
-
279
- if prioritizes_bundler?
280
- require_relative "bundler_version_finder"
281
- Gem::BundlerVersionFinder.prioritize!(matches)
282
- end
274
+ matches = Gem::Specification.find_all_by_name(name, requirement)
283
275
 
284
276
  if platform_only
285
277
  matches.reject! do |spec|
@@ -297,10 +289,6 @@ class Gem::Dependency
297
289
  @requirement.specific?
298
290
  end
299
291
 
300
- def prioritizes_bundler?
301
- name == "bundler" && !specific?
302
- end
303
-
304
292
  def to_specs
305
293
  matches = matching_specs true
306
294
 
@@ -185,6 +185,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
185
185
  end
186
186
 
187
187
  def cargo_dylib_path(dest_path, crate_name)
188
+ so_ext = RbConfig::CONFIG["SOEXT"]
188
189
  prefix = so_ext == "dll" ? "" : "lib"
189
190
  path_parts = [dest_path]
190
191
  path_parts << ENV["CARGO_BUILD_TARGET"] if ENV["CARGO_BUILD_TARGET"]
@@ -313,22 +314,6 @@ EOF
313
314
  deffile_path
314
315
  end
315
316
 
316
- # We have to basically reimplement <code>RbConfig::CONFIG['SOEXT']</code> here to support
317
- # Ruby < 2.5
318
- #
319
- # @see https://github.com/ruby/ruby/blob/c87c027f18c005460746a74c07cd80ee355b16e4/configure.ac#L3185
320
- def so_ext
321
- return RbConfig::CONFIG["SOEXT"] if RbConfig::CONFIG.key?("SOEXT")
322
-
323
- if win_target?
324
- "dll"
325
- elsif darwin_target?
326
- "dylib"
327
- else
328
- "so"
329
- end
330
- end
331
-
332
317
  # Corresponds to $(LIBPATH) in mkmf
333
318
  def mkmf_libpath
334
319
  ["-L", "native=#{makefile_config("libdir")}"]
@@ -344,7 +344,7 @@ class Gem::Installer
344
344
 
345
345
  say spec.post_install_message if options[:post_install_message] && !spec.post_install_message.nil?
346
346
 
347
- Gem::Specification.add_spec(spec)
347
+ Gem::Specification.add_spec(spec) unless @install_dir
348
348
 
349
349
  load_plugin
350
350
 
@@ -95,14 +95,14 @@ class Gem::Package::TarHeader
95
95
 
96
96
  attr_reader(*FIELDS)
97
97
 
98
- EMPTY_HEADER = ("\0" * 512).freeze # :nodoc:
98
+ EMPTY_HEADER = ("\0" * 512).b.freeze # :nodoc:
99
99
 
100
100
  ##
101
101
  # Creates a tar header from IO +stream+
102
102
 
103
103
  def self.from(stream)
104
104
  header = stream.read 512
105
- empty = (header == EMPTY_HEADER)
105
+ return EMPTY if header == EMPTY_HEADER
106
106
 
107
107
  fields = header.unpack UNPACK_FORMAT
108
108
 
@@ -123,7 +123,7 @@ class Gem::Package::TarHeader
123
123
  devminor: strict_oct(fields.shift),
124
124
  prefix: fields.shift,
125
125
 
126
- empty: empty
126
+ empty: false
127
127
  end
128
128
 
129
129
  def self.strict_oct(str)
@@ -172,6 +172,22 @@ class Gem::Package::TarHeader
172
172
  @empty = vals[:empty]
173
173
  end
174
174
 
175
+ EMPTY = new({ # :nodoc:
176
+ checksum: 0,
177
+ gname: "",
178
+ linkname: "",
179
+ magic: "",
180
+ mode: 0,
181
+ name: "",
182
+ prefix: "",
183
+ size: 0,
184
+ uname: "",
185
+ version: 0,
186
+
187
+ empty: true,
188
+ }).freeze
189
+ private_constant :EMPTY
190
+
175
191
  ##
176
192
  # Is the tar entry empty?
177
193
 
@@ -241,7 +257,7 @@ class Gem::Package::TarHeader
241
257
 
242
258
  header = header.pack PACK_FORMAT
243
259
 
244
- header << ("\0" * ((512 - header.size) % 512))
260
+ header.ljust 512, "\0"
245
261
  end
246
262
 
247
263
  def oct(num, len)
@@ -294,7 +294,6 @@ class Gem::Package
294
294
 
295
295
  Gem.load_yaml
296
296
 
297
- @spec.mark_version
298
297
  @spec.validate true, strict_validation unless skip_validation
299
298
 
300
299
  setup_signer(
@@ -134,6 +134,7 @@ class Gem::Platform
134
134
  when /netbsdelf/ then ["netbsdelf", nil]
135
135
  when /openbsd(\d+\.\d+)?/ then ["openbsd", $1]
136
136
  when /solaris(\d+\.\d+)?/ then ["solaris", $1]
137
+ when /wasi/ then ["wasi", nil]
137
138
  # test
138
139
  when /^(\w+_platform)(\d+)?/ then [$1, $2]
139
140
  else ["unknown", nil]