rubygems-update 3.7.2 → 4.0.0.beta1

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 (206) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1413 -1323
  3. data/CODE_OF_CONDUCT.md +7 -129
  4. data/Manifest.txt +5 -11
  5. data/README.md +2 -2
  6. data/bundler/CHANGELOG.md +990 -917
  7. data/bundler/README.md +4 -4
  8. data/bundler/bundler.gemspec +3 -3
  9. data/bundler/lib/bundler/build_metadata.rb +2 -2
  10. data/bundler/lib/bundler/capistrano.rb +1 -19
  11. data/bundler/lib/bundler/cli/cache.rb +1 -11
  12. data/bundler/lib/bundler/cli/common.rb +20 -3
  13. data/bundler/lib/bundler/cli/config.rb +1 -2
  14. data/bundler/lib/bundler/cli/console.rb +5 -0
  15. data/bundler/lib/bundler/cli/exec.rb +29 -4
  16. data/bundler/lib/bundler/cli/gem.rb +19 -33
  17. data/bundler/lib/bundler/cli/install.rb +7 -82
  18. data/bundler/lib/bundler/cli/issue.rb +2 -2
  19. data/bundler/lib/bundler/cli/list.rb +33 -2
  20. data/bundler/lib/bundler/cli/plugin.rb +5 -1
  21. data/bundler/lib/bundler/cli/show.rb +1 -1
  22. data/bundler/lib/bundler/cli/update.rb +3 -3
  23. data/bundler/lib/bundler/cli.rb +75 -83
  24. data/bundler/lib/bundler/compact_index_client.rb +0 -1
  25. data/bundler/lib/bundler/current_ruby.rb +3 -15
  26. data/bundler/lib/bundler/definition.rb +45 -35
  27. data/bundler/lib/bundler/deployment.rb +1 -64
  28. data/bundler/lib/bundler/digest.rb +1 -1
  29. data/bundler/lib/bundler/dsl.rb +13 -35
  30. data/bundler/lib/bundler/endpoint_specification.rb +0 -22
  31. data/bundler/lib/bundler/errors.rb +1 -5
  32. data/bundler/lib/bundler/feature_flag.rb +0 -33
  33. data/bundler/lib/bundler/fetcher/compact_index.rb +1 -1
  34. data/bundler/lib/bundler/friendly_errors.rb +2 -2
  35. data/bundler/lib/bundler/index.rb +0 -7
  36. data/bundler/lib/bundler/inline.rb +1 -1
  37. data/bundler/lib/bundler/installer/gem_installer.rb +0 -11
  38. data/bundler/lib/bundler/installer.rb +0 -6
  39. data/bundler/lib/bundler/lockfile_generator.rb +1 -1
  40. data/bundler/lib/bundler/lockfile_parser.rb +2 -12
  41. data/bundler/lib/bundler/man/bundle-add.1 +1 -1
  42. data/bundler/lib/bundler/man/bundle-binstubs.1 +3 -6
  43. data/bundler/lib/bundler/man/bundle-binstubs.1.ronn +4 -6
  44. data/bundler/lib/bundler/man/bundle-cache.1 +2 -14
  45. data/bundler/lib/bundler/man/bundle-cache.1.ronn +1 -14
  46. data/bundler/lib/bundler/man/bundle-check.1 +2 -5
  47. data/bundler/lib/bundler/man/bundle-check.1.ronn +0 -5
  48. data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
  49. data/bundler/lib/bundler/man/bundle-config.1 +6 -33
  50. data/bundler/lib/bundler/man/bundle-config.1.ronn +20 -55
  51. data/bundler/lib/bundler/man/bundle-console.1 +1 -1
  52. data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
  53. data/bundler/lib/bundler/man/bundle-env.1 +1 -1
  54. data/bundler/lib/bundler/man/bundle-exec.1 +2 -5
  55. data/bundler/lib/bundler/man/bundle-exec.1.ronn +1 -5
  56. data/bundler/lib/bundler/man/bundle-fund.1 +1 -1
  57. data/bundler/lib/bundler/man/bundle-gem.1 +3 -6
  58. data/bundler/lib/bundler/man/bundle-gem.1.ronn +2 -5
  59. data/bundler/lib/bundler/man/bundle-help.1 +1 -1
  60. data/bundler/lib/bundler/man/bundle-info.1 +1 -1
  61. data/bundler/lib/bundler/man/bundle-init.1 +1 -1
  62. data/bundler/lib/bundler/man/bundle-install.1 +8 -59
  63. data/bundler/lib/bundler/man/bundle-install.1.ronn +12 -107
  64. data/bundler/lib/bundler/man/bundle-issue.1 +1 -1
  65. data/bundler/lib/bundler/man/bundle-licenses.1 +1 -1
  66. data/bundler/lib/bundler/man/bundle-list.1 +6 -1
  67. data/bundler/lib/bundler/man/bundle-list.1.ronn +5 -0
  68. data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
  69. data/bundler/lib/bundler/man/bundle-open.1 +1 -1
  70. data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
  71. data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
  72. data/bundler/lib/bundler/man/bundle-plugin.1 +2 -9
  73. data/bundler/lib/bundler/man/bundle-plugin.1.ronn +0 -8
  74. data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
  75. data/bundler/lib/bundler/man/bundle-remove.1 +2 -8
  76. data/bundler/lib/bundler/man/bundle-remove.1.ronn +1 -8
  77. data/bundler/lib/bundler/man/bundle-show.1 +2 -5
  78. data/bundler/lib/bundler/man/bundle-show.1.ronn +0 -4
  79. data/bundler/lib/bundler/man/bundle-update.1 +1 -1
  80. data/bundler/lib/bundler/man/bundle-version.1 +1 -1
  81. data/bundler/lib/bundler/man/bundle.1 +1 -10
  82. data/bundler/lib/bundler/man/bundle.1.ronn +0 -9
  83. data/bundler/lib/bundler/man/gemfile.5 +1 -1
  84. data/bundler/lib/bundler/man/index.txt +0 -2
  85. data/bundler/lib/bundler/materialization.rb +1 -1
  86. data/bundler/lib/bundler/plugin/installer.rb +0 -10
  87. data/bundler/lib/bundler/plugin/source_list.rb +1 -1
  88. data/bundler/lib/bundler/plugin.rb +1 -1
  89. data/bundler/lib/bundler/resolver.rb +1 -1
  90. data/bundler/lib/bundler/ruby_dsl.rb +2 -0
  91. data/bundler/lib/bundler/ruby_version.rb +1 -3
  92. data/bundler/lib/bundler/rubygems_ext.rb +1 -1
  93. data/bundler/lib/bundler/rubygems_gem_installer.rb +1 -1
  94. data/bundler/lib/bundler/rubygems_integration.rb +1 -5
  95. data/bundler/lib/bundler/self_manager.rb +1 -1
  96. data/bundler/lib/bundler/settings.rb +7 -26
  97. data/bundler/lib/bundler/shared_helpers.rb +8 -20
  98. data/bundler/lib/bundler/source/git/git_proxy.rb +3 -11
  99. data/bundler/lib/bundler/source/git.rb +2 -3
  100. data/bundler/lib/bundler/source/path.rb +3 -7
  101. data/bundler/lib/bundler/source/rubygems.rb +11 -17
  102. data/bundler/lib/bundler/source.rb +1 -1
  103. data/bundler/lib/bundler/source_list.rb +4 -45
  104. data/bundler/lib/bundler/source_map.rb +2 -5
  105. data/bundler/lib/bundler/spec_set.rb +6 -15
  106. data/bundler/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +7 -129
  107. data/bundler/lib/bundler/templates/newgem/circleci/config.yml.tt +12 -0
  108. data/bundler/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
  109. data/bundler/lib/bundler/templates/newgem/ext/newgem/extconf-go.rb.tt +11 -0
  110. data/bundler/lib/bundler/templates/newgem/ext/newgem/go.mod.tt +5 -0
  111. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem-go.c.tt +2 -0
  112. data/bundler/lib/bundler/templates/newgem/ext/newgem/newgem.go.tt +31 -0
  113. data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +6 -0
  114. data/bundler/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
  115. data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -1
  116. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +26 -23
  117. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  118. data/bundler/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +50 -6
  119. data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +57 -52
  120. data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +5 -2
  121. data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +1 -1
  122. data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +57 -15
  123. data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +1 -1
  124. data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +34 -21
  125. data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +12 -0
  126. data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +9 -8
  127. data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +2 -2
  128. data/bundler/lib/bundler/version.rb +1 -1
  129. data/bundler/lib/bundler/vlad.rb +1 -14
  130. data/bundler/lib/bundler.rb +6 -28
  131. data/doc/MAINTAINERS.txt +0 -7
  132. data/doc/bundler/UPGRADING.md +11 -5
  133. data/doc/rubygems/CONTRIBUTING.md +1 -1
  134. data/lib/rubygems/basic_specification.rb +3 -9
  135. data/lib/rubygems/bundler_version_finder.rb +1 -0
  136. data/lib/rubygems/command.rb +1 -1
  137. data/lib/rubygems/command_manager.rb +3 -4
  138. data/lib/rubygems/commands/build_command.rb +0 -7
  139. data/lib/rubygems/commands/cert_command.rb +1 -1
  140. data/lib/rubygems/commands/install_command.rb +1 -5
  141. data/lib/rubygems/commands/setup_command.rb +5 -3
  142. data/lib/rubygems/config_file.rb +1 -1
  143. data/lib/rubygems/dependency.rb +1 -1
  144. data/lib/rubygems/dependency_installer.rb +0 -77
  145. data/lib/rubygems/dependency_list.rb +1 -2
  146. data/lib/rubygems/deprecate.rb +74 -72
  147. data/lib/rubygems/doctor.rb +1 -1
  148. data/lib/rubygems/errors.rb +1 -1
  149. data/lib/rubygems/exceptions.rb +2 -3
  150. data/lib/rubygems/ext/builder.rb +6 -2
  151. data/lib/rubygems/ext/cargo_builder.rb +2 -2
  152. data/lib/rubygems/ext/cmake_builder.rb +97 -8
  153. data/lib/rubygems/ext/configure_builder.rb +2 -2
  154. data/lib/rubygems/ext/ext_conf_builder.rb +6 -2
  155. data/lib/rubygems/ext/rake_builder.rb +2 -2
  156. data/lib/rubygems/gem_runner.rb +0 -1
  157. data/lib/rubygems/install_update_options.rb +1 -2
  158. data/lib/rubygems/installer.rb +16 -54
  159. data/lib/rubygems/name_tuple.rb +7 -1
  160. data/lib/rubygems/package/tar_header.rb +4 -4
  161. data/lib/rubygems/package/tar_reader.rb +2 -0
  162. data/lib/rubygems/package/tar_writer.rb +1 -1
  163. data/lib/rubygems/package.rb +21 -12
  164. data/lib/rubygems/platform.rb +31 -11
  165. data/lib/rubygems/remote_fetcher.rb +8 -5
  166. data/lib/rubygems/resolver/conflict.rb +1 -1
  167. data/lib/rubygems/resolver.rb +1 -1
  168. data/lib/rubygems/security/signer.rb +1 -1
  169. data/lib/rubygems/source.rb +2 -2
  170. data/lib/rubygems/spec_fetcher.rb +4 -4
  171. data/lib/rubygems/specification.rb +5 -96
  172. data/lib/rubygems/specification_policy.rb +0 -36
  173. data/lib/rubygems/specification_record.rb +1 -1
  174. data/lib/rubygems/text.rb +1 -1
  175. data/lib/rubygems/uninstaller.rb +17 -6
  176. data/lib/rubygems/user_interaction.rb +6 -9
  177. data/lib/rubygems/util.rb +0 -22
  178. data/lib/rubygems/validator.rb +1 -1
  179. data/lib/rubygems/vendor/net-http/lib/net/http/generic_request.rb +25 -9
  180. data/lib/rubygems/vendor/net-http/lib/net/http/responses.rb +2 -2
  181. data/lib/rubygems/vendor/net-http/lib/net/http.rb +14 -14
  182. data/lib/rubygems/vendor/optparse/lib/optparse.rb +82 -41
  183. data/lib/rubygems/vendor/resolv/lib/resolv.rb +1 -1
  184. data/lib/rubygems/vendor/timeout/lib/timeout.rb +4 -1
  185. data/lib/rubygems/vendor/uri/lib/uri/common.rb +57 -15
  186. data/lib/rubygems/vendor/uri/lib/uri/file.rb +1 -1
  187. data/lib/rubygems/vendor/uri/lib/uri/generic.rb +34 -21
  188. data/lib/rubygems/vendor/uri/lib/uri/http.rb +12 -0
  189. data/lib/rubygems/vendor/uri/lib/uri/rfc2396_parser.rb +9 -8
  190. data/lib/rubygems/vendor/uri/lib/uri/version.rb +2 -2
  191. data/lib/rubygems/version.rb +2 -17
  192. data/lib/rubygems/win_platform.rb +31 -0
  193. data/lib/rubygems.rb +10 -38
  194. data/rubygems-update.gemspec +4 -4
  195. metadata +10 -18
  196. data/bundler/lib/bundler/cli/inject.rb +0 -60
  197. data/bundler/lib/bundler/cli/viz.rb +0 -31
  198. data/bundler/lib/bundler/graph.rb +0 -152
  199. data/bundler/lib/bundler/man/bundle-inject.1 +0 -31
  200. data/bundler/lib/bundler/man/bundle-inject.1.ronn +0 -32
  201. data/bundler/lib/bundler/man/bundle-viz.1 +0 -30
  202. data/bundler/lib/bundler/man/bundle-viz.1.ronn +0 -36
  203. data/bundler/lib/bundler/similarity_detector.rb +0 -63
  204. data/lib/rubygems/commands/query_command.rb +0 -43
  205. data/lib/rubygems/compatibility.rb +0 -41
  206. data/lib/rubygems/install_default_message.rb +0 -13
@@ -34,15 +34,6 @@ class Gem::BasicSpecification
34
34
  internal_init
35
35
  end
36
36
 
37
- def self.default_specifications_dir
38
- Gem.default_specifications_dir
39
- end
40
-
41
- class << self
42
- extend Gem::Deprecate
43
- rubygems_deprecate :default_specifications_dir, "Gem.default_specifications_dir"
44
- end
45
-
46
37
  ##
47
38
  # The path to the gem.build_complete file within the extension install
48
39
  # directory.
@@ -199,6 +190,9 @@ class Gem::BasicSpecification
199
190
  File.expand_path(File.join(gems_dir, full_name, "data", name))
200
191
  end
201
192
 
193
+ extend Gem::Deprecate
194
+ rubygems_deprecate :datadir, :none, "4.1"
195
+
202
196
  ##
203
197
  # Full path of the target library file.
204
198
  # If the file is not in this gem, return nil.
@@ -3,6 +3,7 @@
3
3
  module Gem::BundlerVersionFinder
4
4
  def self.bundler_version
5
5
  v = ENV["BUNDLER_VERSION"]
6
+ v = nil if v&.empty?
6
7
 
7
8
  v ||= bundle_update_bundler_version
8
9
  return if v == true
@@ -117,7 +117,7 @@ class Gem::Command
117
117
  # Unhandled arguments (gem names, files, etc.) are left in
118
118
  # <tt>options[:args]</tt>.
119
119
 
120
- def initialize(command, summary=nil, defaults={})
120
+ def initialize(command, summary = nil, defaults = {})
121
121
  @command = command
122
122
  @summary = summary
123
123
  @program_name = "gem #{command}"
@@ -58,7 +58,6 @@ class Gem::CommandManager
58
58
  :owner,
59
59
  :pristine,
60
60
  :push,
61
- :query,
62
61
  :rdoc,
63
62
  :rebuild,
64
63
  :search,
@@ -118,7 +117,7 @@ class Gem::CommandManager
118
117
  ##
119
118
  # Register the Symbol +command+ as a gem command.
120
119
 
121
- def register_command(command, obj=false)
120
+ def register_command(command, obj = false)
122
121
  @commands[command] = obj
123
122
  end
124
123
 
@@ -148,7 +147,7 @@ class Gem::CommandManager
148
147
  ##
149
148
  # Run the command specified by +args+.
150
149
 
151
- def run(args, build_args=nil)
150
+ def run(args, build_args = nil)
152
151
  process_args(args, build_args)
153
152
  rescue StandardError, Gem::Timeout::Error => ex
154
153
  if ex.respond_to?(:detailed_message)
@@ -165,7 +164,7 @@ class Gem::CommandManager
165
164
  terminate_interaction(1)
166
165
  end
167
166
 
168
- def process_args(args, build_args=nil)
167
+ def process_args(args, build_args = nil)
169
168
  if args.empty?
170
169
  say Gem::Command::HELP
171
170
  terminate_interaction 1
@@ -25,13 +25,6 @@ class Gem::Commands::BuildCommand < Gem::Command
25
25
  add_option "-o", "--output FILE", "output gem with the given filename" do |value, options|
26
26
  options[:output] = value
27
27
  end
28
-
29
- add_option "-C PATH", "Run as if gem build was started in <PATH> instead of the current working directory." do |value, options|
30
- options[:build_path] = value
31
- end
32
- deprecate_option "-C",
33
- version: "4.0",
34
- extra_msg: "-C is a global flag now. Use `gem -C PATH build GEMSPEC_FILE [options]` instead"
35
28
  end
36
29
 
37
30
  def arguments # :nodoc:
@@ -158,7 +158,7 @@ class Gem::Commands::CertCommand < Gem::Command
158
158
  cert = Gem::Security.create_cert_email(
159
159
  email,
160
160
  key,
161
- (Gem::Security::ONE_DAY * expiration_length_days)
161
+ Gem::Security::ONE_DAY * expiration_length_days
162
162
  )
163
163
 
164
164
  Gem::Security.write cert, "gem-public_cert.pem"
@@ -239,11 +239,7 @@ You can use `i` command instead of `install`.
239
239
  # Loads post-install hooks
240
240
 
241
241
  def load_hooks # :nodoc:
242
- if options[:install_as_default]
243
- require_relative "../install_default_message"
244
- else
245
- require_relative "../install_message"
246
- end
242
+ require_relative "../install_message"
247
243
  require_relative "../rdoc"
248
244
  end
249
245
 
@@ -393,16 +393,18 @@ By default, this RubyGems will install gem as:
393
393
  Dir.chdir("bundler") do
394
394
  built_gem = Gem::Package.build(new_bundler_spec)
395
395
  begin
396
- Gem::Installer.at(
396
+ installer = Gem::Installer.at(
397
397
  built_gem,
398
398
  env_shebang: options[:env_shebang],
399
399
  format_executable: options[:format_executable],
400
400
  force: options[:force],
401
- install_as_default: true,
402
401
  bin_dir: bin_dir,
403
402
  install_dir: default_dir,
404
403
  wrappers: true
405
- ).install
404
+ )
405
+ installer.install
406
+ File.delete installer.spec_file
407
+ installer.write_default_spec
406
408
  ensure
407
409
  FileUtils.rm_f built_gem
408
410
  end
@@ -345,7 +345,7 @@ if you believe they were disclosed to a third party.
345
345
  require "fileutils"
346
346
  FileUtils.mkdir_p(dirname)
347
347
 
348
- permissions = 0o600 & (~File.umask)
348
+ permissions = 0o600 & ~File.umask
349
349
  File.open(credentials_path, "w", permissions) do |f|
350
350
  f.write self.class.dump_with_rubygems_yaml(config)
351
351
  end
@@ -217,7 +217,7 @@ class Gem::Dependency
217
217
  # NOTE: Unlike #matches_spec? this method does not return true when the
218
218
  # version is a prerelease version unless this is a prerelease dependency.
219
219
 
220
- def match?(obj, version=nil, allow_prerelease=false)
220
+ def match?(obj, version = nil, allow_prerelease = false)
221
221
  if !version
222
222
  name = obj.name
223
223
  version = obj.version
@@ -7,14 +7,12 @@ require_relative "installer"
7
7
  require_relative "spec_fetcher"
8
8
  require_relative "user_interaction"
9
9
  require_relative "available_set"
10
- require_relative "deprecate"
11
10
 
12
11
  ##
13
12
  # Installs a gem along with all its dependencies from local and remote gems.
14
13
 
15
14
  class Gem::DependencyInstaller
16
15
  include Gem::UserInteraction
17
- extend Gem::Deprecate
18
16
 
19
17
  DEFAULT_OPTIONS = { # :nodoc:
20
18
  env_shebang: false,
@@ -28,7 +26,6 @@ class Gem::DependencyInstaller
28
26
  wrappers: true,
29
27
  build_args: nil,
30
28
  build_docs_in_background: false,
31
- install_as_default: false,
32
29
  }.freeze
33
30
 
34
31
  ##
@@ -87,7 +84,6 @@ class Gem::DependencyInstaller
87
84
  @wrappers = options[:wrappers]
88
85
  @build_args = options[:build_args]
89
86
  @build_docs_in_background = options[:build_docs_in_background]
90
- @install_as_default = options[:install_as_default]
91
87
  @dir_mode = options[:dir_mode]
92
88
  @data_mode = options[:data_mode]
93
89
  @prog_mode = options[:prog_mode]
@@ -121,78 +117,6 @@ class Gem::DependencyInstaller
121
117
  @domain == :both || @domain == :remote
122
118
  end
123
119
 
124
- ##
125
- # Returns a list of pairs of gemspecs and source_uris that match
126
- # Gem::Dependency +dep+ from both local (Dir.pwd) and remote (Gem.sources)
127
- # sources. Gems are sorted with newer gems preferred over older gems, and
128
- # local gems preferred over remote gems.
129
-
130
- def find_gems_with_sources(dep, best_only=false) # :nodoc:
131
- set = Gem::AvailableSet.new
132
-
133
- if consider_local?
134
- sl = Gem::Source::Local.new
135
-
136
- if spec = sl.find_gem(dep.name)
137
- if dep.matches_spec? spec
138
- set.add spec, sl
139
- end
140
- end
141
- end
142
-
143
- if consider_remote?
144
- begin
145
- # This is pulled from #spec_for_dependency to allow
146
- # us to filter tuples before fetching specs.
147
- tuples, errors = Gem::SpecFetcher.fetcher.search_for_dependency dep
148
-
149
- if best_only && !tuples.empty?
150
- tuples.sort! do |a,b|
151
- if b[0].version == a[0].version
152
- if b[0].platform != Gem::Platform::RUBY
153
- 1
154
- else
155
- -1
156
- end
157
- else
158
- b[0].version <=> a[0].version
159
- end
160
- end
161
- tuples = [tuples.first]
162
- end
163
-
164
- specs = []
165
- tuples.each do |tup, source|
166
- spec = source.fetch_spec(tup)
167
- rescue Gem::RemoteFetcher::FetchError => e
168
- errors << Gem::SourceFetchProblem.new(source, e)
169
- else
170
- specs << [spec, source]
171
- end
172
-
173
- if @errors
174
- @errors += errors
175
- else
176
- @errors = errors
177
- end
178
-
179
- set << specs
180
- rescue Gem::RemoteFetcher::FetchError => e
181
- # FIX if there is a problem talking to the network, we either need to always tell
182
- # the user (no really_verbose) or fail hard, not silently tell them that we just
183
- # couldn't find their requested gem.
184
- verbose do
185
- "Error fetching remote data:\t\t#{e.message}\n" \
186
- "Falling back to local-only install"
187
- end
188
- @domain = :local
189
- end
190
- end
191
-
192
- set
193
- end
194
- rubygems_deprecate :find_gems_with_sources
195
-
196
120
  def in_background(what) # :nodoc:
197
121
  fork_happened = false
198
122
  if @build_docs_in_background && Process.respond_to?(:fork)
@@ -240,7 +164,6 @@ class Gem::DependencyInstaller
240
164
  user_install: @user_install,
241
165
  wrappers: @wrappers,
242
166
  build_root: @build_root,
243
- install_as_default: @install_as_default,
244
167
  dir_mode: @dir_mode,
245
168
  data_mode: @data_mode,
246
169
  prog_mode: @prog_mode,
@@ -7,7 +7,6 @@
7
7
  #++
8
8
 
9
9
  require_relative "vendored_tsort"
10
- require_relative "deprecate"
11
10
 
12
11
  ##
13
12
  # Gem::DependencyList is used for installing and uninstalling gems in the
@@ -140,7 +139,7 @@ class Gem::DependencyList
140
139
  # If removing the gemspec creates breaks a currently ok dependency, then it
141
140
  # is NOT ok to remove the gemspec.
142
141
 
143
- def ok_to_remove?(full_name, check_dev=true)
142
+ def ok_to_remove?(full_name, check_dev = true)
144
143
  gem_to_remove = find_name full_name
145
144
 
146
145
  # If the state is inconsistent, at least don't crash
@@ -1,75 +1,75 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ##
4
- # Provides 3 methods for declaring when something is going away.
5
- #
6
- # +deprecate(name, repl, year, month)+:
7
- # Indicate something may be removed on/after a certain date.
8
- #
9
- # +rubygems_deprecate(name, replacement=:none)+:
10
- # Indicate something will be removed in the next major RubyGems version,
11
- # and (optionally) a replacement for it.
12
- #
13
- # +rubygems_deprecate_command+:
14
- # Indicate a RubyGems command (in +lib/rubygems/commands/*.rb+) will be
15
- # removed in the next RubyGems version.
16
- #
17
- # Also provides +skip_during+ for temporarily turning off deprecation warnings.
18
- # This is intended to be used in the test suite, so deprecation warnings
19
- # don't cause test failures if you need to make sure stderr is otherwise empty.
20
- #
21
- #
22
- # Example usage of +deprecate+ and +rubygems_deprecate+:
23
- #
24
- # class Legacy
25
- # def self.some_class_method
26
- # # ...
27
- # end
28
- #
29
- # def some_instance_method
30
- # # ...
31
- # end
32
- #
33
- # def some_old_method
34
- # # ...
35
- # end
36
- #
37
- # extend Gem::Deprecate
38
- # deprecate :some_instance_method, "X.z", 2011, 4
39
- # rubygems_deprecate :some_old_method, "Modern#some_new_method"
40
- #
41
- # class << self
42
- # extend Gem::Deprecate
43
- # deprecate :some_class_method, :none, 2011, 4
44
- # end
45
- # end
46
- #
47
- #
48
- # Example usage of +rubygems_deprecate_command+:
49
- #
50
- # class Gem::Commands::QueryCommand < Gem::Command
51
- # extend Gem::Deprecate
52
- # rubygems_deprecate_command
53
- #
54
- # # ...
55
- # end
56
- #
57
- #
58
- # Example usage of +skip_during+:
59
- #
60
- # class TestSomething < Gem::Testcase
61
- # def test_some_thing_with_deprecations
62
- # Gem::Deprecate.skip_during do
63
- # actual_stdout, actual_stderr = capture_output do
64
- # Gem.something_deprecated
65
- # end
66
- # assert_empty actual_stdout
67
- # assert_equal(expected, actual_stderr)
68
- # end
69
- # end
70
- # end
71
-
72
3
  module Gem
4
+ ##
5
+ # Provides 3 methods for declaring when something is going away.
6
+ #
7
+ # <tt>deprecate(name, repl, year, month)</tt>:
8
+ # Indicate something may be removed on/after a certain date.
9
+ #
10
+ # <tt>rubygems_deprecate(name, replacement=:none)</tt>:
11
+ # Indicate something will be removed in the next major RubyGems version,
12
+ # and (optionally) a replacement for it.
13
+ #
14
+ # +rubygems_deprecate_command+:
15
+ # Indicate a RubyGems command (in +lib/rubygems/commands/*.rb+) will be
16
+ # removed in the next RubyGems version.
17
+ #
18
+ # Also provides +skip_during+ for temporarily turning off deprecation warnings.
19
+ # This is intended to be used in the test suite, so deprecation warnings
20
+ # don't cause test failures if you need to make sure stderr is otherwise empty.
21
+ #
22
+ #
23
+ # Example usage of +deprecate+ and +rubygems_deprecate+:
24
+ #
25
+ # class Legacy
26
+ # def self.some_class_method
27
+ # # ...
28
+ # end
29
+ #
30
+ # def some_instance_method
31
+ # # ...
32
+ # end
33
+ #
34
+ # def some_old_method
35
+ # # ...
36
+ # end
37
+ #
38
+ # extend Gem::Deprecate
39
+ # deprecate :some_instance_method, "X.z", 2011, 4
40
+ # rubygems_deprecate :some_old_method, "Modern#some_new_method"
41
+ #
42
+ # class << self
43
+ # extend Gem::Deprecate
44
+ # deprecate :some_class_method, :none, 2011, 4
45
+ # end
46
+ # end
47
+ #
48
+ #
49
+ # Example usage of +rubygems_deprecate_command+:
50
+ #
51
+ # class Gem::Commands::QueryCommand < Gem::Command
52
+ # extend Gem::Deprecate
53
+ # rubygems_deprecate_command
54
+ #
55
+ # # ...
56
+ # end
57
+ #
58
+ #
59
+ # Example usage of +skip_during+:
60
+ #
61
+ # class TestSomething < Gem::Testcase
62
+ # def test_some_thing_with_deprecations
63
+ # Gem::Deprecate.skip_during do
64
+ # actual_stdout, actual_stderr = capture_output do
65
+ # Gem.something_deprecated
66
+ # end
67
+ # assert_empty actual_stdout
68
+ # assert_equal(expected, actual_stderr)
69
+ # end
70
+ # end
71
+ # end
72
+
73
73
  module Deprecate
74
74
  def self.skip # :nodoc:
75
75
  @skip ||= false
@@ -126,17 +126,18 @@ module Gem
126
126
  # telling the user of +repl+ (unless +repl+ is :none) and the
127
127
  # Rubygems version that it is planned to go away.
128
128
 
129
- def rubygems_deprecate(name, replacement=:none)
129
+ def rubygems_deprecate(name, replacement = :none, version = nil)
130
130
  class_eval do
131
131
  old = "_deprecated_#{name}"
132
132
  alias_method old, name
133
133
  define_method name do |*args, &block|
134
134
  klass = is_a? Module
135
135
  target = klass ? "#{self}." : "#{self.class}#"
136
+ version ||= Gem::Deprecate.next_rubygems_major_version
136
137
  msg = [
137
138
  "NOTE: #{target}#{name} is deprecated",
138
139
  replacement == :none ? " with no replacement" : "; use #{replacement} instead",
139
- ". It will be removed in Rubygems #{Gem::Deprecate.next_rubygems_major_version}",
140
+ ". It will be removed in Rubygems #{version}",
140
141
  "\n#{target}#{name} called from #{Gem.location_of_caller.join(":")}",
141
142
  ]
142
143
  warn "#{msg.join}." unless Gem::Deprecate.skip
@@ -147,13 +148,14 @@ module Gem
147
148
  end
148
149
 
149
150
  # Deprecation method to deprecate Rubygems commands
150
- def rubygems_deprecate_command(version = Gem::Deprecate.next_rubygems_major_version)
151
+ def rubygems_deprecate_command(version = nil)
151
152
  class_eval do
152
153
  define_method "deprecated?" do
153
154
  true
154
155
  end
155
156
 
156
157
  define_method "deprecation_warning" do
158
+ version ||= Gem::Deprecate.next_rubygems_major_version
157
159
  msg = [
158
160
  "#{command} command is deprecated",
159
161
  ". It will be removed in Rubygems #{version}.\n",
@@ -113,7 +113,7 @@ class Gem::Doctor
113
113
  next if installed_specs.include? basename
114
114
  next if /^rubygems-\d/.match?(basename)
115
115
  next if sub_directory == "specifications" && basename == "default"
116
- next if sub_directory == "plugins" && Gem.plugin_suffix_regexp =~ (basename)
116
+ next if sub_directory == "plugins" && Gem.plugin_suffix_regexp =~ basename
117
117
 
118
118
  type = File.directory?(child) ? "directory" : "file"
119
119
 
@@ -26,7 +26,7 @@ module Gem
26
26
  # system. Instead of rescuing from this class, make sure to rescue from the
27
27
  # superclass Gem::LoadError to catch all types of load errors.
28
28
  class MissingSpecError < Gem::LoadError
29
- def initialize(name, requirement, extra_message=nil)
29
+ def initialize(name, requirement, extra_message = nil)
30
30
  @name = name
31
31
  @requirement = requirement
32
32
  @extra_message = extra_message
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "deprecate"
4
3
  require_relative "unknown_command_spell_checker"
5
4
 
6
5
  ##
@@ -101,7 +100,7 @@ class Gem::SpecificGemNotFoundException < Gem::GemNotFoundException
101
100
  # and +version+. Any +errors+ encountered when attempting to find the gem
102
101
  # are also stored.
103
102
 
104
- def initialize(name, version, errors=nil)
103
+ def initialize(name, version, errors = nil)
105
104
  super "Could not find a valid gem '#{name}' (#{version}) locally or in a repository"
106
105
 
107
106
  @name = name
@@ -252,7 +251,7 @@ class Gem::UnsatisfiableDependencyError < Gem::DependencyError
252
251
  # Creates a new UnsatisfiableDependencyError for the unsatisfiable
253
252
  # Gem::Resolver::DependencyRequest +dep+
254
253
 
255
- def initialize(dep, platform_mismatch=nil)
254
+ def initialize(dep, platform_mismatch = nil)
256
255
  if platform_mismatch && !platform_mismatch.empty?
257
256
  plats = platform_mismatch.map {|x| x.platform.to_s }.sort.uniq
258
257
  super "Unable to resolve dependency: No match for '#{dep}' on this platform. Found: #{plats.join(", ")}"
@@ -11,6 +11,9 @@ require_relative "../user_interaction"
11
11
  class Gem::Ext::Builder
12
12
  include Gem::UserInteraction
13
13
 
14
+ class NoMakefileError < Gem::InstallError
15
+ end
16
+
14
17
  attr_accessor :build_args # :nodoc:
15
18
 
16
19
  def self.class_name
@@ -21,7 +24,8 @@ class Gem::Ext::Builder
21
24
  def self.make(dest_path, results, make_dir = Dir.pwd, sitedir = nil, targets = ["clean", "", "install"],
22
25
  target_rbconfig: Gem.target_rbconfig)
23
26
  unless File.exist? File.join(make_dir, "Makefile")
24
- raise Gem::InstallError, "Makefile not found"
27
+ # No makefile exists, nothing to do.
28
+ raise NoMakefileError, "No Makefile found in #{make_dir}"
25
29
  end
26
30
 
27
31
  # try to find make program from Ruby configure arguments first
@@ -165,7 +169,7 @@ class Gem::Ext::Builder
165
169
  @ran_rake = true
166
170
  Gem::Ext::RakeBuilder
167
171
  when /CMakeLists.txt/ then
168
- Gem::Ext::CmakeBuilder
172
+ Gem::Ext::CmakeBuilder.new
169
173
  when /Cargo.toml/ then
170
174
  Gem::Ext::CargoBuilder.new
171
175
  else
@@ -15,7 +15,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
15
15
  end
16
16
 
17
17
  def build(extension, dest_path, results, args = [], lib_dir = nil, cargo_dir = Dir.pwd,
18
- target_rbconfig=Gem.target_rbconfig)
18
+ target_rbconfig = Gem.target_rbconfig)
19
19
  require "tempfile"
20
20
  require "fileutils"
21
21
 
@@ -159,7 +159,7 @@ class Gem::Ext::CargoBuilder < Gem::Ext::Builder
159
159
  def linker_args
160
160
  cc_flag = self.class.shellsplit(makefile_config("CC"))
161
161
  # Avoid to ccache like tool from Rust build
162
- # see https://github.com/rubygems/rubygems/pull/8521#issuecomment-2689854359
162
+ # see https://github.com/ruby/rubygems/pull/8521#issuecomment-2689854359
163
163
  # ex. CC="ccache gcc" or CC="sccache clang --any --args"
164
164
  cc_flag.shift if cc_flag.size >= 2 && !cc_flag[1].start_with?("-")
165
165
  linker = cc_flag.shift