rubygems-update 3.2.30 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +163 -4
- data/CONTRIBUTING.md +40 -10
- data/Manifest.txt +28 -5
- data/POLICIES.md +22 -8
- data/README.md +9 -7
- data/UPGRADING.md +5 -81
- data/bin/gem +1 -6
- data/bundler/CHANGELOG.md +86 -0
- data/bundler/exe/bundle +7 -8
- data/bundler/lib/bundler/build_metadata.rb +2 -2
- data/bundler/lib/bundler/cli/doctor.rb +3 -2
- data/bundler/lib/bundler/cli/gem.rb +70 -8
- data/bundler/lib/bundler/cli/info.rb +6 -1
- data/bundler/lib/bundler/cli/install.rb +2 -0
- data/bundler/lib/bundler/cli/update.rb +2 -2
- data/bundler/lib/bundler/cli.rb +9 -1
- data/bundler/lib/bundler/compact_index_client/updater.rb +0 -5
- data/bundler/lib/bundler/definition.rb +66 -120
- data/bundler/lib/bundler/dependency.rb +5 -7
- data/bundler/lib/bundler/dsl.rb +18 -30
- data/bundler/lib/bundler/endpoint_specification.rb +0 -8
- data/bundler/lib/bundler/environment_preserver.rb +4 -1
- data/bundler/lib/bundler/fetcher/compact_index.rb +9 -4
- data/bundler/lib/bundler/fetcher.rb +2 -5
- data/bundler/lib/bundler/gem_helper.rb +2 -2
- data/bundler/lib/bundler/injector.rb +10 -1
- data/bundler/lib/bundler/installer/gem_installer.rb +1 -6
- data/bundler/lib/bundler/installer.rb +1 -4
- data/bundler/lib/bundler/lazy_specification.rb +17 -1
- data/bundler/lib/bundler/lockfile_parser.rb +10 -12
- data/bundler/lib/bundler/man/bundle-add.1 +10 -2
- data/bundler/lib/bundler/man/bundle-add.1.ronn +7 -1
- data/bundler/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/bundler/lib/bundler/man/bundle-cache.1 +1 -1
- data/bundler/lib/bundler/man/bundle-check.1 +1 -1
- data/bundler/lib/bundler/man/bundle-clean.1 +1 -1
- data/bundler/lib/bundler/man/bundle-config.1 +5 -5
- data/bundler/lib/bundler/man/bundle-config.1.ronn +5 -5
- data/bundler/lib/bundler/man/bundle-doctor.1 +1 -1
- data/bundler/lib/bundler/man/bundle-exec.1 +1 -1
- data/bundler/lib/bundler/man/bundle-gem.1 +14 -1
- data/bundler/lib/bundler/man/bundle-gem.1.ronn +16 -0
- data/bundler/lib/bundler/man/bundle-info.1 +1 -1
- data/bundler/lib/bundler/man/bundle-init.1 +1 -1
- data/bundler/lib/bundler/man/bundle-inject.1 +1 -1
- data/bundler/lib/bundler/man/bundle-install.1 +2 -2
- data/bundler/lib/bundler/man/bundle-install.1.ronn +2 -2
- data/bundler/lib/bundler/man/bundle-list.1 +1 -1
- data/bundler/lib/bundler/man/bundle-lock.1 +1 -1
- data/bundler/lib/bundler/man/bundle-open.1 +1 -1
- data/bundler/lib/bundler/man/bundle-outdated.1 +1 -1
- data/bundler/lib/bundler/man/bundle-platform.1 +1 -1
- data/bundler/lib/bundler/man/bundle-pristine.1 +1 -1
- data/bundler/lib/bundler/man/bundle-remove.1 +1 -1
- data/bundler/lib/bundler/man/bundle-show.1 +1 -1
- data/bundler/lib/bundler/man/bundle-update.1 +2 -2
- data/bundler/lib/bundler/man/bundle-update.1.ronn +2 -1
- data/bundler/lib/bundler/man/bundle-viz.1 +1 -1
- data/bundler/lib/bundler/man/bundle.1 +1 -1
- data/bundler/lib/bundler/man/gemfile.5 +28 -2
- data/bundler/lib/bundler/man/gemfile.5.ronn +9 -1
- data/bundler/lib/bundler/plugin/api/source.rb +1 -0
- data/bundler/lib/bundler/plugin/installer.rb +1 -1
- data/bundler/lib/bundler/process_lock.rb +1 -1
- data/bundler/lib/bundler/psyched_yaml.rb +1 -13
- data/bundler/lib/bundler/resolver.rb +34 -31
- data/bundler/lib/bundler/rubygems_ext.rb +2 -0
- data/bundler/lib/bundler/rubygems_integration.rb +11 -48
- data/bundler/lib/bundler/runtime.rb +1 -1
- data/bundler/lib/bundler/self_manager.rb +73 -0
- data/bundler/lib/bundler/shared_helpers.rb +4 -12
- data/bundler/lib/bundler/source/git/git_proxy.rb +7 -4
- data/bundler/lib/bundler/source/metadata.rb +1 -1
- data/bundler/lib/bundler/source/rubygems.rb +17 -13
- data/bundler/lib/bundler/source/rubygems_aggregate.rb +1 -1
- data/bundler/lib/bundler/source.rb +1 -1
- data/bundler/lib/bundler/source_list.rb +7 -29
- data/bundler/lib/bundler/spec_set.rb +1 -1
- data/bundler/lib/bundler/templates/Executable.bundler +1 -1
- data/bundler/lib/bundler/templates/Gemfile +0 -2
- data/bundler/lib/bundler/templates/gems.rb +0 -3
- data/bundler/lib/bundler/templates/newgem/Gemfile.tt +5 -2
- data/bundler/lib/bundler/templates/newgem/Rakefile.tt +15 -2
- data/bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -2
- data/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt +13 -13
- data/bundler/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/bundler/lib/bundler/templates/newgem/standard.yml.tt +2 -0
- data/bundler/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
- data/bundler/lib/bundler/ui/shell.rb +1 -1
- data/bundler/lib/bundler/vendor/.document +1 -0
- data/bundler/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/bundler/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/bundler/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
- data/bundler/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
- data/bundler/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
- data/bundler/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
- data/bundler/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/bundler/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
- data/bundler/lib/bundler/vendor/uri/lib/uri.rb +0 -1
- data/bundler/lib/bundler/vendored_tsort.rb +4 -0
- data/bundler/lib/bundler/version.rb +1 -1
- data/bundler/lib/bundler.rb +9 -3
- data/hide_lib_for_update/note.txt +0 -4
- data/lib/rubygems/command.rb +4 -4
- data/lib/rubygems/command_manager.rb +4 -2
- data/lib/rubygems/commands/cert_command.rb +6 -6
- data/lib/rubygems/commands/fetch_command.rb +1 -1
- data/lib/rubygems/commands/install_command.rb +5 -2
- data/lib/rubygems/commands/pristine_command.rb +8 -2
- data/lib/rubygems/commands/server_command.rb +14 -77
- data/lib/rubygems/commands/setup_command.rb +84 -76
- data/lib/rubygems/commands/uninstall_command.rb +1 -1
- data/lib/rubygems/commands/update_command.rb +10 -5
- data/lib/rubygems/defaults.rb +2 -20
- data/lib/rubygems/dependency_list.rb +2 -2
- data/lib/rubygems/deprecate.rb +53 -6
- data/lib/rubygems/exceptions.rb +27 -1
- data/lib/rubygems/ext/builder.rb +11 -8
- data/lib/rubygems/ext/cmake_builder.rb +1 -1
- data/lib/rubygems/install_update_options.rb +13 -4
- data/lib/rubygems/installer.rb +46 -27
- data/lib/rubygems/local_remote_options.rb +3 -3
- data/lib/rubygems/name_tuple.rb +2 -3
- data/lib/rubygems/optparse/.document +1 -0
- data/lib/rubygems/optparse/COPYING +56 -0
- data/lib/rubygems/optparse/lib/optionparser.rb +2 -0
- data/lib/rubygems/optparse/lib/optparse/ac.rb +54 -0
- data/lib/rubygems/optparse/lib/optparse/date.rb +18 -0
- data/lib/rubygems/optparse/lib/optparse/kwargs.rb +22 -0
- data/lib/rubygems/optparse/lib/optparse/shellwords.rb +7 -0
- data/lib/rubygems/optparse/lib/optparse/time.rb +11 -0
- data/lib/rubygems/optparse/lib/optparse/uri.rb +7 -0
- data/lib/rubygems/optparse/lib/optparse/version.rb +71 -0
- data/lib/rubygems/optparse/lib/optparse.rb +2230 -0
- data/lib/rubygems/optparse.rb +3 -0
- data/lib/rubygems/path_support.rb +1 -6
- data/lib/rubygems/platform.rb +4 -0
- data/lib/rubygems/remote_fetcher.rb +1 -1
- data/lib/rubygems/request_set.rb +2 -2
- data/lib/rubygems/requirement.rb +1 -1
- data/lib/rubygems/resolver/installer_set.rb +1 -1
- data/lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/rubygems/security.rb +4 -3
- data/lib/rubygems/security_option.rb +3 -3
- data/lib/rubygems/source.rb +3 -1
- data/lib/rubygems/spec_fetcher.rb +1 -1
- data/lib/rubygems/specification.rb +46 -46
- data/lib/rubygems/text.rb +21 -20
- data/lib/rubygems/tsort/.document +1 -0
- data/lib/rubygems/tsort/LICENSE.txt +22 -0
- data/lib/rubygems/tsort/lib/tsort.rb +454 -0
- data/lib/rubygems/tsort.rb +3 -0
- data/lib/rubygems/uninstaller.rb +4 -1
- data/lib/rubygems/unknown_command_spell_checker.rb +21 -0
- data/lib/rubygems/util/licenses.rb +2 -0
- data/lib/rubygems/version.rb +2 -0
- data/lib/rubygems/version_option.rb +2 -2
- data/lib/rubygems.rb +13 -10
- data/rubygems-update.gemspec +1 -1
- data/setup.rb +1 -6
- data/test/rubygems/encrypted_private_key.pem +26 -26
- data/test/rubygems/helper.rb +48 -38
- data/test/rubygems/test_config.rb +2 -2
- data/test/rubygems/test_exit.rb +11 -0
- data/test/rubygems/test_gem.rb +46 -41
- data/test/rubygems/test_gem_command.rb +1 -1
- data/test/rubygems/test_gem_command_manager.rb +28 -2
- data/test/rubygems/test_gem_commands_cert_command.rb +8 -8
- data/test/rubygems/test_gem_commands_fetch_command.rb +36 -0
- data/test/rubygems/test_gem_commands_open_command.rb +1 -1
- data/test/rubygems/test_gem_commands_server_command.rb +4 -46
- data/test/rubygems/test_gem_commands_setup_command.rb +67 -19
- data/test/rubygems/test_gem_commands_signin_command.rb +1 -1
- data/test/rubygems/test_gem_commands_uninstall_command.rb +1 -1
- data/test/rubygems/test_gem_commands_update_command.rb +2 -2
- data/test/rubygems/test_gem_commands_yank_command.rb +1 -1
- data/test/rubygems/test_gem_ext_ext_conf_builder.rb +7 -3
- data/test/rubygems/test_gem_install_update_options.rb +2 -2
- data/test/rubygems/test_gem_installer.rb +37 -5
- data/test/rubygems/test_gem_path_support.rb +2 -6
- data/test/rubygems/test_gem_remote_fetcher.rb +15 -0
- data/test/rubygems/test_gem_request.rb +10 -4
- data/test/rubygems/test_gem_requirement.rb +0 -1
- data/test/rubygems/test_gem_resolver.rb +7 -7
- data/test/rubygems/test_gem_security.rb +1 -1
- data/test/rubygems/test_gem_specification.rb +27 -25
- data/test/rubygems/test_gem_text.rb +6 -0
- data/test/rubygems/test_project_sanity.rb +1 -1
- data/test/rubygems/test_require.rb +8 -35
- data/test/rubygems/test_rubygems.rb +23 -0
- metadata +31 -8
- data/bundler/lib/bundler/gemdeps.rb +0 -29
- data/lib/rubygems/server.rb +0 -882
- data/test/rubygems/bogussources.rb +0 -9
- data/test/rubygems/test_gem_server.rb +0 -608
@@ -3,7 +3,6 @@
|
|
3
3
|
# = uri/common.rb
|
4
4
|
#
|
5
5
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
|
-
# Revision:: $Id$
|
7
6
|
# License::
|
8
7
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
9
8
|
#
|
@@ -61,82 +60,6 @@ module Bundler::URI
|
|
61
60
|
module_function :make_components_hash
|
62
61
|
end
|
63
62
|
|
64
|
-
# Module for escaping unsafe characters with codes.
|
65
|
-
module Escape
|
66
|
-
#
|
67
|
-
# == Synopsis
|
68
|
-
#
|
69
|
-
# Bundler::URI.escape(str [, unsafe])
|
70
|
-
#
|
71
|
-
# == Args
|
72
|
-
#
|
73
|
-
# +str+::
|
74
|
-
# String to replaces in.
|
75
|
-
# +unsafe+::
|
76
|
-
# Regexp that matches all symbols that must be replaced with codes.
|
77
|
-
# By default uses <tt>UNSAFE</tt>.
|
78
|
-
# When this argument is a String, it represents a character set.
|
79
|
-
#
|
80
|
-
# == Description
|
81
|
-
#
|
82
|
-
# Escapes the string, replacing all unsafe characters with codes.
|
83
|
-
#
|
84
|
-
# This method is obsolete and should not be used. Instead, use
|
85
|
-
# CGI.escape, Bundler::URI.encode_www_form or Bundler::URI.encode_www_form_component
|
86
|
-
# depending on your specific use case.
|
87
|
-
#
|
88
|
-
# == Usage
|
89
|
-
#
|
90
|
-
# require 'bundler/vendor/uri/lib/uri'
|
91
|
-
#
|
92
|
-
# enc_uri = Bundler::URI.escape("http://example.com/?a=\11\15")
|
93
|
-
# # => "http://example.com/?a=%09%0D"
|
94
|
-
#
|
95
|
-
# Bundler::URI.unescape(enc_uri)
|
96
|
-
# # => "http://example.com/?a=\t\r"
|
97
|
-
#
|
98
|
-
# Bundler::URI.escape("@?@!", "!?")
|
99
|
-
# # => "@%3F@%21"
|
100
|
-
#
|
101
|
-
def escape(*arg)
|
102
|
-
warn "Bundler::URI.escape is obsolete", uplevel: 1
|
103
|
-
DEFAULT_PARSER.escape(*arg)
|
104
|
-
end
|
105
|
-
alias encode escape
|
106
|
-
#
|
107
|
-
# == Synopsis
|
108
|
-
#
|
109
|
-
# Bundler::URI.unescape(str)
|
110
|
-
#
|
111
|
-
# == Args
|
112
|
-
#
|
113
|
-
# +str+::
|
114
|
-
# String to unescape.
|
115
|
-
#
|
116
|
-
# == Description
|
117
|
-
#
|
118
|
-
# This method is obsolete and should not be used. Instead, use
|
119
|
-
# CGI.unescape, Bundler::URI.decode_www_form or Bundler::URI.decode_www_form_component
|
120
|
-
# depending on your specific use case.
|
121
|
-
#
|
122
|
-
# == Usage
|
123
|
-
#
|
124
|
-
# require 'bundler/vendor/uri/lib/uri'
|
125
|
-
#
|
126
|
-
# enc_uri = Bundler::URI.escape("http://example.com/?a=\11\15")
|
127
|
-
# # => "http://example.com/?a=%09%0D"
|
128
|
-
#
|
129
|
-
# Bundler::URI.unescape(enc_uri)
|
130
|
-
# # => "http://example.com/?a=\t\r"
|
131
|
-
#
|
132
|
-
def unescape(*arg)
|
133
|
-
warn "Bundler::URI.unescape is obsolete", uplevel: 1
|
134
|
-
DEFAULT_PARSER.unescape(*arg)
|
135
|
-
end
|
136
|
-
alias decode unescape
|
137
|
-
end # module Escape
|
138
|
-
|
139
|
-
extend Escape
|
140
63
|
include REGEXP
|
141
64
|
|
142
65
|
@@schemes = {}
|
@@ -145,6 +68,20 @@ module Bundler::URI
|
|
145
68
|
@@schemes
|
146
69
|
end
|
147
70
|
|
71
|
+
#
|
72
|
+
# Construct a Bundler::URI instance, using the scheme to detect the appropriate class
|
73
|
+
# from +Bundler::URI.scheme_list+.
|
74
|
+
#
|
75
|
+
def self.for(scheme, *arguments, default: Generic)
|
76
|
+
if scheme
|
77
|
+
uri_class = @@schemes[scheme.upcase] || default
|
78
|
+
else
|
79
|
+
uri_class = default
|
80
|
+
end
|
81
|
+
|
82
|
+
return uri_class.new(scheme, *arguments)
|
83
|
+
end
|
84
|
+
|
148
85
|
#
|
149
86
|
# Base class for all Bundler::URI exceptions.
|
150
87
|
#
|
@@ -315,7 +252,7 @@ module Bundler::URI
|
|
315
252
|
#
|
316
253
|
# Returns a Regexp object which matches to Bundler::URI-like strings.
|
317
254
|
# The Regexp object returned by this method includes arbitrary
|
318
|
-
# number of capture group (parentheses). Never rely on
|
255
|
+
# number of capture group (parentheses). Never rely on its number.
|
319
256
|
#
|
320
257
|
# == Usage
|
321
258
|
#
|
@@ -362,7 +299,7 @@ module Bundler::URI
|
|
362
299
|
# If +enc+ is given, convert +str+ to the encoding before percent encoding.
|
363
300
|
#
|
364
301
|
# This is an implementation of
|
365
|
-
#
|
302
|
+
# https://www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data.
|
366
303
|
#
|
367
304
|
# See Bundler::URI.decode_www_form_component, Bundler::URI.encode_www_form.
|
368
305
|
def self.encode_www_form_component(str, enc=nil)
|
@@ -403,7 +340,7 @@ module Bundler::URI
|
|
403
340
|
# This method doesn't handle files. When you send a file, use
|
404
341
|
# multipart/form-data.
|
405
342
|
#
|
406
|
-
# This refers
|
343
|
+
# This refers https://url.spec.whatwg.org/#concept-urlencoded-serializer
|
407
344
|
#
|
408
345
|
# Bundler::URI.encode_www_form([["q", "ruby"], ["lang", "en"]])
|
409
346
|
# #=> "q=ruby&lang=en"
|
@@ -4,7 +4,6 @@
|
|
4
4
|
#
|
5
5
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
6
|
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
7
|
-
# Revision:: $Id$
|
8
7
|
#
|
9
8
|
# See Bundler::URI for general documentation
|
10
9
|
#
|
@@ -1098,7 +1097,7 @@ module Bundler::URI
|
|
1098
1097
|
# # => "http://my.example.com/main.rbx?page=1"
|
1099
1098
|
#
|
1100
1099
|
def merge(oth)
|
1101
|
-
rel = parser.
|
1100
|
+
rel = parser.__send__(:convert_to_uri, oth)
|
1102
1101
|
|
1103
1102
|
if rel.absolute?
|
1104
1103
|
#raise BadURIError, "both Bundler::URI are absolute" if absolute?
|
@@ -1183,7 +1182,7 @@ module Bundler::URI
|
|
1183
1182
|
|
1184
1183
|
# :stopdoc:
|
1185
1184
|
def route_from0(oth)
|
1186
|
-
oth = parser.
|
1185
|
+
oth = parser.__send__(:convert_to_uri, oth)
|
1187
1186
|
if self.relative?
|
1188
1187
|
raise BadURIError,
|
1189
1188
|
"relative Bundler::URI: #{self}"
|
@@ -1291,7 +1290,7 @@ module Bundler::URI
|
|
1291
1290
|
# #=> #<Bundler::URI::Generic /main.rbx?page=1>
|
1292
1291
|
#
|
1293
1292
|
def route_to(oth)
|
1294
|
-
parser.
|
1293
|
+
parser.__send__(:convert_to_uri, oth).route_from(self)
|
1295
1294
|
end
|
1296
1295
|
|
1297
1296
|
#
|
@@ -1405,7 +1404,7 @@ module Bundler::URI
|
|
1405
1404
|
# Returns an Array of the components defined from the COMPONENT Array.
|
1406
1405
|
def component_ary
|
1407
1406
|
component.collect do |x|
|
1408
|
-
self.
|
1407
|
+
self.__send__(x)
|
1409
1408
|
end
|
1410
1409
|
end
|
1411
1410
|
protected :component_ary
|
@@ -1430,7 +1429,7 @@ module Bundler::URI
|
|
1430
1429
|
def select(*components)
|
1431
1430
|
components.collect do |c|
|
1432
1431
|
if component.include?(c)
|
1433
|
-
self.
|
1432
|
+
self.__send__(c)
|
1434
1433
|
else
|
1435
1434
|
raise ArgumentError,
|
1436
1435
|
"expected of components of #{self.class} (#{self.class.component.join(', ')})"
|
@@ -7,7 +7,6 @@
|
|
7
7
|
# License::
|
8
8
|
# Bundler::URI::LDAP is copyrighted free software by Takaaki Tateishi and Akira Yamada.
|
9
9
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
10
|
-
# Revision:: $Id$
|
11
10
|
#
|
12
11
|
# See Bundler::URI for general documentation
|
13
12
|
#
|
@@ -119,6 +118,7 @@ module Bundler::URI
|
|
119
118
|
|
120
119
|
# Private method to cleanup +dn+ from using the +path+ component attribute.
|
121
120
|
def parse_dn
|
121
|
+
raise InvalidURIError, 'bad LDAP URL' unless @path
|
122
122
|
@dn = @path[1..-1]
|
123
123
|
end
|
124
124
|
private :parse_dn
|
@@ -3,7 +3,6 @@
|
|
3
3
|
# = uri/common.rb
|
4
4
|
#
|
5
5
|
# Author:: Akira Yamada <akira@ruby-lang.org>
|
6
|
-
# Revision:: $Id$
|
7
6
|
# License::
|
8
7
|
# You can redistribute it and/or modify it under the same term as Ruby.
|
9
8
|
#
|
@@ -208,21 +207,9 @@ module Bundler::URI
|
|
208
207
|
# #=> #<Bundler::URI::LDAP ldap://ldap.example.com/dc=example?user=john>
|
209
208
|
#
|
210
209
|
def parse(uri)
|
211
|
-
|
212
|
-
registry, path, opaque, query, fragment = self.split(uri)
|
213
|
-
|
214
|
-
if scheme && Bundler::URI.scheme_list.include?(scheme.upcase)
|
215
|
-
Bundler::URI.scheme_list[scheme.upcase].new(scheme, userinfo, host, port,
|
216
|
-
registry, path, opaque, query,
|
217
|
-
fragment, self)
|
218
|
-
else
|
219
|
-
Generic.new(scheme, userinfo, host, port,
|
220
|
-
registry, path, opaque, query,
|
221
|
-
fragment, self)
|
222
|
-
end
|
210
|
+
Bundler::URI.for(*self.split(uri), self)
|
223
211
|
end
|
224
212
|
|
225
|
-
|
226
213
|
#
|
227
214
|
# == Args
|
228
215
|
#
|
@@ -69,18 +69,7 @@ module Bundler::URI
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def parse(uri) # :nodoc:
|
72
|
-
|
73
|
-
registry, path, opaque, query, fragment = self.split(uri)
|
74
|
-
scheme_list = Bundler::URI.scheme_list
|
75
|
-
if scheme && scheme_list.include?(uc = scheme.upcase)
|
76
|
-
scheme_list[uc].new(scheme, userinfo, host, port,
|
77
|
-
registry, path, opaque, query,
|
78
|
-
fragment, self)
|
79
|
-
else
|
80
|
-
Generic.new(scheme, userinfo, host, port,
|
81
|
-
registry, path, opaque, query,
|
82
|
-
fragment, self)
|
83
|
-
end
|
72
|
+
Bundler::URI.for(*self.split(uri), self)
|
84
73
|
end
|
85
74
|
|
86
75
|
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
# = uri/ws.rb
|
3
|
+
#
|
4
|
+
# Author:: Matt Muller <mamuller@amazon.com>
|
5
|
+
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
6
|
+
#
|
7
|
+
# See Bundler::URI for general documentation
|
8
|
+
#
|
9
|
+
|
10
|
+
require_relative 'generic'
|
11
|
+
|
12
|
+
module Bundler::URI
|
13
|
+
|
14
|
+
#
|
15
|
+
# The syntax of WS URIs is defined in RFC6455 section 3.
|
16
|
+
#
|
17
|
+
# Note that the Ruby Bundler::URI library allows WS URLs containing usernames and
|
18
|
+
# passwords. This is not legal as per the RFC, but used to be
|
19
|
+
# supported in Internet Explorer 5 and 6, before the MS04-004 security
|
20
|
+
# update. See <URL:http://support.microsoft.com/kb/834489>.
|
21
|
+
#
|
22
|
+
class WS < Generic
|
23
|
+
# A Default port of 80 for Bundler::URI::WS.
|
24
|
+
DEFAULT_PORT = 80
|
25
|
+
|
26
|
+
# An Array of the available components for Bundler::URI::WS.
|
27
|
+
COMPONENT = %i[
|
28
|
+
scheme
|
29
|
+
userinfo host port
|
30
|
+
path
|
31
|
+
query
|
32
|
+
].freeze
|
33
|
+
|
34
|
+
#
|
35
|
+
# == Description
|
36
|
+
#
|
37
|
+
# Creates a new Bundler::URI::WS object from components, with syntax checking.
|
38
|
+
#
|
39
|
+
# The components accepted are userinfo, host, port, path, and query.
|
40
|
+
#
|
41
|
+
# The components should be provided either as an Array, or as a Hash
|
42
|
+
# with keys formed by preceding the component names with a colon.
|
43
|
+
#
|
44
|
+
# If an Array is used, the components must be passed in the
|
45
|
+
# order <code>[userinfo, host, port, path, query]</code>.
|
46
|
+
#
|
47
|
+
# Example:
|
48
|
+
#
|
49
|
+
# uri = Bundler::URI::WS.build(host: 'www.example.com', path: '/foo/bar')
|
50
|
+
#
|
51
|
+
# uri = Bundler::URI::WS.build([nil, "www.example.com", nil, "/path", "query"])
|
52
|
+
#
|
53
|
+
# Currently, if passed userinfo components this method generates
|
54
|
+
# invalid WS URIs as per RFC 1738.
|
55
|
+
#
|
56
|
+
def self.build(args)
|
57
|
+
tmp = Util.make_components_hash(self, args)
|
58
|
+
super(tmp)
|
59
|
+
end
|
60
|
+
|
61
|
+
#
|
62
|
+
# == Description
|
63
|
+
#
|
64
|
+
# Returns the full path for a WS Bundler::URI, as required by Net::HTTP::Get.
|
65
|
+
#
|
66
|
+
# If the Bundler::URI contains a query, the full path is Bundler::URI#path + '?' + Bundler::URI#query.
|
67
|
+
# Otherwise, the path is simply Bundler::URI#path.
|
68
|
+
#
|
69
|
+
# Example:
|
70
|
+
#
|
71
|
+
# uri = Bundler::URI::WS.build(path: '/foo/bar', query: 'test=true')
|
72
|
+
# uri.request_uri # => "/foo/bar?test=true"
|
73
|
+
#
|
74
|
+
def request_uri
|
75
|
+
return unless @path
|
76
|
+
|
77
|
+
url = @query ? "#@path?#@query" : @path.dup
|
78
|
+
url.start_with?(?/.freeze) ? url : ?/ + url
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
@@schemes['WS'] = WS
|
83
|
+
|
84
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: false
|
2
|
+
# = uri/wss.rb
|
3
|
+
#
|
4
|
+
# Author:: Matt Muller <mamuller@amazon.com>
|
5
|
+
# License:: You can redistribute it and/or modify it under the same term as Ruby.
|
6
|
+
#
|
7
|
+
# See Bundler::URI for general documentation
|
8
|
+
#
|
9
|
+
|
10
|
+
require_relative 'ws'
|
11
|
+
|
12
|
+
module Bundler::URI
|
13
|
+
|
14
|
+
# The default port for WSS URIs is 443, and the scheme is 'wss:' rather
|
15
|
+
# than 'ws:'. Other than that, WSS URIs are identical to WS URIs;
|
16
|
+
# see Bundler::URI::WS.
|
17
|
+
class WSS < WS
|
18
|
+
# A Default port of 443 for Bundler::URI::WSS
|
19
|
+
DEFAULT_PORT = 443
|
20
|
+
end
|
21
|
+
@@schemes['WSS'] = WSS
|
22
|
+
end
|
data/bundler/lib/bundler.rb
CHANGED
@@ -66,6 +66,7 @@ module Bundler
|
|
66
66
|
autoload :RubyDsl, File.expand_path("bundler/ruby_dsl", __dir__)
|
67
67
|
autoload :RubyVersion, File.expand_path("bundler/ruby_version", __dir__)
|
68
68
|
autoload :Runtime, File.expand_path("bundler/runtime", __dir__)
|
69
|
+
autoload :SelfManager, File.expand_path("bundler/self_manager", __dir__)
|
69
70
|
autoload :Settings, File.expand_path("bundler/settings", __dir__)
|
70
71
|
autoload :SharedHelpers, File.expand_path("bundler/shared_helpers", __dir__)
|
71
72
|
autoload :Source, File.expand_path("bundler/source", __dir__)
|
@@ -643,15 +644,20 @@ EOF
|
|
643
644
|
Bundler.rubygems.clear_paths
|
644
645
|
end
|
645
646
|
|
647
|
+
def self_manager
|
648
|
+
@self_manager ||= begin
|
649
|
+
require_relative "bundler/self_manager"
|
650
|
+
Bundler::SelfManager.new
|
651
|
+
end
|
652
|
+
end
|
653
|
+
|
646
654
|
private
|
647
655
|
|
648
656
|
def eval_yaml_gemspec(path, contents)
|
649
657
|
require_relative "bundler/psyched_yaml"
|
650
658
|
|
651
|
-
# If the YAML is invalid, Syck raises an ArgumentError, and Psych
|
652
|
-
# raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
|
653
659
|
Gem::Specification.from_yaml(contents)
|
654
|
-
rescue
|
660
|
+
rescue ::Psych::SyntaxError, ArgumentError, Gem::EndOfYAMLException, Gem::Exception
|
655
661
|
eval_gemspec(path, contents)
|
656
662
|
end
|
657
663
|
|
data/lib/rubygems/command.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# See LICENSE.txt for permissions.
|
6
6
|
#++
|
7
7
|
|
8
|
-
|
8
|
+
require_relative 'optparse'
|
9
9
|
require_relative 'requirement'
|
10
10
|
require_relative 'user_interaction'
|
11
11
|
|
@@ -19,7 +19,7 @@ require_relative 'user_interaction'
|
|
19
19
|
class Gem::Command
|
20
20
|
include Gem::UserInteraction
|
21
21
|
|
22
|
-
OptionParser.accept Symbol do |value|
|
22
|
+
Gem::OptionParser.accept Symbol do |value|
|
23
23
|
value.to_sym
|
24
24
|
end
|
25
25
|
|
@@ -344,7 +344,7 @@ class Gem::Command
|
|
344
344
|
##
|
345
345
|
# Add a command-line option and handler to the command.
|
346
346
|
#
|
347
|
-
# See OptionParser#make_switch for an explanation of +opts+.
|
347
|
+
# See Gem::OptionParser#make_switch for an explanation of +opts+.
|
348
348
|
#
|
349
349
|
# +handler+ will be called with two values, the value of the argument and
|
350
350
|
# the options hash.
|
@@ -540,7 +540,7 @@ class Gem::Command
|
|
540
540
|
# command.
|
541
541
|
|
542
542
|
def create_option_parser
|
543
|
-
@parser = OptionParser.new
|
543
|
+
@parser = Gem::OptionParser.new
|
544
544
|
|
545
545
|
add_parser_options
|
546
546
|
|
@@ -73,7 +73,9 @@ class Gem::CommandManager
|
|
73
73
|
].freeze
|
74
74
|
|
75
75
|
ALIAS_COMMANDS = {
|
76
|
-
'i'
|
76
|
+
'i' => 'install',
|
77
|
+
'login' => 'signin',
|
78
|
+
'logout' => 'signout',
|
77
79
|
}.freeze
|
78
80
|
|
79
81
|
##
|
@@ -188,7 +190,7 @@ class Gem::CommandManager
|
|
188
190
|
raise Gem::CommandLineError,
|
189
191
|
"Ambiguous command #{cmd_name} matches [#{possibilities.join(', ')}]"
|
190
192
|
elsif possibilities.empty?
|
191
|
-
raise Gem::
|
193
|
+
raise Gem::UnknownCommandError.new(cmd_name)
|
192
194
|
end
|
193
195
|
|
194
196
|
self[possibilities.first]
|
@@ -51,7 +51,7 @@ class Gem::Commands::CertCommand < Gem::Command
|
|
51
51
|
add_option('-s', '--sign CERT',
|
52
52
|
'Signs CERT with the key from -K',
|
53
53
|
'and the certificate from -C') do |cert_file, options|
|
54
|
-
raise OptionParser::InvalidArgument, "#{cert_file}: does not exist" unless
|
54
|
+
raise Gem::OptionParser::InvalidArgument, "#{cert_file}: does not exist" unless
|
55
55
|
File.file? cert_file
|
56
56
|
|
57
57
|
options[:sign] << cert_file
|
@@ -85,9 +85,9 @@ class Gem::Commands::CertCommand < Gem::Command
|
|
85
85
|
check_openssl
|
86
86
|
OpenSSL::X509::Certificate.new File.read certificate_file
|
87
87
|
rescue Errno::ENOENT
|
88
|
-
raise OptionParser::InvalidArgument, "#{certificate_file}: does not exist"
|
88
|
+
raise Gem::OptionParser::InvalidArgument, "#{certificate_file}: does not exist"
|
89
89
|
rescue OpenSSL::X509::CertificateError
|
90
|
-
raise OptionParser::InvalidArgument,
|
90
|
+
raise Gem::OptionParser::InvalidArgument,
|
91
91
|
"#{certificate_file}: invalid X509 certificate"
|
92
92
|
end
|
93
93
|
|
@@ -95,13 +95,13 @@ class Gem::Commands::CertCommand < Gem::Command
|
|
95
95
|
check_openssl
|
96
96
|
passphrase = ENV['GEM_PRIVATE_KEY_PASSPHRASE']
|
97
97
|
key = OpenSSL::PKey.read File.read(key_file), passphrase
|
98
|
-
raise OptionParser::InvalidArgument,
|
98
|
+
raise Gem::OptionParser::InvalidArgument,
|
99
99
|
"#{key_file}: private key not found" unless key.private?
|
100
100
|
key
|
101
101
|
rescue Errno::ENOENT
|
102
|
-
raise OptionParser::InvalidArgument, "#{key_file}: does not exist"
|
102
|
+
raise Gem::OptionParser::InvalidArgument, "#{key_file}: does not exist"
|
103
103
|
rescue OpenSSL::PKey::PKeyError, ArgumentError
|
104
|
-
raise OptionParser::InvalidArgument, "#{key_file}: invalid RSA, DSA, or EC key"
|
104
|
+
raise Gem::OptionParser::InvalidArgument, "#{key_file}: invalid RSA, DSA, or EC key"
|
105
105
|
end
|
106
106
|
|
107
107
|
def execute
|
@@ -60,7 +60,7 @@ then repackaging it.
|
|
60
60
|
specs_and_sources = filtered unless filtered.empty?
|
61
61
|
end
|
62
62
|
|
63
|
-
spec, source = specs_and_sources.max_by {|s,| s
|
63
|
+
spec, source = specs_and_sources.max_by {|s,| s }
|
64
64
|
|
65
65
|
if spec.nil?
|
66
66
|
show_lookup_failure gem_name, version, errors, options[:domain]
|
@@ -27,6 +27,8 @@ class Gem::Commands::InstallCommand < Gem::Command
|
|
27
27
|
:without_groups => [],
|
28
28
|
})
|
29
29
|
|
30
|
+
defaults.merge!(install_update_options)
|
31
|
+
|
30
32
|
super 'install', 'Install a gem into the local repository', defaults
|
31
33
|
|
32
34
|
add_install_update_options
|
@@ -43,8 +45,9 @@ class Gem::Commands::InstallCommand < Gem::Command
|
|
43
45
|
end
|
44
46
|
|
45
47
|
def defaults_str # :nodoc:
|
46
|
-
"--both --version '#{Gem::Requirement.default}' --
|
47
|
-
"--install-dir #{Gem.dir} --lock"
|
48
|
+
"--both --version '#{Gem::Requirement.default}' --no-force\n" +
|
49
|
+
"--install-dir #{Gem.dir} --lock\n" +
|
50
|
+
install_update_defaults_str
|
48
51
|
end
|
49
52
|
|
50
53
|
def description # :nodoc:
|
@@ -50,6 +50,11 @@ class Gem::Commands::PristineCommand < Gem::Command
|
|
50
50
|
options[:env_shebang] = value
|
51
51
|
end
|
52
52
|
|
53
|
+
add_option('-i', '--install-dir DIR',
|
54
|
+
'Gem repository to get binstubs and plugins installed') do |value, options|
|
55
|
+
options[:install_dir] = File.expand_path(value)
|
56
|
+
end
|
57
|
+
|
53
58
|
add_option('-n', '--bindir DIR',
|
54
59
|
'Directory where executables are',
|
55
60
|
'located') do |value, options|
|
@@ -163,11 +168,12 @@ extensions will be restored.
|
|
163
168
|
end
|
164
169
|
|
165
170
|
bin_dir = options[:bin_dir] if options[:bin_dir]
|
171
|
+
install_dir = options[:install_dir] if options[:install_dir]
|
166
172
|
|
167
173
|
installer_options = {
|
168
174
|
:wrappers => true,
|
169
175
|
:force => true,
|
170
|
-
:install_dir => spec.base_dir,
|
176
|
+
:install_dir => install_dir || spec.base_dir,
|
171
177
|
:env_shebang => env_shebang,
|
172
178
|
:build_args => spec.build_args,
|
173
179
|
:bin_dir => bin_dir,
|
@@ -177,7 +183,7 @@ extensions will be restored.
|
|
177
183
|
installer = Gem::Installer.for_spec(spec, installer_options)
|
178
184
|
installer.generate_bin
|
179
185
|
elsif options[:only_plugins]
|
180
|
-
installer = Gem::Installer.for_spec(spec)
|
186
|
+
installer = Gem::Installer.for_spec(spec, installer_options)
|
181
187
|
installer.generate_plugins
|
182
188
|
else
|
183
189
|
installer = Gem::Installer.at(gem, installer_options)
|