rubygems-update 2.7.6 → 2.7.11

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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -23
  3. data/History.txt +116 -0
  4. data/Manifest.txt +3 -3
  5. data/Rakefile +12 -2
  6. data/bundler/CHANGELOG.md +130 -0
  7. data/bundler/README.md +5 -1
  8. data/bundler/bundler.gemspec +2 -1
  9. data/bundler/lib/bundler.rb +12 -8
  10. data/bundler/lib/bundler/build_metadata.rb +19 -2
  11. data/bundler/lib/bundler/cli.rb +3 -1
  12. data/bundler/lib/bundler/cli/check.rb +1 -1
  13. data/bundler/lib/bundler/cli/exec.rb +4 -4
  14. data/bundler/lib/bundler/cli/gem.rb +5 -2
  15. data/bundler/lib/bundler/cli/init.rb +5 -0
  16. data/bundler/lib/bundler/cli/install.rb +2 -2
  17. data/bundler/lib/bundler/cli/outdated.rb +1 -1
  18. data/bundler/lib/bundler/cli/update.rb +3 -3
  19. data/bundler/lib/bundler/compact_index_client/updater.rb +10 -1
  20. data/bundler/lib/bundler/current_ruby.rb +8 -1
  21. data/bundler/lib/bundler/definition.rb +33 -23
  22. data/bundler/lib/bundler/dep_proxy.rb +2 -2
  23. data/bundler/lib/bundler/dependency.rb +1 -0
  24. data/bundler/lib/bundler/deprecate.rb +2 -1
  25. data/bundler/lib/bundler/endpoint_specification.rb +1 -1
  26. data/bundler/lib/bundler/env.rb +10 -8
  27. data/bundler/lib/bundler/fetcher.rb +3 -3
  28. data/bundler/lib/bundler/fetcher/downloader.rb +10 -5
  29. data/bundler/lib/bundler/fetcher/index.rb +2 -2
  30. data/bundler/lib/bundler/friendly_errors.rb +2 -0
  31. data/bundler/lib/bundler/gem_helper.rb +1 -1
  32. data/bundler/lib/bundler/gem_version_promoter.rb +12 -0
  33. data/bundler/lib/bundler/injector.rb +5 -5
  34. data/bundler/lib/bundler/installer.rb +12 -4
  35. data/bundler/lib/bundler/installer/gem_installer.rb +9 -2
  36. data/bundler/lib/bundler/installer/parallel_installer.rb +1 -1
  37. data/bundler/lib/bundler/lazy_specification.rb +1 -1
  38. data/bundler/lib/bundler/mirror.rb +2 -2
  39. data/bundler/lib/bundler/plugin.rb +2 -2
  40. data/bundler/lib/bundler/plugin/index.rb +7 -2
  41. data/bundler/lib/bundler/process_lock.rb +1 -1
  42. data/bundler/lib/bundler/resolver.rb +10 -9
  43. data/bundler/lib/bundler/resolver/spec_group.rb +0 -5
  44. data/bundler/lib/bundler/ruby_version.rb +1 -1
  45. data/bundler/lib/bundler/rubygems_integration.rb +9 -3
  46. data/bundler/lib/bundler/runtime.rb +2 -2
  47. data/bundler/lib/bundler/shared_helpers.rb +15 -3
  48. data/bundler/lib/bundler/source/git.rb +2 -1
  49. data/bundler/lib/bundler/source/git/git_proxy.rb +6 -1
  50. data/bundler/lib/bundler/source/metadata.rb +1 -1
  51. data/bundler/lib/bundler/source/rubygems.rb +11 -2
  52. data/bundler/lib/bundler/source/rubygems/remote.rb +4 -1
  53. data/bundler/lib/bundler/spec_set.rb +4 -1
  54. data/bundler/lib/bundler/templates/Executable +1 -1
  55. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +8 -2
  56. data/bundler/lib/bundler/templates/newgem/travis.yml.tt +2 -0
  57. data/bundler/lib/bundler/ui/shell.rb +3 -1
  58. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -1
  59. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +7 -2
  60. data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  61. data/bundler/lib/bundler/version.rb +1 -1
  62. data/bundler/man/bundle-binstubs.ronn +3 -3
  63. data/bundler/man/bundle-check.ronn +3 -3
  64. data/bundler/man/bundle-config.ronn +13 -9
  65. data/bundler/man/bundle-doctor.ronn +33 -0
  66. data/bundler/man/bundle-exec.ronn +3 -3
  67. data/bundler/man/bundle-gem.ronn +1 -1
  68. data/bundler/man/bundle-init.ronn +15 -4
  69. data/bundler/man/bundle-inject.ronn +3 -3
  70. data/bundler/man/bundle-install.ronn +12 -3
  71. data/bundler/man/bundle-lock.ronn +1 -1
  72. data/bundler/man/bundle-outdated.ronn +1 -1
  73. data/bundler/man/bundle-package.ronn +3 -3
  74. data/bundler/man/bundle-show.ronn +3 -2
  75. data/bundler/man/bundle-update.ronn +18 -14
  76. data/bundler/man/bundle-viz.ronn +1 -1
  77. data/bundler/man/bundle.ronn +27 -27
  78. data/bundler/man/gemfile.5.ronn +24 -9
  79. data/lib/rubygems.rb +24 -11
  80. data/lib/rubygems/bundler_version_finder.rb +9 -22
  81. data/lib/rubygems/command_manager.rb +6 -4
  82. data/lib/rubygems/commands/install_command.rb +7 -0
  83. data/lib/rubygems/commands/owner_command.rb +4 -1
  84. data/lib/rubygems/commands/push_command.rb +37 -4
  85. data/lib/rubygems/commands/setup_command.rb +3 -3
  86. data/lib/rubygems/commands/uninstall_command.rb +1 -1
  87. data/lib/rubygems/commands/unpack_command.rb +1 -1
  88. data/lib/rubygems/core_ext/kernel_require.rb +2 -7
  89. data/lib/rubygems/dependency.rb +1 -0
  90. data/lib/rubygems/dependency_installer.rb +4 -2
  91. data/lib/rubygems/exceptions.rb +5 -1
  92. data/lib/rubygems/gemcutter_utilities.rb +5 -2
  93. data/lib/rubygems/indexer.rb +1 -1
  94. data/lib/rubygems/install_update_options.rb +1 -1
  95. data/lib/rubygems/installer.rb +29 -6
  96. data/lib/rubygems/package.rb +20 -2
  97. data/lib/rubygems/package/tar_header.rb +3 -1
  98. data/lib/rubygems/package/tar_writer.rb +2 -3
  99. data/lib/rubygems/remote_fetcher.rb +1 -1
  100. data/lib/rubygems/request_set.rb +28 -17
  101. data/lib/rubygems/requirement.rb +14 -3
  102. data/lib/rubygems/resolver/api_specification.rb +5 -0
  103. data/lib/rubygems/security.rb +6 -1
  104. data/lib/rubygems/server.rb +3 -3
  105. data/lib/rubygems/source.rb +1 -1
  106. data/lib/rubygems/specification.rb +7 -10
  107. data/lib/rubygems/ssl_certs/{index.rubygems.org → rubygems.org}/GlobalSignRootCA.pem +0 -0
  108. data/lib/rubygems/ssl_certs/rubygems.org/GlobalSignRootCA_R3.pem +21 -0
  109. data/lib/rubygems/test_case.rb +22 -4
  110. data/lib/rubygems/test_utilities.rb +1 -1
  111. data/lib/rubygems/user_interaction.rb +9 -2
  112. data/lib/rubygems/util/licenses.rb +35 -4
  113. data/lib/rubygems/version.rb +7 -1
  114. data/lib/ubygems.rb +3 -0
  115. data/test/rubygems/test_bundled_ca.rb +7 -4
  116. data/test/rubygems/test_gem.rb +45 -10
  117. data/test/rubygems/test_gem_bundler_version_finder.rb +8 -7
  118. data/test/rubygems/test_gem_command_manager.rb +2 -2
  119. data/test/rubygems/test_gem_commands_build_command.rb +2 -0
  120. data/test/rubygems/test_gem_commands_install_command.rb +37 -0
  121. data/test/rubygems/test_gem_commands_push_command.rb +20 -0
  122. data/test/rubygems/test_gem_commands_setup_command.rb +6 -1
  123. data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
  124. data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -1
  125. data/test/rubygems/test_gem_dependency.rb +1 -1
  126. data/test/rubygems/test_gem_ext_rake_builder.rb +0 -4
  127. data/test/rubygems/test_gem_install_update_options.rb +2 -0
  128. data/test/rubygems/test_gem_installer.rb +109 -3
  129. data/test/rubygems/test_gem_package.rb +90 -5
  130. data/test/rubygems/test_gem_package_tar_header.rb +2 -1
  131. data/test/rubygems/test_gem_remote_fetcher.rb +6 -2
  132. data/test/rubygems/test_gem_request.rb +5 -2
  133. data/test/rubygems/test_gem_requirement.rb +6 -0
  134. data/test/rubygems/test_gem_resolver_api_specification.rb +24 -0
  135. data/test/rubygems/test_gem_resolver_installer_set.rb +1 -1
  136. data/test/rubygems/test_gem_security_policy.rb +3 -3
  137. data/test/rubygems/test_gem_server.rb +12 -12
  138. data/test/rubygems/test_gem_specification.rb +27 -13
  139. data/test/rubygems/test_gem_stream_ui.rb +2 -2
  140. data/test/rubygems/test_gem_text.rb +5 -0
  141. data/test/rubygems/test_gem_util.rb +4 -2
  142. data/test/rubygems/test_gem_version.rb +29 -2
  143. data/util/ci +1 -0
  144. data/util/generate_spdx_license_list.rb +15 -6
  145. data/util/update_bundled_ca_certificates.rb +1 -3
  146. metadata +12 -12
  147. data/lib/rubygems/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
  148. data/lib/rubygems/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
@@ -425,10 +425,28 @@ EOM
425
425
  raise Gem::Package::PathError.new(destination, destination_dir) unless
426
426
  destination.start_with? destination_dir + '/'
427
427
 
428
+ begin
429
+ real_destination = File.expand_path(File.realpath(destination))
430
+ rescue
431
+ # it's fine if the destination doesn't exist, because rm -rf'ing it can't cause any damage
432
+ nil
433
+ else
434
+ raise Gem::Package::PathError.new(real_destination, destination_dir) unless
435
+ real_destination.start_with? destination_dir + '/'
436
+ end
437
+
428
438
  destination.untaint
429
439
  destination
430
440
  end
431
441
 
442
+ def normalize_path(pathname)
443
+ if Gem.win_platform?
444
+ pathname.downcase
445
+ else
446
+ pathname
447
+ end
448
+ end
449
+
432
450
  def mkdir_p_safe mkdir, mkdir_options, destination_dir, file_name
433
451
  destination_dir = realpath File.expand_path(destination_dir)
434
452
  parts = mkdir.split(File::SEPARATOR)
@@ -437,7 +455,7 @@ EOM
437
455
  path = File.expand_path(path + File::SEPARATOR + basename)
438
456
  lstat = File.lstat path rescue nil
439
457
  if !lstat || !lstat.directory?
440
- unless path.start_with? destination_dir and (FileUtils.mkdir path, mkdir_options rescue false)
458
+ unless normalize_path(path).start_with? normalize_path(destination_dir) and (FileUtils.mkdir path, mkdir_options rescue false)
441
459
  raise Gem::Package::PathError.new(file_name, destination_dir)
442
460
  end
443
461
  end
@@ -591,7 +609,7 @@ EOM
591
609
  end
592
610
 
593
611
  case file_name
594
- when /^metadata(.gz)?$/ then
612
+ when "metadata", "metadata.gz" then
595
613
  load_spec entry
596
614
  when 'data.tar.gz' then
597
615
  verify_gz entry
@@ -94,12 +94,14 @@ class Gem::Package::TarHeader
94
94
 
95
95
  attr_reader(*FIELDS)
96
96
 
97
+ EMPTY_HEADER = ("\0" * 512).freeze # :nodoc:
98
+
97
99
  ##
98
100
  # Creates a tar header from IO +stream+
99
101
 
100
102
  def self.from(stream)
101
103
  header = stream.read 512
102
- empty = (header == "\0" * 512)
104
+ empty = (EMPTY_HEADER == header)
103
105
 
104
106
  fields = header.unpack UNPACK_FORMAT
105
107
 
@@ -111,7 +111,7 @@ class Gem::Package::TarWriter
111
111
  name, prefix = split_name name
112
112
 
113
113
  init_pos = @io.pos
114
- @io.write "\0" * 512 # placeholder for the header
114
+ @io.write Gem::Package::TarHeader::EMPTY_HEADER # placeholder for the header
115
115
 
116
116
  yield RestrictedStream.new(@io) if block_given?
117
117
 
@@ -189,8 +189,7 @@ class Gem::Package::TarWriter
189
189
  if digest.respond_to? :name then
190
190
  digest.name
191
191
  else
192
- /::([^:]+)$/ =~ digest.class.name
193
- $1
192
+ digest.class.name[/::([^:]+)\z/, 1]
194
193
  end
195
194
 
196
195
  digest_name == signer.digest_name
@@ -293,7 +293,7 @@ class Gem::RemoteFetcher
293
293
 
294
294
  if data and !head and uri.to_s =~ /\.gz$/
295
295
  begin
296
- data = Gem.gunzip data
296
+ data = Gem::Util.gunzip data
297
297
  rescue Zlib::GzipFile::Error
298
298
  raise FetchError.new("server did not return a valid file", uri.to_s)
299
299
  end
@@ -171,7 +171,9 @@ class Gem::RequestSet
171
171
  rescue Gem::RuntimeRequirementNotMetError => e
172
172
  recent_match = req.spec.set.find_all(req.request).sort_by(&:version).reverse_each.find do |s|
173
173
  s = s.spec
174
- s.required_ruby_version.satisfied_by?(Gem.ruby_version) && s.required_rubygems_version.satisfied_by?(Gem.rubygems_version)
174
+ s.required_ruby_version.satisfied_by?(Gem.ruby_version) &&
175
+ s.required_rubygems_version.satisfied_by?(Gem.rubygems_version) &&
176
+ Gem::Platform.installable?(s)
175
177
  end
176
178
  if recent_match
177
179
  suggestion = "The last version of #{req.request} to support your Ruby & RubyGems was #{recent_match.version}. Try installing it with `gem install #{recent_match.name} -v #{recent_match.version}`"
@@ -189,22 +191,7 @@ class Gem::RequestSet
189
191
 
190
192
  return requests if options[:gemdeps]
191
193
 
192
- specs = requests.map do |request|
193
- case request
194
- when Gem::Resolver::ActivationRequest then
195
- request.spec.spec
196
- else
197
- request
198
- end
199
- end
200
-
201
- require 'rubygems/dependency_installer'
202
- inst = Gem::DependencyInstaller.new options
203
- inst.installed_gems.replace specs
204
-
205
- Gem.done_installing_hooks.each do |hook|
206
- hook.call inst, specs
207
- end unless Gem.done_installing_hooks.empty?
194
+ install_hooks requests, options
208
195
 
209
196
  requests
210
197
  end
@@ -281,11 +268,35 @@ class Gem::RequestSet
281
268
  installed << request
282
269
  end
283
270
 
271
+ install_hooks installed, options
272
+
284
273
  installed
285
274
  ensure
286
275
  ENV['GEM_HOME'] = gem_home
287
276
  end
288
277
 
278
+ ##
279
+ # Call hooks on installed gems
280
+
281
+ def install_hooks requests, options
282
+ specs = requests.map do |request|
283
+ case request
284
+ when Gem::Resolver::ActivationRequest then
285
+ request.spec.spec
286
+ else
287
+ request
288
+ end
289
+ end
290
+
291
+ require "rubygems/dependency_installer"
292
+ inst = Gem::DependencyInstaller.new options
293
+ inst.installed_gems.replace specs
294
+
295
+ Gem.done_installing_hooks.each do |hook|
296
+ hook.call inst, specs
297
+ end unless Gem.done_installing_hooks.empty?
298
+ end
299
+
289
300
  ##
290
301
  # Load a dependency management file.
291
302
 
@@ -133,6 +133,7 @@ class Gem::Requirement
133
133
  @requirements = [DefaultRequirement]
134
134
  else
135
135
  @requirements = requirements.map! { |r| self.class.parse r }
136
+ sort_requirements!
136
137
  end
137
138
  end
138
139
 
@@ -146,6 +147,7 @@ class Gem::Requirement
146
147
  new = new.map { |r| self.class.parse r }
147
148
 
148
149
  @requirements.concat new
150
+ sort_requirements!
149
151
  end
150
152
 
151
153
  ##
@@ -183,11 +185,11 @@ class Gem::Requirement
183
185
  end
184
186
 
185
187
  def as_list # :nodoc:
186
- requirements.map { |op, version| "#{op} #{version}" }.sort
188
+ requirements.map { |op, version| "#{op} #{version}" }
187
189
  end
188
190
 
189
191
  def hash # :nodoc:
190
- requirements.sort.hash
192
+ requirements.hash
191
193
  end
192
194
 
193
195
  def marshal_dump # :nodoc:
@@ -264,7 +266,8 @@ class Gem::Requirement
264
266
  end
265
267
 
266
268
  def == other # :nodoc:
267
- Gem::Requirement === other and to_s == other.to_s
269
+ return unless Gem::Requirement === other
270
+ requirements == other.requirements
268
271
  end
269
272
 
270
273
  private
@@ -279,6 +282,14 @@ class Gem::Requirement
279
282
  end
280
283
  end
281
284
  end
285
+
286
+ def sort_requirements! # :nodoc:
287
+ @requirements.sort! do |l, r|
288
+ comp = l.last <=> r.last # first, sort by the requirement's version
289
+ next comp unless comp == 0
290
+ l.first <=> r.first # then, sort by the operator (for stability)
291
+ end
292
+ end
282
293
  end
283
294
 
284
295
  class Gem::Version
@@ -21,6 +21,7 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
21
21
  @name = api_data[:name]
22
22
  @version = Gem::Version.new api_data[:number]
23
23
  @platform = Gem::Platform.new api_data[:platform]
24
+ @original_platform = api_data[:platform]
24
25
  @dependencies = api_data[:dependencies].map do |name, ver|
25
26
  Gem::Dependency.new name, ver.split(/\s*,\s*/)
26
27
  end
@@ -73,7 +74,11 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
73
74
  @spec ||=
74
75
  begin
75
76
  tuple = Gem::NameTuple.new @name, @version, @platform
77
+ source.fetch_spec tuple
78
+ rescue Gem::RemoteFetcher::FetchError
79
+ raise if @original_platform == @platform
76
80
 
81
+ tuple = Gem::NameTuple.new @name, @version, @original_platform
77
82
  source.fetch_spec tuple
78
83
  end
79
84
  end
@@ -344,14 +344,19 @@ module Gem::Security
344
344
  OpenSSL::Digest::SHA256
345
345
  elsif defined?(OpenSSL::Digest::SHA1) then
346
346
  OpenSSL::Digest::SHA1
347
+ else
348
+ require 'digest'
349
+ Digest::SHA512
347
350
  end
348
351
 
349
352
  ##
350
353
  # Used internally to select the signing digest from all computed digests
351
354
 
352
355
  DIGEST_NAME = # :nodoc:
353
- if DIGEST_ALGORITHM then
356
+ if DIGEST_ALGORITHM.method_defined? :name then
354
357
  DIGEST_ALGORITHM.new.name
358
+ else
359
+ DIGEST_ALGORITHM.name[/::([^:]+)\z/, 1]
355
360
  end
356
361
 
357
362
  ##
@@ -492,7 +492,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
492
492
  specs = Marshal.dump specs
493
493
 
494
494
  if req.path =~ /\.gz$/ then
495
- specs = Gem.gzip specs
495
+ specs = Gem::Util.gzip specs
496
496
  res['content-type'] = 'application/x-gzip'
497
497
  else
498
498
  res['content-type'] = 'application/octet-stream'
@@ -553,7 +553,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
553
553
  specs = Marshal.dump specs
554
554
 
555
555
  if req.path =~ /\.gz$/ then
556
- specs = Gem.gzip specs
556
+ specs = Gem::Util.gzip specs
557
557
  res['content-type'] = 'application/x-gzip'
558
558
  else
559
559
  res['content-type'] = 'application/octet-stream'
@@ -852,7 +852,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
852
852
  specs = Marshal.dump specs
853
853
 
854
854
  if req.path =~ /\.gz$/ then
855
- specs = Gem.gzip specs
855
+ specs = Gem::Util.gzip specs
856
856
  res['content-type'] = 'application/x-gzip'
857
857
  else
858
858
  res['content-type'] = 'application/octet-stream'
@@ -155,7 +155,7 @@ class Gem::Source
155
155
  uri.path << '.rz'
156
156
 
157
157
  spec = fetcher.fetch_path uri
158
- spec = Gem.inflate spec
158
+ spec = Gem::Util.inflate spec
159
159
 
160
160
  if update_cache? then
161
161
  FileUtils.mkdir_p cache_dir
@@ -40,6 +40,8 @@ require 'uri'
40
40
 
41
41
  class Gem::Specification < Gem::BasicSpecification
42
42
 
43
+ extend Gem::Deprecate
44
+
43
45
  # REFACTOR: Consider breaking out this version stuff into a separate
44
46
  # module. There's enough special stuff around it that it may justify
45
47
  # a separate class.
@@ -715,6 +717,7 @@ class Gem::Specification < Gem::BasicSpecification
715
717
  # Deprecated: You must now specify the executable name to Gem.bin_path.
716
718
 
717
719
  attr_writer :default_executable
720
+ deprecate :default_executable=, :none, 2018, 12
718
721
 
719
722
  ##
720
723
  # Allows deinstallation of gems with legacy platforms.
@@ -1810,6 +1813,7 @@ class Gem::Specification < Gem::BasicSpecification
1810
1813
  end
1811
1814
  result
1812
1815
  end
1816
+ deprecate :default_executable, :none, 2018, 12
1813
1817
 
1814
1818
  ##
1815
1819
  # The default value for specification attribute +name+
@@ -2018,6 +2022,7 @@ class Gem::Specification < Gem::BasicSpecification
2018
2022
  def has_rdoc # :nodoc:
2019
2023
  true
2020
2024
  end
2025
+ deprecate :has_rdoc, :none, 2018, 12
2021
2026
 
2022
2027
  ##
2023
2028
  # Deprecated and ignored.
@@ -2027,8 +2032,10 @@ class Gem::Specification < Gem::BasicSpecification
2027
2032
  def has_rdoc= ignored # :nodoc:
2028
2033
  @has_rdoc = true
2029
2034
  end
2035
+ deprecate :has_rdoc=, :none, 2018, 12
2030
2036
 
2031
2037
  alias :has_rdoc? :has_rdoc # :nodoc:
2038
+ deprecate :has_rdoc?, :none, 2018, 12
2032
2039
 
2033
2040
  ##
2034
2041
  # True if this gem has files in test_files
@@ -3074,16 +3081,6 @@ open-ended dependency on #{dep} is not recommended
3074
3081
  @require_paths
3075
3082
  end
3076
3083
 
3077
- extend Gem::Deprecate
3078
-
3079
- # TODO:
3080
- # deprecate :has_rdoc, :none, 2011, 10
3081
- # deprecate :has_rdoc?, :none, 2011, 10
3082
- # deprecate :has_rdoc=, :none, 2011, 10
3083
- # deprecate :default_executable, :none, 2011, 10
3084
- # deprecate :default_executable=, :none, 2011, 10
3085
- # deprecate :file_name, :cache_file, 2011, 10
3086
- # deprecate :full_gem_path, :cache_file, 2011, 10
3087
3084
  end
3088
3085
 
3089
3086
  # DOC: What is this and why is it here, randomly, at the end of this file?
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
3
+ A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
4
+ Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
5
+ MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
6
+ A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
7
+ hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
8
+ RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
9
+ gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
10
+ KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
11
+ QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
12
+ XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
13
+ DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
14
+ LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
15
+ RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
16
+ jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
17
+ 6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
18
+ mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
19
+ Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
20
+ WD9f
21
+ -----END CERTIFICATE-----
@@ -86,7 +86,9 @@ end
86
86
  #
87
87
  # Tests are always run at a safe level of 1.
88
88
 
89
- class Gem::TestCase < MiniTest::Unit::TestCase
89
+ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Unit::TestCase)
90
+
91
+ extend Gem::Deprecate
90
92
 
91
93
  attr_accessor :fetcher # :nodoc:
92
94
 
@@ -295,7 +297,16 @@ class Gem::TestCase < MiniTest::Unit::TestCase
295
297
 
296
298
  @orig_LOAD_PATH = $LOAD_PATH.dup
297
299
  $LOAD_PATH.map! { |s|
298
- (expand_path = File.expand_path(s)) == s ? s : expand_path.untaint
300
+ expand_path = File.expand_path(s)
301
+ if expand_path != s
302
+ expand_path.untaint
303
+ if s.instance_variable_defined?(:@gem_prelude_index)
304
+ expand_path.instance_variable_set(:@gem_prelude_index, expand_path)
305
+ end
306
+ expand_path.freeze if s.frozen?
307
+ s = expand_path
308
+ end
309
+ s
299
310
  }
300
311
 
301
312
  Dir.chdir @tempdir
@@ -663,11 +674,13 @@ class Gem::TestCase < MiniTest::Unit::TestCase
663
674
  end
664
675
 
665
676
  ##
666
- # TODO: remove in RubyGems 3.0
677
+ # TODO: remove in RubyGems 4.0
667
678
 
668
679
  def quick_spec name, version = '2' # :nodoc:
669
680
  util_spec name, version
670
681
  end
682
+ deprecate :quick_spec, :util_spec, 2018, 12
683
+
671
684
 
672
685
  ##
673
686
  # Builds a gem from +spec+ and places it in <tt>File.join @gemhome,
@@ -756,13 +769,16 @@ class Gem::TestCase < MiniTest::Unit::TestCase
756
769
  old_loaded_features = $LOADED_FEATURES.dup
757
770
  yield
758
771
  ensure
772
+ prefix = File.dirname(__FILE__) + "/"
773
+ new_features = ($LOADED_FEATURES - old_loaded_features)
774
+ old_loaded_features.concat(new_features.select {|f| f.rindex(prefix, 0)})
759
775
  $LOADED_FEATURES.replace old_loaded_features
760
776
  end
761
777
 
762
778
  ##
763
779
  # new_spec is deprecated as it is never used.
764
780
  #
765
- # TODO: remove in RubyGems 3.0
781
+ # TODO: remove in RubyGems 4.0
766
782
 
767
783
  def new_spec name, version, deps = nil, *files # :nodoc:
768
784
  require 'rubygems/specification'
@@ -803,6 +819,8 @@ class Gem::TestCase < MiniTest::Unit::TestCase
803
819
 
804
820
  spec
805
821
  end
822
+ # TODO: mark deprecate after replacing util_spec from new_spec
823
+ # deprecate :new_spec, :none, 2018, 12
806
824
 
807
825
  def new_default_spec(name, version, deps = nil, *files)
808
826
  spec = util_spec name, version, deps