rubygems-update 3.1.0.pre3 → 3.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bundle/config +2 -0
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +8 -0
- data/Gemfile.lock +43 -0
- data/History.txt +97 -2
- data/Manifest.txt +21 -3
- data/README.md +4 -4
- data/Rakefile +11 -10
- data/bin/update_rubygems +1 -1
- data/bundler/CHANGELOG.md +56 -3
- data/bundler/lib/bundler.rb +0 -1
- data/bundler/lib/bundler/build_metadata.rb +2 -0
- data/bundler/lib/bundler/cli.rb +1 -1
- data/bundler/lib/bundler/cli/config.rb +1 -1
- data/bundler/lib/bundler/cli/install.rb +3 -2
- data/bundler/lib/bundler/cli/update.rb +1 -1
- data/bundler/lib/bundler/feature_flag.rb +1 -1
- data/bundler/lib/bundler/fetcher.rb +2 -2
- data/bundler/lib/bundler/fetcher/downloader.rb +1 -1
- data/bundler/lib/bundler/fetcher/index.rb +1 -1
- data/bundler/lib/bundler/friendly_errors.rb +1 -1
- data/bundler/lib/bundler/gem_helper.rb +13 -12
- data/bundler/lib/bundler/inline.rb +36 -31
- data/bundler/lib/bundler/lazy_specification.rb +0 -1
- data/bundler/lib/bundler/mirror.rb +3 -3
- data/bundler/lib/bundler/plugin/api/source.rb +2 -4
- data/bundler/lib/bundler/remote_specification.rb +0 -2
- data/bundler/lib/bundler/rubygems_integration.rb +15 -13
- data/bundler/lib/bundler/settings.rb +7 -4
- data/bundler/lib/bundler/setup.rb +5 -0
- data/bundler/lib/bundler/source/git.rb +5 -5
- data/bundler/lib/bundler/source/git/git_proxy.rb +3 -2
- data/bundler/lib/bundler/source/rubygems.rb +3 -3
- data/bundler/lib/bundler/source/rubygems/remote.rb +1 -1
- data/bundler/lib/bundler/uri_credentials_filter.rb +7 -3
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils.rb +3 -3
- data/bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +26 -48
- data/bundler/lib/bundler/vendor/thor/lib/thor.rb +7 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/actions.rb +10 -6
- data/bundler/lib/bundler/vendor/thor/lib/thor/base.rb +29 -19
- data/bundler/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +1 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/parser/option.rb +13 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/runner.rb +8 -9
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +10 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/shell/html.rb +2 -2
- data/bundler/lib/bundler/vendor/thor/lib/thor/util.rb +17 -1
- data/bundler/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/bundler/lib/bundler/vendored_uri.rb +4 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/man/bundle-add.1 +1 -1
- data/bundler/man/bundle-add.1.txt +1 -1
- data/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/man/bundle-binstubs.1.txt +1 -1
- data/bundler/man/bundle-cache.1 +1 -1
- data/bundler/man/bundle-cache.1.txt +1 -1
- data/bundler/man/bundle-check.1 +1 -1
- data/bundler/man/bundle-check.1.txt +1 -1
- data/bundler/man/bundle-clean.1 +1 -1
- data/bundler/man/bundle-clean.1.txt +1 -1
- data/bundler/man/bundle-config.1 +1 -1
- data/bundler/man/bundle-config.1.txt +1 -1
- data/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/man/bundle-doctor.1.txt +1 -1
- data/bundler/man/bundle-exec.1 +1 -1
- data/bundler/man/bundle-exec.1.txt +1 -1
- data/bundler/man/bundle-gem.1 +1 -1
- data/bundler/man/bundle-gem.1.txt +1 -1
- data/bundler/man/bundle-info.1 +1 -1
- data/bundler/man/bundle-info.1.txt +1 -1
- data/bundler/man/bundle-init.1 +1 -1
- data/bundler/man/bundle-init.1.txt +1 -1
- data/bundler/man/bundle-inject.1 +1 -1
- data/bundler/man/bundle-inject.1.txt +1 -1
- data/bundler/man/bundle-install.1 +1 -1
- data/bundler/man/bundle-install.1.txt +1 -1
- data/bundler/man/bundle-list.1 +1 -1
- data/bundler/man/bundle-list.1.txt +1 -1
- data/bundler/man/bundle-lock.1 +1 -1
- data/bundler/man/bundle-lock.1.txt +1 -1
- data/bundler/man/bundle-open.1 +1 -1
- data/bundler/man/bundle-open.1.txt +1 -1
- data/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/man/bundle-outdated.1.txt +1 -1
- data/bundler/man/bundle-platform.1 +1 -1
- data/bundler/man/bundle-platform.1.txt +1 -1
- data/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/man/bundle-pristine.1.txt +1 -1
- data/bundler/man/bundle-remove.1 +1 -1
- data/bundler/man/bundle-remove.1.txt +1 -1
- data/bundler/man/bundle-show.1 +1 -1
- data/bundler/man/bundle-show.1.txt +1 -1
- data/bundler/man/bundle-update.1 +1 -1
- data/bundler/man/bundle-update.1.txt +1 -1
- data/bundler/man/bundle-viz.1 +1 -1
- data/bundler/man/bundle-viz.1.txt +1 -1
- data/bundler/man/bundle.1 +1 -1
- data/bundler/man/bundle.1.txt +1 -1
- data/bundler/man/gemfile.5 +1 -1
- data/bundler/man/gemfile.5.txt +1 -1
- data/lib/rubygems.rb +64 -47
- data/lib/rubygems/basic_specification.rb +1 -1
- data/lib/rubygems/command.rb +29 -7
- data/lib/rubygems/commands/generate_index_command.rb +3 -0
- data/lib/rubygems/commands/help_command.rb +1 -1
- data/lib/rubygems/commands/setup_command.rb +30 -15
- data/lib/rubygems/commands/sources_command.rb +17 -3
- data/lib/rubygems/commands/uninstall_command.rb +1 -1
- data/lib/rubygems/core_ext/kernel_require.rb +1 -1
- data/lib/rubygems/core_ext/kernel_warn.rb +8 -4
- data/lib/rubygems/ext/builder.rb +4 -2
- data/lib/rubygems/remote_fetcher.rb +20 -31
- data/lib/rubygems/request.rb +2 -0
- data/lib/rubygems/request_set/gem_dependency_api.rb +1 -1
- data/lib/rubygems/resolver/api_set.rb +1 -1
- data/lib/rubygems/resolver/api_specification.rb +1 -1
- data/lib/rubygems/server.rb +1 -1
- data/lib/rubygems/source.rb +7 -1
- data/lib/rubygems/source_list.rb +2 -0
- data/lib/rubygems/specification.rb +12 -8
- data/lib/rubygems/specification_policy.rb +53 -30
- data/lib/rubygems/test_case.rb +60 -0
- data/lib/rubygems/uri_formatter.rb +0 -1
- data/lib/rubygems/uri_parser.rb +36 -0
- data/lib/rubygems/uri_parsing.rb +23 -0
- data/lib/rubygems/util.rb +7 -1
- data/lib/rubygems/version.rb +1 -1
- data/rubygems-update.gemspec +1 -8
- data/test/rubygems/specifications/rubyforge-0.0.1.gemspec +14 -0
- data/test/rubygems/test_gem.rb +90 -46
- data/test/rubygems/test_gem_command.rb +38 -9
- data/test/rubygems/test_gem_commands_build_command.rb +18 -1
- data/test/rubygems/test_gem_commands_generate_index_command.rb +37 -1
- data/test/rubygems/test_gem_commands_help_command.rb +1 -6
- data/test/rubygems/test_gem_commands_server_command.rb +6 -2
- data/test/rubygems/test_gem_commands_setup_command.rb +56 -10
- data/test/rubygems/test_gem_commands_sources_command.rb +113 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -0
- data/test/rubygems/test_gem_gem_runner.rb +3 -1
- data/test/rubygems/test_gem_indexer.rb +1 -1
- data/test/rubygems/test_gem_installer.rb +10 -23
- data/test/rubygems/test_gem_package.rb +3 -8
- data/test/rubygems/test_gem_package_tar_writer.rb +5 -0
- data/test/rubygems/test_gem_request_set.rb +52 -0
- data/test/rubygems/test_gem_source.rb +14 -0
- data/test/rubygems/test_gem_specification.rb +74 -54
- data/test/rubygems/test_gem_stub_specification.rb +0 -1
- data/test/rubygems/test_project_sanity.rb +0 -43
- data/test/rubygems/test_remote_fetch_error.rb +1 -1
- data/test/rubygems/test_require.rb +41 -42
- data/util/bisect +0 -21
- data/util/ci.sh +1 -1
- data/util/update_changelog.rb +7 -10
- metadata +27 -93
- data/bundler/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/bundler/lib/bundler/vendor/fileutils/lib/fileutils/version.rb +0 -5
- data/bundler/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-PRISTINE" "1" "
|
4
|
+
.TH "BUNDLE\-PRISTINE" "1" "January 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-pristine\fR \- Restores installed gems to their pristine condition
|
data/bundler/man/bundle-remove.1
CHANGED
data/bundler/man/bundle-show.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-SHOW" "1" "
|
4
|
+
.TH "BUNDLE\-SHOW" "1" "January 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-show\fR \- Shows all the gems in your bundle, or the path to a gem
|
data/bundler/man/bundle-update.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-UPDATE" "1" "
|
4
|
+
.TH "BUNDLE\-UPDATE" "1" "January 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
data/bundler/man/bundle-viz.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "BUNDLE\-VIZ" "1" "
|
4
|
+
.TH "BUNDLE\-VIZ" "1" "January 2020" "" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBbundle\-viz\fR \- Generates a visual dependency graph for your Gemfile
|
data/bundler/man/bundle.1
CHANGED
data/bundler/man/bundle.1.txt
CHANGED
data/bundler/man/gemfile.5
CHANGED
data/bundler/man/gemfile.5.txt
CHANGED
data/lib/rubygems.rb
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
require 'rbconfig'
|
10
10
|
|
11
11
|
module Gem
|
12
|
-
VERSION = "3.1.
|
12
|
+
VERSION = "3.1.4".freeze
|
13
13
|
end
|
14
14
|
|
15
15
|
# Must be first since it unloads the prelude from 1.9.2
|
@@ -26,19 +26,19 @@ require 'rubygems/errors'
|
|
26
26
|
# For user documentation, see:
|
27
27
|
#
|
28
28
|
# * <tt>gem help</tt> and <tt>gem help [command]</tt>
|
29
|
-
# * {RubyGems User Guide}[
|
30
|
-
# * {Frequently Asked Questions}[
|
29
|
+
# * {RubyGems User Guide}[https://guides.rubygems.org/]
|
30
|
+
# * {Frequently Asked Questions}[https://guides.rubygems.org/faqs]
|
31
31
|
#
|
32
32
|
# For gem developer documentation see:
|
33
33
|
#
|
34
|
-
# * {Creating Gems}[
|
34
|
+
# * {Creating Gems}[https://guides.rubygems.org/make-your-own-gem]
|
35
35
|
# * Gem::Specification
|
36
36
|
# * Gem::Version for version dependency notes
|
37
37
|
#
|
38
38
|
# Further RubyGems documentation can be found at:
|
39
39
|
#
|
40
|
-
# * {RubyGems Guides}[
|
41
|
-
# * {RubyGems API}[
|
40
|
+
# * {RubyGems Guides}[https://guides.rubygems.org]
|
41
|
+
# * {RubyGems API}[https://www.rubydoc.info/github/rubygems/rubygems] (also available from
|
42
42
|
# <tt>gem server</tt>)
|
43
43
|
#
|
44
44
|
# == RubyGems Plugins
|
@@ -160,24 +160,14 @@ module Gem
|
|
160
160
|
].freeze
|
161
161
|
|
162
162
|
##
|
163
|
-
# Exception classes used in a Gem.read_binary +rescue+ statement
|
164
|
-
# these are defined in Ruby 1.8.7, hence the need for this convoluted setup.
|
163
|
+
# Exception classes used in a Gem.read_binary +rescue+ statement
|
165
164
|
|
166
|
-
READ_BINARY_ERRORS =
|
167
|
-
read_binary_errors = [Errno::EACCES, Errno::EROFS, Errno::ENOSYS]
|
168
|
-
read_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP)
|
169
|
-
read_binary_errors
|
170
|
-
end.freeze
|
165
|
+
READ_BINARY_ERRORS = [Errno::EACCES, Errno::EROFS, Errno::ENOSYS, Errno::ENOTSUP].freeze
|
171
166
|
|
172
167
|
##
|
173
|
-
# Exception classes used in Gem.write_binary +rescue+ statement
|
174
|
-
# these are defined in Ruby 1.8.7.
|
168
|
+
# Exception classes used in Gem.write_binary +rescue+ statement
|
175
169
|
|
176
|
-
WRITE_BINARY_ERRORS =
|
177
|
-
write_binary_errors = [Errno::ENOSYS]
|
178
|
-
write_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP)
|
179
|
-
write_binary_errors
|
180
|
-
end.freeze
|
170
|
+
WRITE_BINARY_ERRORS = [Errno::ENOSYS, Errno::ENOTSUP].freeze
|
181
171
|
|
182
172
|
@@win_platform = nil
|
183
173
|
|
@@ -199,6 +189,8 @@ module Gem
|
|
199
189
|
@pre_reset_hooks ||= []
|
200
190
|
@post_reset_hooks ||= []
|
201
191
|
|
192
|
+
@default_source_date_epoch = nil
|
193
|
+
|
202
194
|
##
|
203
195
|
# Try to activate a gem containing +path+. Returns true if
|
204
196
|
# activation succeeded or wasn't needed because it was already
|
@@ -1246,20 +1238,43 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1246
1238
|
end
|
1247
1239
|
|
1248
1240
|
##
|
1249
|
-
#
|
1250
|
-
#
|
1241
|
+
# If the SOURCE_DATE_EPOCH environment variable is set, returns it's value.
|
1242
|
+
# Otherwise, returns the time that `Gem.source_date_epoch_string` was
|
1243
|
+
# first called in the same format as SOURCE_DATE_EPOCH.
|
1251
1244
|
#
|
1252
|
-
#
|
1245
|
+
# NOTE(@duckinator): The implementation is a tad weird because we want to:
|
1246
|
+
# 1. Make builds reproducible by default, by having this function always
|
1247
|
+
# return the same result during a given run.
|
1248
|
+
# 2. Allow changing ENV['SOURCE_DATE_EPOCH'] at runtime, since multiple
|
1249
|
+
# tests that set this variable will be run in a single process.
|
1250
|
+
#
|
1251
|
+
# If you simplify this function and a lot of tests fail, that is likely
|
1252
|
+
# due to #2 above.
|
1253
1253
|
#
|
1254
1254
|
# Details on SOURCE_DATE_EPOCH:
|
1255
1255
|
# https://reproducible-builds.org/specs/source-date-epoch/
|
1256
1256
|
|
1257
|
-
def self.
|
1258
|
-
if
|
1259
|
-
|
1260
|
-
|
1257
|
+
def self.source_date_epoch_string
|
1258
|
+
# The value used if $SOURCE_DATE_EPOCH is not set.
|
1259
|
+
@default_source_date_epoch ||= Time.now.to_i.to_s
|
1260
|
+
|
1261
|
+
specified_epoch = ENV["SOURCE_DATE_EPOCH"]
|
1262
|
+
|
1263
|
+
# If it's empty or just whitespace, treat it like it wasn't set at all.
|
1264
|
+
specified_epoch = nil if !specified_epoch.nil? && specified_epoch.strip.empty?
|
1265
|
+
|
1266
|
+
epoch = specified_epoch || @default_source_date_epoch
|
1261
1267
|
|
1262
|
-
|
1268
|
+
epoch.strip
|
1269
|
+
end
|
1270
|
+
|
1271
|
+
##
|
1272
|
+
# Returns the value of Gem.source_date_epoch_string, as a Time object.
|
1273
|
+
#
|
1274
|
+
# This is used throughout RubyGems for enabling reproducible builds.
|
1275
|
+
|
1276
|
+
def self.source_date_epoch
|
1277
|
+
Time.at(self.source_date_epoch_string.to_i).utc.freeze
|
1263
1278
|
end
|
1264
1279
|
|
1265
1280
|
# FIX: Almost everywhere else we use the `def self.` way of defining class
|
@@ -1291,10 +1306,11 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1291
1306
|
#
|
1292
1307
|
|
1293
1308
|
def register_default_spec(spec)
|
1294
|
-
|
1309
|
+
extended_require_paths = spec.require_paths.map {|f| f + "/"}
|
1310
|
+
new_format = extended_require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }
|
1295
1311
|
|
1296
1312
|
if new_format
|
1297
|
-
prefix_group =
|
1313
|
+
prefix_group = extended_require_paths.join("|")
|
1298
1314
|
prefix_pattern = /^(#{prefix_group})/
|
1299
1315
|
end
|
1300
1316
|
|
@@ -1376,23 +1392,24 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
|
1376
1392
|
|
1377
1393
|
MARSHAL_SPEC_DIR = "quick/Marshal.#{Gem.marshal_version}/".freeze
|
1378
1394
|
|
1379
|
-
autoload :BundlerVersionFinder, 'rubygems/bundler_version_finder'
|
1380
|
-
autoload :ConfigFile, 'rubygems/config_file'
|
1381
|
-
autoload :Dependency, 'rubygems/dependency'
|
1382
|
-
autoload :DependencyList, 'rubygems/dependency_list'
|
1383
|
-
autoload :Installer, 'rubygems/installer'
|
1384
|
-
autoload :Licenses, 'rubygems/util/licenses'
|
1385
|
-
autoload :
|
1386
|
-
autoload :
|
1387
|
-
autoload :
|
1388
|
-
autoload :
|
1389
|
-
autoload :
|
1390
|
-
autoload :
|
1391
|
-
autoload :
|
1392
|
-
autoload :
|
1393
|
-
autoload :
|
1394
|
-
autoload :
|
1395
|
-
autoload :
|
1395
|
+
autoload :BundlerVersionFinder, File.expand_path('rubygems/bundler_version_finder', __dir__)
|
1396
|
+
autoload :ConfigFile, File.expand_path('rubygems/config_file', __dir__)
|
1397
|
+
autoload :Dependency, File.expand_path('rubygems/dependency', __dir__)
|
1398
|
+
autoload :DependencyList, File.expand_path('rubygems/dependency_list', __dir__)
|
1399
|
+
autoload :Installer, File.expand_path('rubygems/installer', __dir__)
|
1400
|
+
autoload :Licenses, File.expand_path('rubygems/util/licenses', __dir__)
|
1401
|
+
autoload :NameTuple, File.expand_path('rubygems/name_tuple', __dir__)
|
1402
|
+
autoload :PathSupport, File.expand_path('rubygems/path_support', __dir__)
|
1403
|
+
autoload :Platform, File.expand_path('rubygems/platform', __dir__)
|
1404
|
+
autoload :RequestSet, File.expand_path('rubygems/request_set', __dir__)
|
1405
|
+
autoload :Requirement, File.expand_path('rubygems/requirement', __dir__)
|
1406
|
+
autoload :Resolver, File.expand_path('rubygems/resolver', __dir__)
|
1407
|
+
autoload :Source, File.expand_path('rubygems/source', __dir__)
|
1408
|
+
autoload :SourceList, File.expand_path('rubygems/source_list', __dir__)
|
1409
|
+
autoload :SpecFetcher, File.expand_path('rubygems/spec_fetcher', __dir__)
|
1410
|
+
autoload :Specification, File.expand_path('rubygems/specification', __dir__)
|
1411
|
+
autoload :Util, File.expand_path('rubygems/util', __dir__)
|
1412
|
+
autoload :Version, File.expand_path('rubygems/version', __dir__)
|
1396
1413
|
|
1397
1414
|
require "rubygems/specification"
|
1398
1415
|
end
|
@@ -78,7 +78,7 @@ class Gem::BasicSpecification
|
|
78
78
|
elsif missing_extensions?
|
79
79
|
@ignored = true
|
80
80
|
|
81
|
-
if
|
81
|
+
if Gem::Platform::RUBY == platform || Gem::Platform.local === platform
|
82
82
|
warn "Ignoring #{full_name} because its extensions are not built. " +
|
83
83
|
"Try: gem pristine #{name} --version #{version}"
|
84
84
|
end
|
data/lib/rubygems/command.rb
CHANGED
@@ -369,22 +369,44 @@ class Gem::Command
|
|
369
369
|
end
|
370
370
|
end
|
371
371
|
|
372
|
-
|
373
|
-
|
374
|
-
|
372
|
+
##
|
373
|
+
# Mark a command-line option as deprecated, and optionally specify a
|
374
|
+
# deprecation horizon.
|
375
|
+
#
|
376
|
+
# Note that with the current implementation, every version of the option needs
|
377
|
+
# to be explicitly deprecated, so to deprecate an option defined as
|
378
|
+
#
|
379
|
+
# add_option('-t', '--[no-]test', 'Set test mode') do |value, options|
|
380
|
+
# # ... stuff ...
|
381
|
+
# end
|
382
|
+
#
|
383
|
+
# you would need to explicitly add a call to `deprecate_option` for every
|
384
|
+
# version of the option you want to deprecate, like
|
385
|
+
#
|
386
|
+
# deprecate_option('-t')
|
387
|
+
# deprecate_option('--test')
|
388
|
+
# deprecate_option('--no-test')
|
389
|
+
|
390
|
+
def deprecate_option(name, version: nil, extra_msg: nil)
|
391
|
+
@deprecated_options[command].merge!({ name => { "rg_version_to_expire" => version, "extra_msg" => extra_msg } })
|
375
392
|
end
|
376
393
|
|
377
394
|
def check_deprecated_options(options)
|
378
395
|
options.each do |option|
|
379
396
|
if option_is_deprecated?(option)
|
380
|
-
|
397
|
+
deprecation = @deprecated_options[command][option]
|
398
|
+
version_to_expire = deprecation["rg_version_to_expire"]
|
381
399
|
|
382
400
|
deprecate_option_msg = if version_to_expire
|
383
|
-
"The \"#{option}\" option has been deprecated and will be removed in Rubygems #{version_to_expire}
|
401
|
+
"The \"#{option}\" option has been deprecated and will be removed in Rubygems #{version_to_expire}."
|
384
402
|
else
|
385
|
-
"The \"#{option}\" option has been deprecated and will be removed in future versions of Rubygems
|
403
|
+
"The \"#{option}\" option has been deprecated and will be removed in future versions of Rubygems."
|
386
404
|
end
|
387
405
|
|
406
|
+
extra_msg = deprecation["extra_msg"]
|
407
|
+
|
408
|
+
deprecate_option_msg += " #{extra_msg}" if extra_msg
|
409
|
+
|
388
410
|
alert_warning(deprecate_option_msg)
|
389
411
|
end
|
390
412
|
end
|
@@ -624,7 +646,7 @@ basic help message containing pointers to more information.
|
|
624
646
|
http://localhost:8808/
|
625
647
|
with info about installed gems
|
626
648
|
Further information:
|
627
|
-
|
649
|
+
https://guides.rubygems.org
|
628
650
|
HELP
|
629
651
|
|
630
652
|
# :startdoc:
|
@@ -25,6 +25,9 @@ class Gem::Commands::GenerateIndexCommand < Gem::Command
|
|
25
25
|
options[:build_modern] = value
|
26
26
|
end
|
27
27
|
|
28
|
+
deprecate_option('--modern', version: '4.0', extra_msg: 'Modern indexes (specs, latest_specs, and prerelease_specs) are always generated, so this option is not needed.')
|
29
|
+
deprecate_option('--no-modern', version: '4.0', extra_msg: 'The `--no-modern` option is currently ignored. Modern indexes (specs, latest_specs, and prerelease_specs) are always generated.')
|
30
|
+
|
28
31
|
add_option '--update',
|
29
32
|
'Update modern indexes with gems added',
|
30
33
|
'since the last update' do |value, options|
|
@@ -17,6 +17,7 @@ class Gem::Commands::SetupCommand < Gem::Command
|
|
17
17
|
|
18
18
|
super 'setup', 'Install RubyGems',
|
19
19
|
:format_executable => true, :document => %w[ri],
|
20
|
+
:force => true,
|
20
21
|
:site_or_vendor => 'sitelibdir',
|
21
22
|
:destdir => '', :prefix => '', :previous_version => '',
|
22
23
|
:regenerate_binstubs => true
|
@@ -88,6 +89,11 @@ class Gem::Commands::SetupCommand < Gem::Command
|
|
88
89
|
options[:regenerate_binstubs] = value
|
89
90
|
end
|
90
91
|
|
92
|
+
add_option '-f', '--[no-]force',
|
93
|
+
'Forcefully overwrite binstubs' do |value, options|
|
94
|
+
options[:force] = value
|
95
|
+
end
|
96
|
+
|
91
97
|
add_option('-E', '--[no-]env-shebang',
|
92
98
|
'Rewrite executables with a shebang',
|
93
99
|
'of /usr/bin/env') do |value, options|
|
@@ -98,7 +104,7 @@ class Gem::Commands::SetupCommand < Gem::Command
|
|
98
104
|
end
|
99
105
|
|
100
106
|
def check_ruby_version
|
101
|
-
required_version = Gem::Requirement.new '>=
|
107
|
+
required_version = Gem::Requirement.new '>= 2.3.0'
|
102
108
|
|
103
109
|
unless required_version.satisfied_by? Gem.ruby_version
|
104
110
|
alert_error "Expected Ruby version #{required_version}, is #{Gem.ruby_version}"
|
@@ -199,10 +205,10 @@ By default, this RubyGems will install gem as:
|
|
199
205
|
say
|
200
206
|
|
201
207
|
say "RubyGems installed the following executables:"
|
202
|
-
say
|
208
|
+
say bin_file_names.map { |name| "\t#{name}\n" }
|
203
209
|
say
|
204
210
|
|
205
|
-
unless
|
211
|
+
unless bin_file_names.grep(/#{File::SEPARATOR}gem$/)
|
206
212
|
say "If `gem` was installed by a previous RubyGems installation, you may need"
|
207
213
|
say "to remove it by hand."
|
208
214
|
say
|
@@ -235,8 +241,6 @@ By default, this RubyGems will install gem as:
|
|
235
241
|
end
|
236
242
|
|
237
243
|
def install_executables(bin_dir)
|
238
|
-
@bin_file_names = []
|
239
|
-
|
240
244
|
prog_mode = options[:prog_mode] || 0755
|
241
245
|
|
242
246
|
executables = { 'gem' => 'bin' }
|
@@ -249,13 +253,7 @@ By default, this RubyGems will install gem as:
|
|
249
253
|
bin_files -= %w[update_rubygems]
|
250
254
|
|
251
255
|
bin_files.each do |bin_file|
|
252
|
-
|
253
|
-
Gem.default_exec_format % bin_file
|
254
|
-
else
|
255
|
-
bin_file
|
256
|
-
end
|
257
|
-
|
258
|
-
dest_file = File.join bin_dir, bin_file_formatted
|
256
|
+
dest_file = target_bin_path(bin_dir, bin_file)
|
259
257
|
bin_tmp_file = File.join Dir.tmpdir, "#{bin_file}.#{$$}"
|
260
258
|
|
261
259
|
begin
|
@@ -267,7 +265,7 @@ By default, this RubyGems will install gem as:
|
|
267
265
|
end
|
268
266
|
|
269
267
|
install bin_tmp_file, dest_file, :mode => prog_mode
|
270
|
-
|
268
|
+
bin_file_names << dest_file
|
271
269
|
ensure
|
272
270
|
rm bin_tmp_file
|
273
271
|
end
|
@@ -429,13 +427,15 @@ By default, this RubyGems will install gem as:
|
|
429
427
|
Dir.chdir("bundler") do
|
430
428
|
built_gem = Gem::Package.build(bundler_spec)
|
431
429
|
begin
|
432
|
-
installer = Gem::Installer.at(built_gem, env_shebang: options[:env_shebang], format_executable: options[:format_executable], install_as_default: true, bin_dir: bin_dir, wrappers: true)
|
430
|
+
installer = Gem::Installer.at(built_gem, env_shebang: options[:env_shebang], format_executable: options[:format_executable], force: options[:force], install_as_default: true, bin_dir: bin_dir, wrappers: true)
|
433
431
|
installer.install
|
434
432
|
ensure
|
435
433
|
FileUtils.rm_f built_gem
|
436
434
|
end
|
437
435
|
end
|
438
436
|
|
437
|
+
bundler_spec.executables.each {|executable| bin_file_names << target_bin_path(bin_dir, executable) }
|
438
|
+
|
439
439
|
say "Bundler #{bundler_spec.version} installed"
|
440
440
|
end
|
441
441
|
|
@@ -592,7 +592,7 @@ abort "#{deprecation_message}"
|
|
592
592
|
history_string = ""
|
593
593
|
|
594
594
|
until versions.length == 0 or
|
595
|
-
versions.shift
|
595
|
+
versions.shift <= options[:previous_version] do
|
596
596
|
history_string += version_lines.shift + text.shift
|
597
597
|
end
|
598
598
|
|
@@ -626,4 +626,19 @@ abort "#{deprecation_message}"
|
|
626
626
|
command.invoke(*args)
|
627
627
|
end
|
628
628
|
|
629
|
+
private
|
630
|
+
|
631
|
+
def target_bin_path(bin_dir, bin_file)
|
632
|
+
bin_file_formatted = if options[:format_executable]
|
633
|
+
Gem.default_exec_format % bin_file
|
634
|
+
else
|
635
|
+
bin_file
|
636
|
+
end
|
637
|
+
File.join bin_dir, bin_file_formatted
|
638
|
+
end
|
639
|
+
|
640
|
+
def bin_file_names
|
641
|
+
@bin_file_names ||= []
|
642
|
+
end
|
643
|
+
|
629
644
|
end
|