rubygems-update 3.2.25 → 3.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a868e187974e482e1edf68ec0ff267398188892b84efd935be11cb3b841c278
4
- data.tar.gz: e218469751b1378c58b757575903cb34f85837fcbdba0856b0ac1be9383acdc2
3
+ metadata.gz: 7512a42ddcfe60a9e59f8e41784a0231ef8475623d8d26049b9a569464f29362
4
+ data.tar.gz: 55bf6b6feb583c388c333bbda49a6cfea16b5ab4fbdd0729f3848b8e43446e61
5
5
  SHA512:
6
- metadata.gz: 36a8dd7b54b4cff11c91a07c73896df1b502ffa7e2edae1bee6146b91141029938ca19d59492b801cdd129b3a5a3e3c22c9a44ebce3f457e2583b10f9927d2cd
7
- data.tar.gz: 97f3152994341dcc1004b661beee9599b09a88727969014387acf45124b309db8751d08a562314f52924cd916545e69cd2249339a68079794e2cac379c11d7fb
6
+ metadata.gz: d517a10dc959cac467f01ae031b055d7de7cfe5f325ee78105b58d75069f9b239c5f8fbcd3ae1541a63bf7c5f148791dc4366a84a7c7f6465a689c8e2375784f
7
+ data.tar.gz: 0bc64e82a79dac9d2dad0af7471ab9587eddeb2795b20651fa8a8f30eb8915fd56080984806d1c12b15b84890308e264011d45dd22b55945c11b02009aec4f88
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ # 3.2.26 / 2021-08-17
2
+
3
+ ## Enhancements:
4
+
5
+ * Enhance the error handling for loading the
6
+ `rubygems/defaults/operating_system` file. Pull request #4824 by
7
+ intuxicated
8
+ * Ignore `RUBYGEMS_GEMDEPS` for the bundler gem. Pull request #4532 by
9
+ deivid-rodriguez
10
+
11
+ ## Bug fixes:
12
+
13
+ * Also load user installed rubygems plugins. Pull request #4829 by
14
+ deivid-rodriguez
15
+
1
16
  # 3.2.25 / 2021-07-30
2
17
 
3
18
  ## Enhancements:
data/Manifest.txt CHANGED
@@ -687,6 +687,7 @@ test/rubygems/test_kernel.rb
687
687
  test/rubygems/test_project_sanity.rb
688
688
  test/rubygems/test_remote_fetch_error.rb
689
689
  test/rubygems/test_require.rb
690
+ test/rubygems/test_rubygems.rb
690
691
  test/rubygems/utilities.rb
691
692
  test/rubygems/wrong_key_cert.pem
692
693
  test/rubygems/wrong_key_cert_32.pem
data/bundler/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ # 2.2.26 (August 17, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Remove `RUBYGEMS_GEMDEPS` warning [#4827](https://github.com/rubygems/rubygems/pull/4827)
6
+ - Better defaults for GitHub Actions template generated by `bundle gem` [#4619](https://github.com/rubygems/rubygems/pull/4619)
7
+ - Make `bundle exec` keep file descriptors by default [#4812](https://github.com/rubygems/rubygems/pull/4812)
8
+ - Exclude gemspec file itself from file list of gems generated by `bundle gem` [#4650](https://github.com/rubygems/rubygems/pull/4650)
9
+ - Fix a couple small typos in deprecation / error messages [#4806](https://github.com/rubygems/rubygems/pull/4806)
10
+ - Make script generated by `bundle install --standalone` resilient to moving the application to a differently nested folder when `path` sources are used [#4792](https://github.com/rubygems/rubygems/pull/4792)
11
+ - Exclude CI files and issue templates from file list of gems generated by `bundle gem` [#4033](https://github.com/rubygems/rubygems/pull/4033)
12
+
13
+ ## Bug fixes:
14
+
15
+ - Respect `BUNDLE_USER_HOME` env when choosing config location [#4828](https://github.com/rubygems/rubygems/pull/4828)
16
+ - Fix `bundle gem` on path with spaces [#4816](https://github.com/rubygems/rubygems/pull/4816)
17
+ - Fix bundler hitting the network in some cases where not allowed [#4805](https://github.com/rubygems/rubygems/pull/4805)
18
+
1
19
  # 2.2.25 (July 30, 2021)
2
20
 
3
21
  ## Deprecations:
@@ -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 = "2021-07-30".freeze
8
- @git_commit_sha = "7f0f257c7a".freeze
7
+ @built_at = "2021-08-17".freeze
8
+ @git_commit_sha = "21fd333002".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
@@ -73,14 +73,6 @@ module Bundler
73
73
  Bundler.ui = UI::Shell.new(options)
74
74
  Bundler.ui.level = "debug" if options["verbose"]
75
75
  unprinted_warnings.each {|w| Bundler.ui.warn(w) }
76
-
77
- if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
78
- Bundler.ui.warn(
79
- "The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
80
- "experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
81
- "To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
82
- )
83
- end
84
76
  end
85
77
 
86
78
  check_unknown_options!(:except => [:config, :exec])
@@ -469,7 +461,7 @@ module Bundler
469
461
  map aliases_for("cache")
470
462
 
471
463
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
472
- method_option :keep_file_descriptors, :type => :boolean, :default => false
464
+ method_option :keep_file_descriptors, :type => :boolean, :default => true
473
465
  method_option :gemfile, :type => :string, :required => false
474
466
  long_desc <<-D
475
467
  Exec runs a command, providing it access to the gems in the bundle. While using
@@ -477,6 +469,10 @@ module Bundler
477
469
  into the system wide RubyGems repository.
478
470
  D
479
471
  def exec(*args)
472
+ if ARGV.include?("--no-keep-file-descriptors")
473
+ SharedHelpers.major_deprecation(2, "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to")
474
+ end
475
+
480
476
  require_relative "cli/exec"
481
477
  Exec.new(options, args).run
482
478
  end
@@ -15,7 +15,7 @@ module Bundler
15
15
  definition.validate_runtime!
16
16
 
17
17
  begin
18
- definition.resolve_only_locally!
18
+ definition.resolve_with_cache!
19
19
  not_installed = definition.missing_specs
20
20
  rescue GemNotFound, VersionConflict
21
21
  Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
@@ -12,12 +12,7 @@ module Bundler
12
12
  @options = options
13
13
  @cmd = args.shift
14
14
  @args = args
15
-
16
- if !Bundler.current_ruby.jruby?
17
- @args << { :close_others => !options.keep_file_descriptors? }
18
- elsif options.keep_file_descriptors?
19
- Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
20
- end
15
+ @args << { :close_others => !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby?
21
16
  end
22
17
 
23
18
  def run
@@ -184,14 +184,15 @@ module Bundler
184
184
  )
185
185
  end
186
186
 
187
- if File.exist?(target) && !File.directory?(target)
187
+ if target.exist? && !target.directory?
188
188
  Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
189
189
  exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
190
190
  end
191
191
 
192
192
  if use_git
193
193
  Bundler.ui.info "Initializing git repo in #{target}"
194
- `git init #{target}`
194
+ require "shellwords"
195
+ `git init #{target.to_s.shellescape}`
195
196
 
196
197
  config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
197
198
  end
@@ -161,12 +161,6 @@ module Bundler
161
161
  @multisource_allowed
162
162
  end
163
163
 
164
- def resolve_only_locally!
165
- @remote = false
166
- sources.local_only!
167
- resolve
168
- end
169
-
170
164
  def resolve_with_cache!
171
165
  sources.cached!
172
166
  resolve
@@ -505,7 +499,7 @@ module Bundler
505
499
  end
506
500
 
507
501
  def precompute_source_requirements_for_indirect_dependencies?
508
- sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
502
+ @remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
509
503
  end
510
504
 
511
505
  def current_ruby_platform_locked?
@@ -457,7 +457,7 @@ repo_name ||= user_name
457
457
  def implicit_global_source_warning
458
458
  Bundler::SharedHelpers.major_deprecation 2, "This Gemfile does not include an explicit global source. " \
459
459
  "Not using an explicit global source may result in a different lockfile being generated depending on " \
460
- "the gems you have installed locally before bundler is run." \
460
+ "the gems you have installed locally before bundler is run. " \
461
461
  "Instead, define a global source in your Gemfile like this: source \"https://rubygems.org\"."
462
462
  end
463
463
 
@@ -122,7 +122,7 @@ module Bundler
122
122
 
123
123
  class VirtualProtocolError < BundlerError
124
124
  def message
125
- "There was an error relating to virtualization and file access." \
125
+ "There was an error relating to virtualization and file access. " \
126
126
  "It is likely that you need to grant access to or mount some file system correctly."
127
127
  end
128
128
 
@@ -12,12 +12,13 @@ module Bundler
12
12
  end
13
13
  File.open File.join(bundler_path, "setup.rb"), "w" do |file|
14
14
  file.puts "require 'rbconfig'"
15
- file.puts "ruby_engine = RUBY_ENGINE"
16
- file.puts "ruby_version = RbConfig::CONFIG[\"ruby_version\"]"
17
- file.puts "path = File.expand_path('..', __FILE__)"
18
15
  file.puts reverse_rubygems_kernel_mixin
19
16
  paths.each do |path|
20
- file.puts %($:.unshift File.expand_path("\#{path}/#{path}"))
17
+ if Pathname.new(path).absolute?
18
+ file.puts %($:.unshift "#{path}")
19
+ else
20
+ file.puts %($:.unshift File.expand_path("\#{__dir__}/#{path}"))
21
+ end
21
22
  end
22
23
  end
23
24
  end
@@ -28,14 +29,14 @@ module Bundler
28
29
  @specs.map do |spec|
29
30
  next if spec.name == "bundler"
30
31
  Array(spec.require_paths).map do |path|
31
- gem_path(path, spec).sub(version_dir, '#{ruby_engine}/#{ruby_version}')
32
+ gem_path(path, spec).sub(version_dir, '#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}')
32
33
  # This is a static string intentionally. It's interpolated at a later time.
33
34
  end
34
- end.flatten
35
+ end.flatten.compact
35
36
  end
36
37
 
37
38
  def version_dir
38
- "#{Bundler::RubyVersion.system.engine}/#{RbConfig::CONFIG["ruby_version"]}"
39
+ "#{RUBY_ENGINE}/#{RbConfig::CONFIG["ruby_version"]}"
39
40
  end
40
41
 
41
42
  def bundler_path
@@ -44,7 +45,11 @@ module Bundler
44
45
 
45
46
  def gem_path(path, spec)
46
47
  full_path = Pathname.new(path).absolute? ? path : File.join(spec.full_gem_path, path)
47
- Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
48
+ if spec.source.instance_of?(Source::Path)
49
+ full_path
50
+ else
51
+ Pathname.new(full_path).relative_path_from(Bundler.root.join(bundler_path)).to_s
52
+ end
48
53
  rescue TypeError
49
54
  error_message = "#{spec.name} #{spec.version} has an invalid gemspec"
50
55
  raise Gem::InvalidSpecificationException.new(error_message)
@@ -255,12 +255,6 @@ module Bundler
255
255
  next if name == "bundler"
256
256
  next unless search_for(requirement).empty?
257
257
 
258
- cache_message = begin
259
- " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
260
- rescue GemfileNotFound
261
- nil
262
- end
263
-
264
258
  if (base = @base[name]) && !base.empty?
265
259
  version = base.first.version
266
260
  message = "You have requested:\n" \
@@ -269,18 +263,17 @@ module Bundler
269
263
  "Try running `bundle update #{name}`\n\n" \
270
264
  "If you are updating multiple gems in your Gemfile at once,\n" \
271
265
  "try passing them all to `bundle update`"
272
- elsif source = @source_requirements[name]
266
+ else
267
+ source = source_for(name)
273
268
  specs = source.specs.search(name)
274
269
  versions_with_platforms = specs.map {|s| [s.version, s.platform] }
275
- message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
276
- message << if versions_with_platforms.any?
277
- "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}"
278
- else
279
- "The source does not contain any versions of '#{name}'"
280
- end
281
- else
282
- message = "Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in any of the gem sources " \
283
- "listed in your Gemfile#{cache_message}."
270
+ cache_message = begin
271
+ " or in gems cached in #{Bundler.settings.app_cache_path}" if Bundler.app_cache.exist?
272
+ rescue GemfileNotFound
273
+ nil
274
+ end
275
+ message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source.to_err}#{cache_message}.\n")
276
+ message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
284
277
  end
285
278
  raise GemNotFound, message
286
279
  end
@@ -378,7 +371,7 @@ module Bundler
378
371
  o << if metadata_requirement
379
372
  "is not available in #{relevant_source}"
380
373
  else
381
- "in #{relevant_source}.\n"
374
+ "in #{relevant_source.to_err}.\n"
382
375
  end
383
376
  end
384
377
  end,
@@ -430,6 +430,8 @@ module Bundler
430
430
  Pathname.new(ENV["BUNDLE_CONFIG"])
431
431
  elsif ENV["BUNDLE_USER_CONFIG"] && !ENV["BUNDLE_USER_CONFIG"].empty?
432
432
  Pathname.new(ENV["BUNDLE_USER_CONFIG"])
433
+ elsif ENV["BUNDLE_USER_HOME"] && !ENV["BUNDLE_USER_HOME"].empty?
434
+ Pathname.new(ENV["BUNDLE_USER_HOME"]).join("config")
433
435
  elsif Bundler.rubygems.user_home && !Bundler.rubygems.user_home.empty?
434
436
  Pathname.new(Bundler.rubygems.user_home).join(".bundle/config")
435
437
  end
@@ -36,8 +36,6 @@ module Bundler
36
36
 
37
37
  def local!; end
38
38
 
39
- def local_only!; end
40
-
41
39
  def cached!; end
42
40
 
43
41
  def remote!; end
@@ -67,6 +65,10 @@ module Bundler
67
65
  "#<#{self.class}:0x#{object_id} #{self}>"
68
66
  end
69
67
 
68
+ def to_err
69
+ to_s
70
+ end
71
+
70
72
  def path?
71
73
  instance_of?(Bundler::Source::Path)
72
74
  end
@@ -26,12 +26,6 @@ module Bundler
26
26
  Array(options["remotes"]).reverse_each {|r| add_remote(r) }
27
27
  end
28
28
 
29
- def local_only!
30
- @specs = nil
31
- @allow_local = true
32
- @allow_remote = false
33
- end
34
-
35
29
  def local!
36
30
  return if @allow_local
37
31
 
@@ -50,6 +44,7 @@ module Bundler
50
44
  return if @allow_cached
51
45
 
52
46
  @specs = nil
47
+ @allow_local = true
53
48
  @allow_cached = true
54
49
  end
55
50
 
@@ -96,11 +91,22 @@ module Bundler
96
91
  out << " specs:\n"
97
92
  end
98
93
 
94
+ def to_err
95
+ if remotes.empty?
96
+ "locally installed gems"
97
+ elsif @allow_remote
98
+ "rubygems repository #{remote_names} or installed locally"
99
+ elsif @allow_cached
100
+ "cached gems from rubygems repository #{remote_names} or installed locally"
101
+ else
102
+ "locally installed gems"
103
+ end
104
+ end
105
+
99
106
  def to_s
100
107
  if remotes.empty?
101
108
  "locally installed gems"
102
109
  else
103
- remote_names = remotes.map(&:to_s).join(", ")
104
110
  "rubygems repository #{remote_names} or installed locally"
105
111
  end
106
112
  end
@@ -319,6 +325,10 @@ module Bundler
319
325
 
320
326
  protected
321
327
 
328
+ def remote_names
329
+ remotes.map(&:to_s).join(", ")
330
+ end
331
+
322
332
  def credless_remotes
323
333
  remotes.map(&method(:suppress_configured_credentials))
324
334
  end
@@ -16,6 +16,10 @@ module Bundler
16
16
  @index
17
17
  end
18
18
 
19
+ def to_err
20
+ to_s
21
+ end
22
+
19
23
  def to_s
20
24
  "any of the sources"
21
25
  end
@@ -136,10 +136,6 @@ module Bundler
136
136
  different_sources?(lock_sources, replacement_sources)
137
137
  end
138
138
 
139
- def local_only!
140
- all_sources.each(&:local_only!)
141
- end
142
-
143
139
  def cached!
144
140
  all_sources.each(&:cached!)
145
141
  end
@@ -1,16 +1,26 @@
1
1
  name: Ruby
2
2
 
3
- on: [push,pull_request]
3
+ on:
4
+ push:
5
+ - <%= config[:git_default_branch] %>
6
+
7
+ pull_request:
4
8
 
5
9
  jobs:
6
10
  build:
7
11
  runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ ruby:
16
+ - <%= RUBY_VERSION %>
17
+
8
18
  steps:
9
19
  - uses: actions/checkout@v2
10
20
  - name: Set up Ruby
11
21
  uses: ruby/setup-ruby@v1
12
22
  with:
13
- ruby-version: <%= RUBY_VERSION %>
23
+ ruby-version: ${{ matrix.ruby }}
14
24
  bundler-cache: true
15
25
  - name: Run the default task
16
26
  run: bundle exec rake
@@ -25,7 +25,9 @@ Gem::Specification.new do |spec|
25
25
  # Specify which files should be added to the gem when it is released.
26
26
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
27
27
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
28
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
28
+ `git ls-files -z`.split("\x0").reject do |f|
29
+ (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
30
+ end
29
31
  end
30
32
  spec.bindir = "exe"
31
33
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.25".freeze
4
+ VERSION = "2.2.26".freeze
5
5
 
6
6
  def self.bundler_major_version
7
7
  @bundler_major_version ||= VERSION.split(".").first.to_i
data/lib/rubygems.rb CHANGED
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = "3.2.25".freeze
11
+ VERSION = "3.2.26".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -249,9 +249,6 @@ module Gem
249
249
  # you to specify specific gem versions.
250
250
 
251
251
  def self.bin_path(name, exec_name = nil, *requirements)
252
- # TODO: fails test_self_bin_path_bin_file_gone_in_latest
253
- # Gem::Specification.find_by_name(name, *requirements).bin_file exec_name
254
-
255
252
  requirements = Gem::Requirement.default if
256
253
  requirements.empty?
257
254
 
@@ -1053,7 +1050,9 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1053
1050
  # Find rubygems plugin files in the standard location and load them
1054
1051
 
1055
1052
  def self.load_plugins
1056
- load_plugin_files Gem::Util.glob_files_in_dir("*#{Gem.plugin_suffix_pattern}", plugindir)
1053
+ Gem.path.each do |gem_path|
1054
+ load_plugin_files Gem::Util.glob_files_in_dir("*#{Gem.plugin_suffix_pattern}", plugindir(gem_path))
1055
+ end
1057
1056
  end
1058
1057
 
1059
1058
  ##
@@ -1112,26 +1111,21 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
1112
1111
 
1113
1112
  ENV["BUNDLE_GEMFILE"] ||= File.expand_path(path)
1114
1113
  require 'rubygems/user_interaction'
1115
- Gem::DefaultUserInteraction.use_ui(ui) do
1116
- require "bundler"
1117
- begin
1118
- Bundler.ui.silence do
1119
- @gemdeps = Bundler.setup
1114
+ require "bundler"
1115
+ begin
1116
+ Gem::DefaultUserInteraction.use_ui(ui) do
1117
+ begin
1118
+ Bundler.ui.silence do
1119
+ @gemdeps = Bundler.setup
1120
+ end
1121
+ ensure
1122
+ Gem::DefaultUserInteraction.ui.close
1120
1123
  end
1121
- ensure
1122
- Gem::DefaultUserInteraction.ui.close
1123
1124
  end
1124
- @gemdeps.requested_specs.map(&:to_spec).sort_by(&:name)
1125
- end
1126
-
1127
- rescue => e
1128
- case e
1129
- when Gem::LoadError, Gem::UnsatisfiableDependencyError, (defined?(Bundler::GemNotFound) ? Bundler::GemNotFound : Gem::LoadError)
1125
+ rescue Bundler::BundlerError => e
1130
1126
  warn e.message
1131
- warn "You may need to `gem install -g` to install missing gems"
1127
+ warn "You may need to `bundle install` to install missing gems"
1132
1128
  warn ""
1133
- else
1134
- raise
1135
1129
  end
1136
1130
  end
1137
1131
 
@@ -1337,6 +1331,14 @@ begin
1337
1331
 
1338
1332
  require 'rubygems/defaults/operating_system'
1339
1333
  rescue LoadError
1334
+ # Ignored
1335
+ rescue StandardError => e
1336
+ msg = "#{e.message}\n" \
1337
+ "Loading the rubygems/defaults/operating_system.rb file caused an error. " \
1338
+ "This file is owned by your OS, not by rubygems upstream. " \
1339
+ "Please find out which OS package this file belongs to and follow the guidelines from your OS to report " \
1340
+ "the problem and ask for help."
1341
+ raise e.class, msg
1340
1342
  end
1341
1343
 
1342
1344
  begin
@@ -1354,5 +1356,3 @@ Gem::Specification.load_defaults
1354
1356
  require 'rubygems/core_ext/kernel_gem'
1355
1357
  require 'rubygems/core_ext/kernel_require'
1356
1358
  require 'rubygems/core_ext/kernel_warn'
1357
-
1358
- Gem.use_gemdeps
@@ -761,7 +761,7 @@ class Gem::Installer
761
761
  #
762
762
 
763
763
  require 'rubygems'
764
-
764
+ #{gemdeps_load(spec.name)}
765
765
  version = "#{Gem::Requirement.default_prerelease}"
766
766
 
767
767
  str = ARGV.first
@@ -782,6 +782,15 @@ end
782
782
  TEXT
783
783
  end
784
784
 
785
+ def gemdeps_load(name)
786
+ return '' if name == "bundler"
787
+
788
+ <<-TEXT
789
+
790
+ Gem.use_gemdeps
791
+ TEXT
792
+ end
793
+
785
794
  ##
786
795
  # return the stub script text used to launch the true Ruby script
787
796
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubygems-update"
5
- s.version = "3.2.25"
5
+ s.version = "3.2.26"
6
6
  s.authors = ["Jim Weirich", "Chad Fowler", "Eric Hodel", "Luis Lavena", "Aaron Patterson", "Samuel Giddins", "André Arko", "Evan Phoenix", "Hiroshi SHIBATA"]
7
7
  s.email = ["", "", "drbrain@segment7.net", "luislavena@gmail.com", "aaron@tenderlovemaking.com", "segiddins@segiddins.me", "andre@arko.net", "evan@phx.io", "hsbt@ruby-lang.org"]
8
8
 
@@ -1297,7 +1297,11 @@ Also, a list:
1297
1297
  end
1298
1298
 
1299
1299
  def ruby_with_rubygems_in_load_path
1300
- [Gem.ruby, "-I", File.expand_path("../../lib", __dir__)]
1300
+ [Gem.ruby, "-I", rubygems_path]
1301
+ end
1302
+
1303
+ def rubygems_path
1304
+ $LOAD_PATH.find{|p| p == File.dirname($LOADED_FEATURES.find{|f| f.end_with?("/rubygems.rb") }) }
1301
1305
  end
1302
1306
 
1303
1307
  def with_clean_path_to_ruby
@@ -19,7 +19,6 @@ class TestGem < Gem::TestCase
19
19
 
20
20
  common_installer_setup
21
21
 
22
- ENV.delete 'RUBYGEMS_GEMDEPS'
23
22
  @additional = %w[a b].map {|d| File.join @tempdir, d }
24
23
 
25
24
  util_remove_interrupt_command
@@ -540,7 +539,6 @@ class TestGem < Gem::TestCase
540
539
  s.executables = []
541
540
  end
542
541
  install_specs spec
543
- # Should not find a-10's non-abin (bug)
544
542
  assert_equal @abin_path, Gem.bin_path('a', 'abin')
545
543
  end
546
544
 
@@ -664,22 +662,22 @@ class TestGem < Gem::TestCase
664
662
  end
665
663
 
666
664
  def test_self_use_gemdeps
667
- rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], '-'
665
+ with_rubygems_gemdeps('-') do
666
+ FileUtils.mkdir_p 'detect/a/b'
667
+ FileUtils.mkdir_p 'detect/a/Isolate'
668
668
 
669
- FileUtils.mkdir_p 'detect/a/b'
670
- FileUtils.mkdir_p 'detect/a/Isolate'
669
+ FileUtils.touch 'detect/Isolate'
671
670
 
672
- FileUtils.touch 'detect/Isolate'
671
+ begin
672
+ Dir.chdir 'detect/a/b'
673
673
 
674
- begin
675
- Dir.chdir 'detect/a/b'
674
+ Gem.use_gemdeps
676
675
 
677
- assert_equal add_bundler_full_name([]), Gem.use_gemdeps.map(&:full_name)
678
- ensure
679
- Dir.chdir @tempdir
676
+ assert_equal add_bundler_full_name([]), loaded_spec_names
677
+ ensure
678
+ Dir.chdir @tempdir
679
+ end
680
680
  end
681
- ensure
682
- ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
683
681
  end
684
682
 
685
683
  def test_self_dir
@@ -1580,6 +1578,31 @@ class TestGem < Gem::TestCase
1580
1578
  assert_equal %w[plugin], PLUGINS_LOADED
1581
1579
  end
1582
1580
 
1581
+ def test_load_user_installed_plugins
1582
+ plugin_path = File.join "lib", "rubygems_plugin.rb"
1583
+
1584
+ Dir.chdir @tempdir do
1585
+ FileUtils.mkdir_p 'lib'
1586
+ File.open plugin_path, "w" do |fp|
1587
+ fp.puts "class TestGem; PLUGINS_LOADED << 'plugin'; end"
1588
+ end
1589
+
1590
+ foo = util_spec 'foo', '1' do |s|
1591
+ s.files << plugin_path
1592
+ end
1593
+
1594
+ install_gem_user foo
1595
+ end
1596
+
1597
+ Gem.paths = { "GEM_PATH" => [Gem.dir, Gem.user_dir].join(File::PATH_SEPARATOR) }
1598
+
1599
+ gem 'foo'
1600
+
1601
+ Gem.load_plugins
1602
+
1603
+ assert_equal %w[plugin], PLUGINS_LOADED
1604
+ end
1605
+
1583
1606
  def test_load_env_plugins
1584
1607
  with_plugin('load') { Gem.load_env_plugins }
1585
1608
  assert_equal :loaded, TEST_PLUGIN_LOAD rescue nil
@@ -1689,11 +1712,11 @@ class TestGem < Gem::TestCase
1689
1712
  f.puts "gem 'c'"
1690
1713
  end
1691
1714
 
1692
- ENV['RUBYGEMS_GEMDEPS'] = path
1693
-
1694
- Gem.use_gemdeps
1715
+ with_rubygems_gemdeps(path) do
1716
+ Gem.use_gemdeps
1695
1717
 
1696
- assert_equal add_bundler_full_name(%W[a-1 b-1 c-1]), loaded_spec_names
1718
+ assert_equal add_bundler_full_name(%W[a-1 b-1 c-1]), loaded_spec_names
1719
+ end
1697
1720
  end
1698
1721
 
1699
1722
  def test_auto_activation_of_used_gemdeps_file
@@ -1711,10 +1734,13 @@ class TestGem < Gem::TestCase
1711
1734
  f.puts "gem 'c'"
1712
1735
  end
1713
1736
 
1714
- ENV['RUBYGEMS_GEMDEPS'] = "-"
1737
+ with_rubygems_gemdeps("-") do
1738
+ expected_specs = [a, b, util_spec("bundler", Bundler::VERSION), c].compact.map(&:full_name)
1739
+
1740
+ Gem.use_gemdeps
1715
1741
 
1716
- expected_specs = [a, b, util_spec("bundler", Bundler::VERSION), c].compact
1717
- assert_equal expected_specs, Gem.use_gemdeps.sort_by {|s| s.name }
1742
+ assert_equal expected_specs, loaded_spec_names
1743
+ end
1718
1744
  end
1719
1745
 
1720
1746
  BUNDLER_LIB_PATH = File.expand_path $LOAD_PATH.find {|lp| File.file?(File.join(lp, "bundler.rb")) }
@@ -1726,10 +1752,18 @@ class TestGem < Gem::TestCase
1726
1752
  names
1727
1753
  end
1728
1754
 
1729
- def test_looks_for_gemdeps_files_automatically_on_start
1755
+ def test_looks_for_gemdeps_files_automatically_from_binstubs
1730
1756
  pend "Requiring bundler messes things up" if Gem.java_platform?
1731
1757
 
1732
- a = util_spec "a", "1", nil, "lib/a.rb"
1758
+ a = util_spec "a", "1" do |s|
1759
+ s.executables = %w[foo]
1760
+ s.bindir = "exe"
1761
+ end
1762
+
1763
+ write_file File.join(@tempdir, 'exe', 'foo') do |fp|
1764
+ fp.puts "puts Gem.loaded_specs.values.map(&:full_name).sort"
1765
+ end
1766
+
1733
1767
  b = util_spec "b", "1", nil, "lib/b.rb"
1734
1768
  c = util_spec "c", "1", nil, "lib/c.rb"
1735
1769
 
@@ -1741,31 +1775,44 @@ class TestGem < Gem::TestCase
1741
1775
  install_gem c, :install_dir => path
1742
1776
 
1743
1777
  ENV['GEM_PATH'] = path
1744
- ENV['RUBYGEMS_GEMDEPS'] = "-"
1745
1778
 
1746
- path = File.join @tempdir, "gem.deps.rb"
1747
- cmd = [*ruby_with_rubygems_in_load_path,
1748
- "-I#{BUNDLER_LIB_PATH}"]
1749
- cmd << "-eputs Gem.loaded_specs.values.map(&:full_name).sort"
1779
+ with_rubygems_gemdeps("-") do
1780
+ new_PATH = [File.join(path, "bin"), ENV["PATH"]].join(File::PATH_SEPARATOR)
1781
+ new_RUBYOPT = "-I#{rubygems_path} -I#{BUNDLER_LIB_PATH}"
1750
1782
 
1751
- File.open path, "w" do |f|
1752
- f.puts "gem 'a'"
1753
- end
1754
- out0 = IO.popen(cmd, &:read).split(/\n/)
1783
+ path = File.join @tempdir, "gem.deps.rb"
1755
1784
 
1756
- File.open path, "a" do |f|
1757
- f.puts "gem 'b'"
1758
- f.puts "gem 'c'"
1759
- end
1760
- out = IO.popen(cmd, &:read).split(/\n/)
1785
+ File.open path, "w" do |f|
1786
+ f.puts "gem 'a'"
1787
+ end
1788
+ out0 = with_path_and_rubyopt(new_PATH, new_RUBYOPT) do
1789
+ IO.popen("foo", &:read).split(/\n/)
1790
+ end
1791
+
1792
+ File.open path, "a" do |f|
1793
+ f.puts "gem 'b'"
1794
+ f.puts "gem 'c'"
1795
+ end
1796
+ out = with_path_and_rubyopt(new_PATH, new_RUBYOPT) do
1797
+ IO.popen("foo", &:read).split(/\n/)
1798
+ end
1761
1799
 
1762
- assert_equal ["b-1", "c-1"], out - out0
1800
+ assert_equal ["b-1", "c-1"], out - out0
1801
+ end
1763
1802
  end
1764
1803
 
1765
- def test_looks_for_gemdeps_files_automatically_on_start_in_parent_dir
1804
+ def test_looks_for_gemdeps_files_automatically_from_binstubs_in_parent_dir
1766
1805
  pend "Requiring bundler messes things up" if Gem.java_platform?
1767
1806
 
1768
- a = util_spec "a", "1", nil, "lib/a.rb"
1807
+ a = util_spec "a", "1" do |s|
1808
+ s.executables = %w[foo]
1809
+ s.bindir = "exe"
1810
+ end
1811
+
1812
+ write_file File.join(@tempdir, 'exe', 'foo') do |fp|
1813
+ fp.puts "puts Gem.loaded_specs.values.map(&:full_name).sort"
1814
+ end
1815
+
1769
1816
  b = util_spec "b", "1", nil, "lib/b.rb"
1770
1817
  c = util_spec "c", "1", nil, "lib/c.rb"
1771
1818
 
@@ -1777,29 +1824,34 @@ class TestGem < Gem::TestCase
1777
1824
  install_gem c, :install_dir => path
1778
1825
 
1779
1826
  ENV['GEM_PATH'] = path
1780
- ENV['RUBYGEMS_GEMDEPS'] = "-"
1781
1827
 
1782
- Dir.mkdir "sub1"
1828
+ with_rubygems_gemdeps("-") do
1829
+ Dir.mkdir "sub1"
1783
1830
 
1784
- path = File.join @tempdir, "gem.deps.rb"
1785
- cmd = [*ruby_with_rubygems_in_load_path, "-Csub1",
1786
- "-I#{BUNDLER_LIB_PATH}"]
1787
- cmd << "-eputs Gem.loaded_specs.values.map(&:full_name).sort"
1831
+ new_PATH = [File.join(path, "bin"), ENV["PATH"]].join(File::PATH_SEPARATOR)
1832
+ new_RUBYOPT = "-I#{rubygems_path} -I#{BUNDLER_LIB_PATH}"
1788
1833
 
1789
- File.open path, "w" do |f|
1790
- f.puts "gem 'a'"
1791
- end
1792
- out0 = IO.popen(cmd, &:read).split(/\n/)
1834
+ path = File.join @tempdir, "gem.deps.rb"
1793
1835
 
1794
- File.open path, "a" do |f|
1795
- f.puts "gem 'b'"
1796
- f.puts "gem 'c'"
1797
- end
1798
- out = IO.popen(cmd, &:read).split(/\n/)
1836
+ File.open path, "w" do |f|
1837
+ f.puts "gem 'a'"
1838
+ end
1839
+ out0 = with_path_and_rubyopt(new_PATH, new_RUBYOPT) do
1840
+ IO.popen("foo", :chdir => "sub1", &:read).split(/\n/)
1841
+ end
1842
+
1843
+ File.open path, "a" do |f|
1844
+ f.puts "gem 'b'"
1845
+ f.puts "gem 'c'"
1846
+ end
1847
+ out = with_path_and_rubyopt(new_PATH, new_RUBYOPT) do
1848
+ IO.popen("foo", :chdir => "sub1", &:read).split(/\n/)
1849
+ end
1799
1850
 
1800
- Dir.rmdir "sub1"
1851
+ Dir.rmdir "sub1"
1801
1852
 
1802
- assert_equal ["b-1", "c-1"], out - out0
1853
+ assert_equal ["b-1", "c-1"], out - out0
1854
+ end
1803
1855
  end
1804
1856
 
1805
1857
  def test_register_default_spec
@@ -1863,21 +1915,19 @@ class TestGem < Gem::TestCase
1863
1915
  end
1864
1916
 
1865
1917
  def test_use_gemdeps_ENV
1866
- rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], nil
1867
-
1868
- spec = util_spec 'a', 1
1918
+ with_rubygems_gemdeps(nil) do
1919
+ spec = util_spec 'a', 1
1869
1920
 
1870
- refute spec.activated?
1921
+ refute spec.activated?
1871
1922
 
1872
- File.open 'gem.deps.rb', 'w' do |io|
1873
- io.write 'gem "a"'
1874
- end
1923
+ File.open 'gem.deps.rb', 'w' do |io|
1924
+ io.write 'gem "a"'
1925
+ end
1875
1926
 
1876
- Gem.use_gemdeps
1927
+ Gem.use_gemdeps
1877
1928
 
1878
- refute spec.activated?
1879
- ensure
1880
- ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
1929
+ refute spec.activated?
1930
+ end
1881
1931
  end
1882
1932
 
1883
1933
  def test_use_gemdeps_argument_missing
@@ -1890,110 +1940,96 @@ class TestGem < Gem::TestCase
1890
1940
  end
1891
1941
 
1892
1942
  def test_use_gemdeps_argument_missing_match_ENV
1893
- rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] =
1894
- ENV['RUBYGEMS_GEMDEPS'], 'gem.deps.rb'
1943
+ with_rubygems_gemdeps('gem.deps.rb') do
1944
+ e = assert_raise ArgumentError do
1945
+ Gem.use_gemdeps 'gem.deps.rb'
1946
+ end
1895
1947
 
1896
- e = assert_raise ArgumentError do
1897
- Gem.use_gemdeps 'gem.deps.rb'
1948
+ assert_equal 'Unable to find gem dependencies file at gem.deps.rb',
1949
+ e.message
1898
1950
  end
1899
-
1900
- assert_equal 'Unable to find gem dependencies file at gem.deps.rb',
1901
- e.message
1902
- ensure
1903
- ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
1904
1951
  end
1905
1952
 
1906
1953
  def test_use_gemdeps_automatic
1907
- rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], '-'
1908
-
1909
- spec = util_spec 'a', 1
1910
- install_specs spec
1911
- spec = Gem::Specification.find {|s| s == spec }
1954
+ with_rubygems_gemdeps('-') do
1955
+ spec = util_spec 'a', 1
1956
+ install_specs spec
1957
+ spec = Gem::Specification.find {|s| s == spec }
1912
1958
 
1913
- refute spec.activated?
1959
+ refute spec.activated?
1914
1960
 
1915
- File.open 'Gemfile', 'w' do |io|
1916
- io.write 'gem "a"'
1917
- end
1961
+ File.open 'Gemfile', 'w' do |io|
1962
+ io.write 'gem "a"'
1963
+ end
1918
1964
 
1919
- Gem.use_gemdeps
1965
+ Gem.use_gemdeps
1920
1966
 
1921
- assert_equal add_bundler_full_name(%W[a-1]), loaded_spec_names
1922
- ensure
1923
- ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
1967
+ assert_equal add_bundler_full_name(%W[a-1]), loaded_spec_names
1968
+ end
1924
1969
  end
1925
1970
 
1926
1971
  def test_use_gemdeps_automatic_missing
1927
- rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], '-'
1972
+ with_rubygems_gemdeps('-') do
1973
+ Gem.use_gemdeps
1928
1974
 
1929
- Gem.use_gemdeps
1930
-
1931
- assert true # count
1932
- ensure
1933
- ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
1975
+ assert true # count
1976
+ end
1934
1977
  end
1935
1978
 
1936
1979
  def test_use_gemdeps_disabled
1937
- rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], ''
1980
+ with_rubygems_gemdeps('') do
1981
+ spec = util_spec 'a', 1
1938
1982
 
1939
- spec = util_spec 'a', 1
1983
+ refute spec.activated?
1940
1984
 
1941
- refute spec.activated?
1942
-
1943
- File.open 'gem.deps.rb', 'w' do |io|
1944
- io.write 'gem "a"'
1945
- end
1985
+ File.open 'gem.deps.rb', 'w' do |io|
1986
+ io.write 'gem "a"'
1987
+ end
1946
1988
 
1947
- Gem.use_gemdeps
1989
+ Gem.use_gemdeps
1948
1990
 
1949
- refute spec.activated?
1950
- ensure
1951
- ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
1991
+ refute spec.activated?
1992
+ end
1952
1993
  end
1953
1994
 
1954
1995
  def test_use_gemdeps_missing_gem
1955
- rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], 'x'
1956
-
1957
- File.open 'x', 'w' do |io|
1958
- io.write 'gem "a"'
1959
- end
1996
+ with_rubygems_gemdeps('x') do
1997
+ File.open 'x', 'w' do |io|
1998
+ io.write 'gem "a"'
1999
+ end
1960
2000
 
1961
- expected = <<-EXPECTED
2001
+ expected = <<-EXPECTED
1962
2002
  Could not find gem 'a' in locally installed gems.
1963
- The source does not contain any versions of 'a'
1964
- You may need to `gem install -g` to install missing gems
2003
+ You may need to `bundle install` to install missing gems
1965
2004
 
1966
- EXPECTED
2005
+ EXPECTED
1967
2006
 
1968
- Gem::Deprecate.skip_during do
1969
- actual_stdout, actual_stderr = capture_output do
1970
- Gem.use_gemdeps
2007
+ Gem::Deprecate.skip_during do
2008
+ actual_stdout, actual_stderr = capture_output do
2009
+ Gem.use_gemdeps
2010
+ end
2011
+ assert_empty actual_stdout
2012
+ assert_equal(expected, actual_stderr)
1971
2013
  end
1972
- assert_empty actual_stdout
1973
- assert_equal(expected, actual_stderr)
1974
2014
  end
1975
- ensure
1976
- ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
1977
2015
  end
1978
2016
 
1979
2017
  def test_use_gemdeps_specific
1980
- rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], 'x'
2018
+ with_rubygems_gemdeps('x') do
2019
+ spec = util_spec 'a', 1
2020
+ install_specs spec
1981
2021
 
1982
- spec = util_spec 'a', 1
1983
- install_specs spec
1984
-
1985
- spec = Gem::Specification.find {|s| s == spec }
1986
- refute spec.activated?
2022
+ spec = Gem::Specification.find {|s| s == spec }
2023
+ refute spec.activated?
1987
2024
 
1988
- File.open 'x', 'w' do |io|
1989
- io.write 'gem "a"'
1990
- end
2025
+ File.open 'x', 'w' do |io|
2026
+ io.write 'gem "a"'
2027
+ end
1991
2028
 
1992
- Gem.use_gemdeps
2029
+ Gem.use_gemdeps
1993
2030
 
1994
- assert_equal add_bundler_full_name(%W[a-1]), loaded_spec_names
1995
- ensure
1996
- ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
2031
+ assert_equal add_bundler_full_name(%W[a-1]), loaded_spec_names
2032
+ end
1997
2033
  end
1998
2034
 
1999
2035
  def test_operating_system_defaults
@@ -2111,4 +2147,22 @@ You may need to `gem install -g` to install missing gems
2111
2147
  def util_cache_dir
2112
2148
  File.join Gem.dir, "cache"
2113
2149
  end
2150
+
2151
+ def with_path_and_rubyopt(path_value, rubyopt_value)
2152
+ path, ENV['PATH'] = ENV['PATH'], path_value
2153
+ rubyopt, ENV['RUBYOPT'] = ENV['RUBYOPT'], rubyopt_value
2154
+
2155
+ yield
2156
+ ensure
2157
+ ENV['PATH'] = path
2158
+ ENV['RUBYOPT'] = rubyopt
2159
+ end
2160
+
2161
+ def with_rubygems_gemdeps(value)
2162
+ rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], value
2163
+
2164
+ yield
2165
+ ensure
2166
+ ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps
2167
+ end
2114
2168
  end
@@ -33,6 +33,8 @@ class TestGemInstaller < Gem::InstallerTestCase
33
33
 
34
34
  require 'rubygems'
35
35
 
36
+ Gem.use_gemdeps
37
+
36
38
  version = \">= 0.a\"
37
39
 
38
40
  str = ARGV.first
@@ -0,0 +1,44 @@
1
+ require_relative 'helper'
2
+
3
+ class GemTest < Gem::TestCase
4
+ def test_rubygems_normal_behaviour
5
+ _ = Gem::Util.popen(*ruby_with_rubygems_in_load_path, '-e', "'require \"rubygems\"'", {:err => [:child, :out]}).strip
6
+ assert $?.success?
7
+ end
8
+
9
+ def test_operating_system_other_exceptions
10
+ pend "does not apply to truffleruby" if RUBY_ENGINE == 'truffleruby'
11
+
12
+ path = util_install_operating_system_rb <<-RUBY
13
+ intentionally_not_implemented_method
14
+ RUBY
15
+
16
+ output = Gem::Util.popen(*ruby_with_rubygems_and_fake_operating_system_in_load_path(path), '-e', "'require \"rubygems\"'", {:err => [:child, :out]}).strip
17
+ assert !$?.success?
18
+ assert_includes output, "undefined local variable or method `intentionally_not_implemented_method'"
19
+ assert_includes output, "Loading the rubygems/defaults/operating_system.rb file caused an error. " \
20
+ "This file is owned by your OS, not by rubygems upstream. " \
21
+ "Please find out which OS package this file belongs to and follow the guidelines from your OS to report " \
22
+ "the problem and ask for help."
23
+ end
24
+
25
+ private
26
+
27
+ def util_install_operating_system_rb(content)
28
+ dir_lib = Dir.mktmpdir("test_operating_system_lib", @tempdir)
29
+ dir_lib_arg = File.join dir_lib
30
+
31
+ dir_lib_rubygems_defaults_arg = File.join dir_lib_arg, "lib", "rubygems", "defaults"
32
+ FileUtils.mkdir_p dir_lib_rubygems_defaults_arg
33
+
34
+ operating_system_rb = File.join dir_lib_rubygems_defaults_arg, "operating_system.rb"
35
+
36
+ File.open(operating_system_rb, 'w') {|f| f.write content }
37
+
38
+ File.join dir_lib_arg, "lib"
39
+ end
40
+
41
+ def ruby_with_rubygems_and_fake_operating_system_in_load_path(operating_system_path)
42
+ [Gem.ruby, "-I", operating_system_path, "-I" , $LOAD_PATH.find{|p| p == File.dirname($LOADED_FEATURES.find{|f| f.end_with?("/rubygems.rb") }) }]
43
+ end
44
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.25
4
+ version: 3.2.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -16,7 +16,7 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2021-07-30 00:00:00.000000000 Z
19
+ date: 2021-08-17 00:00:00.000000000 Z
20
20
  dependencies: []
21
21
  description: |-
22
22
  A package (also known as a library) contains a set of functionality
@@ -743,6 +743,7 @@ files:
743
743
  - test/rubygems/test_project_sanity.rb
744
744
  - test/rubygems/test_remote_fetch_error.rb
745
745
  - test/rubygems/test_require.rb
746
+ - test/rubygems/test_rubygems.rb
746
747
  - test/rubygems/utilities.rb
747
748
  - test/rubygems/wrong_key_cert.pem
748
749
  - test/rubygems/wrong_key_cert_32.pem
@@ -770,7 +771,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
770
771
  - !ruby/object:Gem::Version
771
772
  version: '0'
772
773
  requirements: []
773
- rubygems_version: 3.2.25
774
+ rubygems_version: 3.2.26
774
775
  signing_key:
775
776
  specification_version: 4
776
777
  summary: RubyGems is a package management framework for Ruby.