rubygems-update 3.2.17 → 3.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -0
  3. data/Manifest.txt +3 -0
  4. data/Rakefile +6 -6
  5. data/bundler/CHANGELOG.md +54 -0
  6. data/bundler/bundler.gemspec +2 -3
  7. data/bundler/lib/bundler.rb +2 -1
  8. data/bundler/lib/bundler/build_metadata.rb +2 -2
  9. data/bundler/lib/bundler/cli.rb +13 -33
  10. data/bundler/lib/bundler/cli/check.rb +4 -2
  11. data/bundler/lib/bundler/cli/install.rb +6 -7
  12. data/bundler/lib/bundler/cli/outdated.rb +9 -10
  13. data/bundler/lib/bundler/definition.rb +29 -82
  14. data/bundler/lib/bundler/feature_flag.rb +0 -2
  15. data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
  16. data/bundler/lib/bundler/fetcher/index.rb +0 -1
  17. data/bundler/lib/bundler/friendly_errors.rb +2 -4
  18. data/bundler/lib/bundler/index.rb +1 -2
  19. data/bundler/lib/bundler/installer.rb +1 -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 +1 -7
  26. data/bundler/lib/bundler/man/bundle-config.1.ronn +0 -8
  27. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  28. data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
  29. data/bundler/lib/bundler/man/bundle-gem.1 +1 -1
  30. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  31. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  32. data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
  33. data/bundler/lib/bundler/man/bundle-install.1 +1 -1
  34. data/bundler/lib/bundler/man/bundle-list.1 +1 -1
  35. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  36. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  37. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  38. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  39. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  40. data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
  41. data/bundler/lib/bundler/man/bundle-show.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  43. data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
  44. data/bundler/lib/bundler/man/bundle.1 +1 -1
  45. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  46. data/bundler/lib/bundler/plugin/api/source.rb +14 -0
  47. data/bundler/lib/bundler/resolver.rb +15 -96
  48. data/bundler/lib/bundler/resolver/spec_group.rb +0 -24
  49. data/bundler/lib/bundler/rubygems_ext.rb +2 -2
  50. data/bundler/lib/bundler/rubygems_integration.rb +4 -3
  51. data/bundler/lib/bundler/settings.rb +21 -3
  52. data/bundler/lib/bundler/source.rb +11 -0
  53. data/bundler/lib/bundler/source/rubygems.rb +24 -11
  54. data/bundler/lib/bundler/source/rubygems_aggregate.rb +64 -0
  55. data/bundler/lib/bundler/source_list.rb +35 -10
  56. data/bundler/lib/bundler/source_map.rb +58 -0
  57. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
  58. data/bundler/lib/bundler/version.rb +1 -1
  59. data/lib/rubygems.rb +1 -1
  60. data/lib/rubygems/command.rb +2 -0
  61. data/lib/rubygems/commands/build_command.rb +1 -1
  62. data/lib/rubygems/config_file.rb +1 -1
  63. data/lib/rubygems/ext/ext_conf_builder.rb +4 -4
  64. data/lib/rubygems/installer.rb +4 -0
  65. data/lib/rubygems/request.rb +1 -1
  66. data/lib/rubygems/specification.rb +0 -2
  67. data/lib/rubygems/specification_policy.rb +5 -4
  68. data/lib/rubygems/test_case.rb +106 -18
  69. data/lib/rubygems/util/licenses.rb +107 -2
  70. data/rubygems-update.gemspec +1 -1
  71. data/setup.rb +1 -2
  72. data/test/rubygems/packages/ill-formatted-platform-1.0.0.10.gem +0 -0
  73. data/test/rubygems/test_bundled_ca.rb +2 -2
  74. data/test/rubygems/test_deprecate.rb +3 -3
  75. data/test/rubygems/test_gem.rb +33 -31
  76. data/test/rubygems/test_gem_bundler_version_finder.rb +3 -5
  77. data/test/rubygems/test_gem_command.rb +13 -1
  78. data/test/rubygems/test_gem_command_manager.rb +5 -5
  79. data/test/rubygems/test_gem_commands_build_command.rb +10 -10
  80. data/test/rubygems/test_gem_commands_cert_command.rb +36 -36
  81. data/test/rubygems/test_gem_commands_check_command.rb +5 -5
  82. data/test/rubygems/test_gem_commands_cleanup_command.rb +24 -24
  83. data/test/rubygems/test_gem_commands_contents_command.rb +3 -3
  84. data/test/rubygems/test_gem_commands_dependency_command.rb +2 -2
  85. data/test/rubygems/test_gem_commands_environment_command.rb +1 -1
  86. data/test/rubygems/test_gem_commands_fetch_command.rb +9 -9
  87. data/test/rubygems/test_gem_commands_help_command.rb +8 -1
  88. data/test/rubygems/test_gem_commands_install_command.rb +60 -60
  89. data/test/rubygems/test_gem_commands_list_command.rb +1 -1
  90. data/test/rubygems/test_gem_commands_lock_command.rb +1 -1
  91. data/test/rubygems/test_gem_commands_open_command.rb +8 -9
  92. data/test/rubygems/test_gem_commands_owner_command.rb +3 -3
  93. data/test/rubygems/test_gem_commands_pristine_command.rb +14 -14
  94. data/test/rubygems/test_gem_commands_push_command.rb +6 -11
  95. data/test/rubygems/test_gem_commands_query_command.rb +7 -7
  96. data/test/rubygems/test_gem_commands_server_command.rb +2 -2
  97. data/test/rubygems/test_gem_commands_setup_command.rb +21 -21
  98. data/test/rubygems/test_gem_commands_signin_command.rb +13 -6
  99. data/test/rubygems/test_gem_commands_sources_command.rb +5 -5
  100. data/test/rubygems/test_gem_commands_specification_command.rb +6 -6
  101. data/test/rubygems/test_gem_commands_uninstall_command.rb +4 -4
  102. data/test/rubygems/test_gem_commands_unpack_command.rb +2 -2
  103. data/test/rubygems/test_gem_commands_update_command.rb +10 -10
  104. data/test/rubygems/test_gem_commands_which_command.rb +3 -3
  105. data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
  106. data/test/rubygems/test_gem_config_file.rb +9 -9
  107. data/test/rubygems/test_gem_dependency.rb +12 -6
  108. data/test/rubygems/test_gem_dependency_installer.rb +4 -4
  109. data/test/rubygems/test_gem_doctor.rb +30 -30
  110. data/test/rubygems/test_gem_ext_builder.rb +20 -20
  111. data/test/rubygems/test_gem_ext_cmake_builder.rb +4 -4
  112. data/test/rubygems/test_gem_ext_configure_builder.rb +4 -4
  113. data/test/rubygems/test_gem_ext_ext_conf_builder.rb +14 -13
  114. data/test/rubygems/test_gem_ext_rake_builder.rb +1 -1
  115. data/test/rubygems/test_gem_gemcutter_utilities.rb +8 -14
  116. data/test/rubygems/test_gem_install_update_options.rb +9 -9
  117. data/test/rubygems/test_gem_installer.rb +162 -140
  118. data/test/rubygems/test_gem_local_remote_options.rb +1 -1
  119. data/test/rubygems/test_gem_package.rb +48 -48
  120. data/test/rubygems/test_gem_package_old.rb +9 -9
  121. data/test/rubygems/test_gem_package_tar_header.rb +5 -5
  122. data/test/rubygems/test_gem_package_tar_reader_entry.rb +8 -8
  123. data/test/rubygems/test_gem_package_tar_writer.rb +18 -20
  124. data/test/rubygems/test_gem_package_task.rb +2 -2
  125. data/test/rubygems/test_gem_path_support.rb +1 -1
  126. data/test/rubygems/test_gem_rdoc.rb +9 -9
  127. data/test/rubygems/test_gem_remote_fetcher.rb +17 -18
  128. data/test/rubygems/test_gem_request.rb +2 -2
  129. data/test/rubygems/test_gem_request_connection_pools.rb +1 -1
  130. data/test/rubygems/test_gem_request_set.rb +15 -14
  131. data/test/rubygems/test_gem_request_set_gem_dependency_api.rb +16 -16
  132. data/test/rubygems/test_gem_request_set_lockfile.rb +3 -3
  133. data/test/rubygems/test_gem_request_set_lockfile_parser.rb +3 -3
  134. data/test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +4 -4
  135. data/test/rubygems/test_gem_requirement.rb +13 -13
  136. data/test/rubygems/test_gem_resolver.rb +11 -11
  137. data/test/rubygems/test_gem_resolver_best_set.rb +1 -1
  138. data/test/rubygems/test_gem_resolver_git_set.rb +1 -1
  139. data/test/rubygems/test_gem_resolver_git_specification.rb +2 -2
  140. data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
  141. data/test/rubygems/test_gem_resolver_installer_set.rb +4 -4
  142. data/test/rubygems/test_gem_resolver_local_specification.rb +1 -1
  143. data/test/rubygems/test_gem_resolver_specification.rb +1 -1
  144. data/test/rubygems/test_gem_resolver_vendor_set.rb +2 -2
  145. data/test/rubygems/test_gem_security.rb +5 -5
  146. data/test/rubygems/test_gem_security_policy.rb +27 -27
  147. data/test/rubygems/test_gem_security_signer.rb +7 -7
  148. data/test/rubygems/test_gem_security_trust_dir.rb +4 -4
  149. data/test/rubygems/test_gem_server.rb +2 -2
  150. data/test/rubygems/test_gem_silent_ui.rb +9 -9
  151. data/test/rubygems/test_gem_source.rb +2 -2
  152. data/test/rubygems/test_gem_source_fetch_problem.rb +1 -1
  153. data/test/rubygems/test_gem_source_git.rb +11 -11
  154. data/test/rubygems/test_gem_source_specific_file.rb +1 -1
  155. data/test/rubygems/test_gem_spec_fetcher.rb +1 -1
  156. data/test/rubygems/test_gem_specification.rb +86 -106
  157. data/test/rubygems/test_gem_stream_ui.rb +1 -1
  158. data/test/rubygems/test_gem_stub_specification.rb +4 -4
  159. data/test/rubygems/test_gem_uninstaller.rb +16 -16
  160. data/test/rubygems/test_gem_util.rb +8 -6
  161. data/test/rubygems/test_gem_version.rb +4 -13
  162. data/test/rubygems/test_kernel.rb +6 -4
  163. data/test/rubygems/test_project_sanity.rb +1 -1
  164. data/test/rubygems/test_remote_fetch_error.rb +1 -1
  165. data/test/rubygems/test_require.rb +12 -14
  166. data/test/test_changelog_generator.rb +1 -2
  167. metadata +6 -3
@@ -14,9 +14,9 @@ Gem::Specification.new do |spec|
14
14
  <%- if config[:mit] -%>
15
15
  spec.license = "MIT"
16
16
  <%- end -%>
17
- spec.required_ruby_version = Gem::Requirement.new(">= <%= config[:required_ruby_version] %>")
17
+ spec.required_ruby_version = ">= <%= config[:required_ruby_version] %>"
18
18
 
19
- spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
19
+ spec.metadata["allowed_push_host"] = "TODO: Set to 'https://mygemserver.com'"
20
20
 
21
21
  spec.metadata["homepage_uri"] = spec.homepage
22
22
  spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
 
3
3
  module Bundler
4
- VERSION = "2.2.17".freeze
4
+ VERSION = "2.2.21".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.17".freeze
11
+ VERSION = "3.2.21".freeze
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -355,6 +355,8 @@ class Gem::Command
355
355
  def add_option(*opts, &handler) # :yields: value, options
356
356
  group_name = Symbol === opts.first ? opts.shift : :options
357
357
 
358
+ raise "Do not pass an empty string in opts" if opts.include?("")
359
+
358
360
  @option_groups[group_name] << [opts, handler]
359
361
  end
360
362
 
@@ -23,7 +23,7 @@ class Gem::Commands::BuildCommand < Gem::Command
23
23
  options[:output] = value
24
24
  end
25
25
 
26
- add_option '-C PATH', '', 'Run as if gem build was started in <PATH> instead of the current working directory.' do |value, options|
26
+ add_option '-C PATH', 'Run as if gem build was started in <PATH> instead of the current working directory.' do |value, options|
27
27
  options[:build_path] = value
28
28
  end
29
29
  end
@@ -320,7 +320,7 @@ if you believe they were disclosed to a third party.
320
320
  config = load_file(credentials_path).merge(host => api_key)
321
321
 
322
322
  dirname = File.dirname credentials_path
323
- Dir.mkdir(dirname) unless File.exist? dirname
323
+ FileUtils.mkdir_p(dirname) unless File.exist? dirname
324
324
 
325
325
  Gem.load_yaml
326
326
 
@@ -23,11 +23,11 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
23
23
  # spaces do not work.
24
24
  #
25
25
  # Details: https://github.com/rubygems/rubygems/issues/977#issuecomment-171544940
26
- tmp_dest = get_relative_path(tmp_dest, extension_dir)
26
+ tmp_dest_relative = get_relative_path(tmp_dest.clone, extension_dir)
27
27
 
28
28
  Tempfile.open %w[siteconf .rb], extension_dir do |siteconf|
29
29
  siteconf.puts "require 'rbconfig'"
30
- siteconf.puts "dest_path = #{tmp_dest.dump}"
30
+ siteconf.puts "dest_path = #{tmp_dest_relative.dump}"
31
31
  %w[sitearchdir sitelibdir].each do |dir|
32
32
  siteconf.puts "RbConfig::MAKEFILE_CONFIG['#{dir}'] = dest_path"
33
33
  siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
@@ -63,8 +63,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
63
63
 
64
64
  make dest_path, results, extension_dir
65
65
 
66
- if tmp_dest
67
- full_tmp_dest = File.join(extension_dir, tmp_dest)
66
+ if tmp_dest_relative
67
+ full_tmp_dest = File.join(extension_dir, tmp_dest_relative)
68
68
 
69
69
  # TODO remove in RubyGems 3
70
70
  if Gem.install_extension_in_lib and lib_dir
@@ -728,6 +728,10 @@ class Gem::Installer
728
728
  raise Gem::InstallError, "#{spec} has an invalid extensions"
729
729
  end
730
730
 
731
+ if spec.platform.to_s =~ /\R/
732
+ raise Gem::InstallError, "#{spec.platform} is an invalid platform"
733
+ end
734
+
731
735
  unless spec.specification_version.to_s =~ /\A\d+\z/
732
736
  raise Gem::InstallError, "#{spec} has an invalid specification_version"
733
737
  end
@@ -44,7 +44,7 @@ class Gem::Request
44
44
  end
45
45
 
46
46
  def self.configure_connection_for_https(connection, cert_files)
47
- raise Gem::Exception.new('OpenSSl is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources') unless Gem::HAVE_OPENSSL
47
+ raise Gem::Exception.new('OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources') unless Gem::HAVE_OPENSSL
48
48
 
49
49
  connection.use_ssl = true
50
50
  connection.verify_mode =
@@ -1558,7 +1558,6 @@ class Gem::Specification < Gem::BasicSpecification
1558
1558
  def build_extensions # :nodoc:
1559
1559
  return if default_gem?
1560
1560
  return if extensions.empty?
1561
- return if installed_by_version < Gem::Version.new('2.2.0.preview.2')
1562
1561
  return if File.exist? gem_build_complete_path
1563
1562
  return if !File.writable?(base_dir)
1564
1563
  return if !File.exist?(File.join(base_dir, 'extensions'))
@@ -2129,7 +2128,6 @@ class Gem::Specification < Gem::BasicSpecification
2129
2128
  def missing_extensions?
2130
2129
  return false if default_gem?
2131
2130
  return false if extensions.empty?
2132
- return false if installed_by_version < Gem::Version.new('2.2.0.preview.2')
2133
2131
  return false if File.exist? gem_build_complete_path
2134
2132
 
2135
2133
  true
@@ -124,25 +124,26 @@ class Gem::SpecificationPolicy
124
124
  end
125
125
 
126
126
  metadata.each do |key, value|
127
+ entry = "metadata['#{key}']"
127
128
  if !key.kind_of?(String)
128
129
  error "metadata keys must be a String"
129
130
  end
130
131
 
131
132
  if key.size > 128
132
- error "metadata key too large (#{key.size} > 128)"
133
+ error "metadata key is too large (#{key.size} > 128)"
133
134
  end
134
135
 
135
136
  if !value.kind_of?(String)
136
- error "metadata values must be a String"
137
+ error "#{entry} value must be a String"
137
138
  end
138
139
 
139
140
  if value.size > 1024
140
- error "metadata value too large (#{value.size} > 1024)"
141
+ error "#{entry} value is too large (#{value.size} > 1024)"
141
142
  end
142
143
 
143
144
  if METADATA_LINK_KEYS.include? key
144
145
  if value !~ VALID_URI_PATTERN
145
- error "metadata['#{key}'] has invalid link: #{value.inspect}"
146
+ error "#{entry} has invalid link: #{value.inspect}"
146
147
  end
147
148
  end
148
149
  end
@@ -12,7 +12,7 @@ if File.exist?(bundler_gemspec)
12
12
  end
13
13
 
14
14
  begin
15
- gem 'minitest', '~> 5.13'
15
+ gem 'test-unit', '~> 3.0'
16
16
  rescue Gem::LoadError
17
17
  end
18
18
 
@@ -32,16 +32,7 @@ else
32
32
  require 'bundler'
33
33
  end
34
34
 
35
- # Enable server plugin needed for bisection
36
- if ENV["RG_BISECT_SERVER_PLUGIN"]
37
- require ENV["RG_BISECT_SERVER_PLUGIN"]
38
-
39
- Minitest.extensions << "server"
40
- end
41
-
42
- ENV["MT_NO_PLUGINS"] = "true"
43
-
44
- require 'minitest/autorun'
35
+ require 'test/unit'
45
36
 
46
37
  ENV["JARS_SKIP"] = "true" if Gem.java_platform? # avoid unnecessary and noisy `jar-dependencies` post install hook
47
38
 
@@ -111,7 +102,7 @@ end
111
102
  # and uninstall gems, fetch remote gems through a stub fetcher and be assured
112
103
  # your normal set of gems is not affected.
113
104
 
114
- class Gem::TestCase < Minitest::Test
105
+ class Gem::TestCase < Test::Unit::TestCase
115
106
  extend Gem::Deprecate
116
107
 
117
108
  attr_accessor :fetcher # :nodoc:
@@ -140,11 +131,48 @@ class Gem::TestCase < Minitest::Test
140
131
  end
141
132
 
142
133
  def assert_directory_exists(path, msg = nil)
143
- msg = message(msg) { "Expected path '#{path}' to be a directory" }
144
- assert_path_exists path
134
+ msg = build_message(msg, "Expected path '#{path}' to be a directory")
135
+ assert_path_exist path
145
136
  assert File.directory?(path), msg
146
137
  end
147
138
 
139
+ # https://github.com/seattlerb/minitest/blob/21d9e804b63c619f602f3f4ece6c71b48974707a/lib/minitest/assertions.rb#L188
140
+ def _synchronize
141
+ yield
142
+ end
143
+
144
+ # https://github.com/seattlerb/minitest/blob/21d9e804b63c619f602f3f4ece6c71b48974707a/lib/minitest/assertions.rb#L546
145
+ def capture_subprocess_io
146
+ _synchronize do
147
+ begin
148
+ require "tempfile"
149
+
150
+ captured_stdout, captured_stderr = Tempfile.new("out"), Tempfile.new("err")
151
+
152
+ orig_stdout, orig_stderr = $stdout.dup, $stderr.dup
153
+ $stdout.reopen captured_stdout
154
+ $stderr.reopen captured_stderr
155
+
156
+ yield
157
+
158
+ $stdout.rewind
159
+ $stderr.rewind
160
+
161
+ return captured_stdout.read, captured_stderr.read
162
+ ensure
163
+ captured_stdout.unlink
164
+ captured_stderr.unlink
165
+ $stdout.reopen orig_stdout
166
+ $stderr.reopen orig_stderr
167
+
168
+ orig_stdout.close
169
+ orig_stderr.close
170
+ captured_stdout.close
171
+ captured_stderr.close
172
+ end
173
+ end
174
+ end
175
+
148
176
  ##
149
177
  # Sets the ENABLE_SHARED entry in RbConfig::CONFIG to +value+ and restores
150
178
  # the original value when the block ends
@@ -262,19 +290,19 @@ class Gem::TestCase < Minitest::Test
262
290
 
263
291
  def assert_contains_make_command(target, output, msg = nil)
264
292
  if output.match(/\n/)
265
- msg = message(msg) do
293
+ msg = build_message(msg,
266
294
  "Expected output containing make command \"%s\", but was \n\nBEGIN_OF_OUTPUT\n%sEND_OF_OUTPUT" % [
267
295
  ('%s %s' % [make_command, target]).rstrip,
268
296
  output,
269
297
  ]
270
- end
298
+ )
271
299
  else
272
- msg = message(msg) do
300
+ msg = build_message(msg,
273
301
  'Expected make command "%s": %s' % [
274
302
  ('%s %s' % [make_command, target]).rstrip,
275
303
  output,
276
304
  ]
277
- end
305
+ )
278
306
  end
279
307
 
280
308
  assert scan_make_command_lines(output).any? {|line|
@@ -525,6 +553,10 @@ class Gem::TestCase < Minitest::Test
525
553
  Gem.pre_uninstall_hooks.clear
526
554
  end
527
555
 
556
+ def without_any_upwards_gemfiles
557
+ ENV["BUNDLE_GEMFILE"] = File.join(@tempdir, "Gemfile")
558
+ end
559
+
528
560
  ##
529
561
  # A git_gem is used with a gem dependencies file. The gem created here
530
562
  # has no files, just a gem specification for the given +name+ and +version+.
@@ -664,6 +696,28 @@ class Gem::TestCase < Minitest::Test
664
696
  path
665
697
  end
666
698
 
699
+ ##
700
+ # Load a YAML string, the psych 3 way
701
+
702
+ def load_yaml(yaml)
703
+ if YAML.respond_to?(:unsafe_load)
704
+ YAML.unsafe_load(yaml)
705
+ else
706
+ YAML.load(yaml)
707
+ end
708
+ end
709
+
710
+ ##
711
+ # Load a YAML file, the psych 3 way
712
+
713
+ def load_yaml_file(file)
714
+ if YAML.respond_to?(:unsafe_load_file)
715
+ YAML.unsafe_load_file(file)
716
+ else
717
+ YAML.load_file(file)
718
+ end
719
+ end
720
+
667
721
  def all_spec_names
668
722
  Gem::Specification.map(&:full_name)
669
723
  end
@@ -1519,4 +1573,38 @@ Also, a list:
1519
1573
  end if Gem::HAVE_OPENSSL
1520
1574
  end
1521
1575
 
1576
+ # https://github.com/seattlerb/minitest/blob/13c48a03d84a2a87855a4de0c959f96800100357/lib/minitest/mock.rb#L192
1577
+ class Object
1578
+ def stub(name, val_or_callable, *block_args)
1579
+ new_name = "__minitest_stub__#{name}"
1580
+
1581
+ metaclass = class << self; self; end
1582
+
1583
+ if respond_to? name and not methods.map(&:to_s).include? name.to_s
1584
+ metaclass.send :define_method, name do |*args|
1585
+ super(*args)
1586
+ end
1587
+ end
1588
+
1589
+ metaclass.send :alias_method, new_name, name
1590
+
1591
+ metaclass.send :define_method, name do |*args, &blk|
1592
+ if val_or_callable.respond_to? :call
1593
+ val_or_callable.call(*args, &blk)
1594
+ else
1595
+ blk.call(*block_args) if blk
1596
+ val_or_callable
1597
+ end
1598
+ end
1599
+
1600
+ metaclass.send(:ruby2_keywords, name) if metaclass.respond_to?(:ruby2_keywords, true)
1601
+
1602
+ yield self
1603
+ ensure
1604
+ metaclass.send :undef_method, name
1605
+ metaclass.send :alias_method, name, new_name
1606
+ metaclass.send :undef_method, new_name
1607
+ end
1608
+ end
1609
+
1522
1610
  require 'rubygems/test_utilities'
@@ -18,6 +18,8 @@ class Gem::Licenses
18
18
  AFL-2.1
19
19
  AFL-3.0
20
20
  AGPL-1.0
21
+ AGPL-1.0-only
22
+ AGPL-1.0-or-later
21
23
  AGPL-3.0
22
24
  AGPL-3.0-only
23
25
  AGPL-3.0-or-later
@@ -25,6 +27,7 @@ class Gem::Licenses
25
27
  AML
26
28
  AMPAS
27
29
  ANTLR-PD
30
+ ANTLR-PD-fallback
28
31
  APAFML
29
32
  APL-1.0
30
33
  APSL-1.0
@@ -48,29 +51,41 @@ class Gem::Licenses
48
51
  BSD-2-Clause-FreeBSD
49
52
  BSD-2-Clause-NetBSD
50
53
  BSD-2-Clause-Patent
54
+ BSD-2-Clause-Views
51
55
  BSD-3-Clause
52
56
  BSD-3-Clause-Attribution
53
57
  BSD-3-Clause-Clear
54
58
  BSD-3-Clause-LBNL
59
+ BSD-3-Clause-Modification
60
+ BSD-3-Clause-No-Military-License
55
61
  BSD-3-Clause-No-Nuclear-License
56
62
  BSD-3-Clause-No-Nuclear-License-2014
57
63
  BSD-3-Clause-No-Nuclear-Warranty
64
+ BSD-3-Clause-Open-MPI
58
65
  BSD-4-Clause
66
+ BSD-4-Clause-Shortened
59
67
  BSD-4-Clause-UC
60
68
  BSD-Protection
61
69
  BSD-Source-Code
62
70
  BSL-1.0
71
+ BUSL-1.1
63
72
  Bahyph
64
73
  Barr
65
74
  Beerware
66
75
  BitTorrent-1.0
67
76
  BitTorrent-1.1
77
+ BlueOak-1.0.0
68
78
  Borceux
79
+ C-UDA-1.0
80
+ CAL-1.0
81
+ CAL-1.0-Combined-Work-Exception
69
82
  CATOSL-1.1
70
83
  CC-BY-1.0
71
84
  CC-BY-2.0
72
85
  CC-BY-2.5
73
86
  CC-BY-3.0
87
+ CC-BY-3.0-AT
88
+ CC-BY-3.0-US
74
89
  CC-BY-4.0
75
90
  CC-BY-NC-1.0
76
91
  CC-BY-NC-2.0
@@ -81,6 +96,7 @@ class Gem::Licenses
81
96
  CC-BY-NC-ND-2.0
82
97
  CC-BY-NC-ND-2.5
83
98
  CC-BY-NC-ND-3.0
99
+ CC-BY-NC-ND-3.0-IGO
84
100
  CC-BY-NC-ND-4.0
85
101
  CC-BY-NC-SA-1.0
86
102
  CC-BY-NC-SA-2.0
@@ -94,12 +110,17 @@ class Gem::Licenses
94
110
  CC-BY-ND-4.0
95
111
  CC-BY-SA-1.0
96
112
  CC-BY-SA-2.0
113
+ CC-BY-SA-2.0-UK
114
+ CC-BY-SA-2.1-JP
97
115
  CC-BY-SA-2.5
98
116
  CC-BY-SA-3.0
117
+ CC-BY-SA-3.0-AT
99
118
  CC-BY-SA-4.0
119
+ CC-PDDC
100
120
  CC0-1.0
101
121
  CDDL-1.0
102
122
  CDDL-1.1
123
+ CDL-1.0
103
124
  CDLA-Permissive-1.0
104
125
  CDLA-Sharing-1.0
105
126
  CECILL-1.0
@@ -108,6 +129,11 @@ class Gem::Licenses
108
129
  CECILL-2.1
109
130
  CECILL-B
110
131
  CECILL-C
132
+ CERN-OHL-1.1
133
+ CERN-OHL-1.2
134
+ CERN-OHL-P-2.0
135
+ CERN-OHL-S-2.0
136
+ CERN-OHL-W-2.0
111
137
  CNRI-Jython
112
138
  CNRI-Python
113
139
  CNRI-Python-GPL-Compatible
@@ -123,12 +149,14 @@ class Gem::Licenses
123
149
  Cube
124
150
  D-FSL-1.0
125
151
  DOC
152
+ DRL-1.0
126
153
  DSDP
127
154
  Dotseqn
128
155
  ECL-1.0
129
156
  ECL-2.0
130
157
  EFL-1.0
131
158
  EFL-2.0
159
+ EPICS
132
160
  EPL-1.0
133
161
  EPL-2.0
134
162
  EUDatagrid
@@ -144,17 +172,32 @@ class Gem::Licenses
144
172
  FTL
145
173
  Fair
146
174
  Frameworx-1.0
175
+ FreeBSD-DOC
147
176
  FreeImage
177
+ GD
148
178
  GFDL-1.1
179
+ GFDL-1.1-invariants-only
180
+ GFDL-1.1-invariants-or-later
181
+ GFDL-1.1-no-invariants-only
182
+ GFDL-1.1-no-invariants-or-later
149
183
  GFDL-1.1-only
150
184
  GFDL-1.1-or-later
151
185
  GFDL-1.2
186
+ GFDL-1.2-invariants-only
187
+ GFDL-1.2-invariants-or-later
188
+ GFDL-1.2-no-invariants-only
189
+ GFDL-1.2-no-invariants-or-later
152
190
  GFDL-1.2-only
153
191
  GFDL-1.2-or-later
154
192
  GFDL-1.3
193
+ GFDL-1.3-invariants-only
194
+ GFDL-1.3-invariants-or-later
195
+ GFDL-1.3-no-invariants-only
196
+ GFDL-1.3-no-invariants-or-later
155
197
  GFDL-1.3-only
156
198
  GFDL-1.3-or-later
157
199
  GL2PS
200
+ GLWTPL
158
201
  GPL-1.0
159
202
  GPL-1.0+
160
203
  GPL-1.0-only
@@ -178,7 +221,10 @@ class Gem::Licenses
178
221
  Glide
179
222
  Glulxe
180
223
  HPND
224
+ HPND-sell-variant
225
+ HTMLTIDY
181
226
  HaskellReport
227
+ Hippocratic-2.1
182
228
  IBM-pibs
183
229
  ICU
184
230
  IJG
@@ -191,6 +237,7 @@ class Gem::Licenses
191
237
  Intel
192
238
  Intel-ACPI
193
239
  Interbase-1.0
240
+ JPNIC
194
241
  JSON
195
242
  JasPer-2.0
196
243
  LAL-1.2
@@ -221,11 +268,15 @@ class Gem::Licenses
221
268
  LiLiQ-R-1.1
222
269
  LiLiQ-Rplus-1.1
223
270
  Libpng
271
+ Linux-OpenIB
224
272
  MIT
273
+ MIT-0
225
274
  MIT-CMU
275
+ MIT-Modern-Variant
226
276
  MIT-advertising
227
277
  MIT-enna
228
278
  MIT-feh
279
+ MIT-open-group
229
280
  MITNFA
230
281
  MPL-1.0
231
282
  MPL-1.1
@@ -237,12 +288,18 @@ class Gem::Licenses
237
288
  MakeIndex
238
289
  MirOS
239
290
  Motosoto
291
+ MulanPSL-1.0
292
+ MulanPSL-2.0
240
293
  Multics
241
294
  Mup
295
+ NAIST-2003
242
296
  NASA-1.3
243
297
  NBPL-1.0
298
+ NCGL-UK-2.0
244
299
  NCSA
245
300
  NGPL
301
+ NIST-PD
302
+ NIST-PD-fallback
246
303
  NLOD-1.0
247
304
  NLPL
248
305
  NOSL
@@ -251,6 +308,7 @@ class Gem::Licenses
251
308
  NPOSL-3.0
252
309
  NRL
253
310
  NTP
311
+ NTP-0
254
312
  Naumen
255
313
  Net-SNMP
256
314
  NetCDF
@@ -258,11 +316,23 @@ class Gem::Licenses
258
316
  Nokia
259
317
  Noweb
260
318
  Nunit
319
+ O-UDA-1.0
261
320
  OCCT-PL
262
321
  OCLC-2.0
322
+ ODC-By-1.0
263
323
  ODbL-1.0
264
324
  OFL-1.0
325
+ OFL-1.0-RFN
326
+ OFL-1.0-no-RFN
265
327
  OFL-1.1
328
+ OFL-1.1-RFN
329
+ OFL-1.1-no-RFN
330
+ OGC-1.0
331
+ OGDL-Taiwan-1.0
332
+ OGL-Canada-2.0
333
+ OGL-UK-1.0
334
+ OGL-UK-2.0
335
+ OGL-UK-3.0
266
336
  OGTSL
267
337
  OLDAP-1.1
268
338
  OLDAP-1.2
@@ -292,7 +362,12 @@ class Gem::Licenses
292
362
  PDDL-1.0
293
363
  PHP-3.0
294
364
  PHP-3.01
365
+ PSF-2.0
366
+ Parity-6.0.0
367
+ Parity-7.0.0
295
368
  Plexus
369
+ PolyForm-Noncommercial-1.0.0
370
+ PolyForm-Small-Business-1.0.0
296
371
  PostgreSQL
297
372
  Python-2.0
298
373
  QPL-1.0
@@ -310,15 +385,21 @@ class Gem::Licenses
310
385
  SGI-B-1.0
311
386
  SGI-B-1.1
312
387
  SGI-B-2.0
388
+ SHL-0.5
389
+ SHL-0.51
313
390
  SISSL
314
391
  SISSL-1.2
315
392
  SMLNJ
316
393
  SMPPL
317
394
  SNIA
318
395
  SPL-1.0
396
+ SSH-OpenSSH
397
+ SSH-short
398
+ SSPL-1.0
319
399
  SWL
320
400
  Saxpath
321
401
  Sendmail
402
+ Sendmail-8.23
322
403
  SimPL-2.0
323
404
  Sleepycat
324
405
  Spencer-86
@@ -326,11 +407,15 @@ class Gem::Licenses
326
407
  Spencer-99
327
408
  StandardML-NJ
328
409
  SugarCRM-1.1.3
410
+ TAPR-OHL-1.0
329
411
  TCL
330
412
  TCP-wrappers
331
413
  TMate
332
414
  TORQUE-1.1
333
415
  TOSL
416
+ TU-Berlin-1.0
417
+ TU-Berlin-2.0
418
+ UCL-1.0
334
419
  UPL-1.0
335
420
  Unicode-DFS-2015
336
421
  Unicode-DFS-2016
@@ -360,16 +445,22 @@ class Gem::Licenses
360
445
  Zimbra-1.3
361
446
  Zimbra-1.4
362
447
  Zlib
448
+ blessing
363
449
  bzip2-1.0.5
364
450
  bzip2-1.0.6
451
+ copyleft-next-0.3.0
452
+ copyleft-next-0.3.1
365
453
  curl
366
454
  diffmark
367
455
  dvipdfm
368
456
  eCos-2.0
369
457
  eGenix
458
+ etalab-2.0
370
459
  gSOAP-1.3b
371
460
  gnuplot
372
461
  iMatix
462
+ libpng-2.0
463
+ libselinux-1.0
373
464
  libtiff
374
465
  mpich2
375
466
  psfrag
@@ -395,12 +486,26 @@ class Gem::Licenses
395
486
  Font-exception-2.0
396
487
  GCC-exception-2.0
397
488
  GCC-exception-3.1
489
+ GPL-3.0-linking-exception
490
+ GPL-3.0-linking-source-exception
491
+ GPL-CC-1.0
492
+ LGPL-3.0-linking-exception
493
+ LLVM-exception
398
494
  LZMA-exception
399
495
  Libtool-exception
400
496
  Linux-syscall-note
401
497
  Nokia-Qt-exception-1.1
402
498
  OCCT-exception-1.0
499
+ OCaml-LGPL-linking-exception
500
+ OpenJDK-assembly-exception-1.0
501
+ PS-or-PDF-font-exception-20170817
502
+ Qt-GPL-exception-1.0
503
+ Qt-LGPL-exception-1.1
403
504
  Qwt-exception-1.0
505
+ SHL-2.0
506
+ SHL-2.1
507
+ Swift-exception
508
+ Universal-FOSS-exception-1.0
404
509
  WxWindows-exception-3.1
405
510
  eCos-exception-2.0
406
511
  freertos-exception-2.0
@@ -413,10 +518,10 @@ class Gem::Licenses
413
518
 
414
519
  REGEXP = %r{
415
520
  \A
416
- (
521
+ (?:
417
522
  #{Regexp.union(LICENSE_IDENTIFIERS)}
418
523
  \+?
419
- (\s WITH \s #{Regexp.union(EXCEPTION_IDENTIFIERS)})?
524
+ (?:\s WITH \s #{Regexp.union(EXCEPTION_IDENTIFIERS)})?
420
525
  | #{NONSTANDARD}
421
526
  )
422
527
  \Z