bundler 2.2.26 → 2.3.7
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +206 -1
- data/README.md +1 -1
- data/exe/bundle +7 -8
- data/lib/bundler/.document +1 -0
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/check.rb +1 -1
- data/lib/bundler/cli/config.rb +10 -1
- data/lib/bundler/cli/doctor.rb +12 -3
- data/lib/bundler/cli/gem.rb +98 -9
- data/lib/bundler/cli/info.rb +26 -5
- data/lib/bundler/cli/install.rb +8 -28
- data/lib/bundler/cli/issue.rb +4 -3
- data/lib/bundler/cli/platform.rb +1 -1
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/update.rb +8 -4
- data/lib/bundler/cli.rb +13 -11
- data/lib/bundler/compact_index_client/cache.rb +0 -9
- data/lib/bundler/compact_index_client/updater.rb +0 -5
- data/lib/bundler/compact_index_client.rb +2 -8
- data/lib/bundler/definition.rb +79 -133
- data/lib/bundler/dependency.rb +5 -7
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +18 -30
- data/lib/bundler/endpoint_specification.rb +21 -11
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/environment_preserver.rb +4 -1
- data/lib/bundler/errors.rb +18 -2
- data/lib/bundler/fetcher/compact_index.rb +9 -14
- data/lib/bundler/fetcher/index.rb +0 -26
- data/lib/bundler/fetcher.rb +13 -20
- data/lib/bundler/friendly_errors.rb +5 -30
- data/lib/bundler/gem_helper.rb +7 -18
- data/lib/bundler/injector.rb +10 -1
- data/lib/bundler/installer/gem_installer.rb +1 -6
- data/lib/bundler/installer.rb +1 -5
- data/lib/bundler/lazy_specification.rb +19 -3
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +10 -12
- data/lib/bundler/man/bundle-add.1 +10 -2
- data/lib/bundler/man/bundle-add.1.ronn +7 -1
- data/lib/bundler/man/bundle-binstubs.1 +1 -1
- data/lib/bundler/man/bundle-cache.1 +1 -1
- data/lib/bundler/man/bundle-check.1 +1 -1
- data/lib/bundler/man/bundle-clean.1 +1 -1
- data/lib/bundler/man/bundle-config.1 +5 -5
- data/lib/bundler/man/bundle-config.1.ronn +5 -5
- data/lib/bundler/man/bundle-doctor.1 +1 -1
- data/lib/bundler/man/bundle-exec.1 +1 -1
- data/lib/bundler/man/bundle-gem.1 +14 -1
- data/lib/bundler/man/bundle-gem.1.ronn +16 -0
- data/lib/bundler/man/bundle-info.1 +1 -1
- data/lib/bundler/man/bundle-init.1 +1 -1
- data/lib/bundler/man/bundle-inject.1 +1 -1
- data/lib/bundler/man/bundle-install.1 +2 -2
- data/lib/bundler/man/bundle-install.1.ronn +2 -2
- data/lib/bundler/man/bundle-list.1 +1 -1
- data/lib/bundler/man/bundle-lock.1 +1 -1
- data/lib/bundler/man/bundle-open.1 +1 -1
- data/lib/bundler/man/bundle-outdated.1 +1 -1
- data/lib/bundler/man/bundle-platform.1 +1 -1
- data/lib/bundler/man/bundle-pristine.1 +1 -1
- data/lib/bundler/man/bundle-remove.1 +1 -1
- data/lib/bundler/man/bundle-show.1 +1 -1
- data/lib/bundler/man/bundle-update.1 +2 -2
- data/lib/bundler/man/bundle-update.1.ronn +2 -1
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +28 -2
- data/lib/bundler/man/gemfile.5.ronn +9 -1
- data/lib/bundler/plugin/api/source.rb +1 -0
- data/lib/bundler/plugin/installer.rb +3 -1
- data/lib/bundler/plugin.rb +23 -6
- data/lib/bundler/process_lock.rb +1 -1
- data/lib/bundler/remote_specification.rb +7 -0
- data/lib/bundler/resolver/spec_group.rb +1 -1
- data/lib/bundler/resolver.rb +38 -40
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +19 -10
- data/lib/bundler/rubygems_gem_installer.rb +21 -5
- data/lib/bundler/rubygems_integration.rb +40 -70
- data/lib/bundler/runtime.rb +2 -2
- data/lib/bundler/self_manager.rb +168 -0
- data/lib/bundler/settings.rb +11 -2
- data/lib/bundler/shared_helpers.rb +4 -12
- data/lib/bundler/source/git/git_proxy.rb +7 -4
- data/lib/bundler/source/git.rb +22 -4
- data/lib/bundler/source/metadata.rb +1 -1
- data/lib/bundler/source/rubygems.rb +60 -85
- data/lib/bundler/source/rubygems_aggregate.rb +1 -1
- data/lib/bundler/source.rb +3 -1
- data/lib/bundler/source_list.rb +11 -29
- data/lib/bundler/spec_set.rb +2 -2
- data/lib/bundler/templates/Executable.bundler +1 -1
- data/lib/bundler/templates/Gemfile +0 -2
- data/lib/bundler/templates/gems.rb +0 -3
- data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
- data/lib/bundler/templates/newgem/Rakefile.tt +15 -2
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +4 -3
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +15 -15
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
- data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
- data/lib/bundler/ui/shell.rb +1 -1
- data/lib/bundler/vendor/.document +1 -0
- data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
- data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
- data/lib/bundler/vendor/molinillo/LICENSE +9 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +6 -2
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +9 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +19 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +22 -4
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
- data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
- data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
- data/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
- data/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
- data/lib/bundler/vendor/uri/lib/uri.rb +0 -1
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +2 -2
- data/lib/bundler.rb +23 -22
- metadata +25 -10
- data/lib/bundler/gemdeps.rb +0 -29
- data/lib/bundler/psyched_yaml.rb +0 -22
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions
|
5
|
+
are met:
|
6
|
+
1. Redistributions of source code must retain the above copyright
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
10
|
+
documentation and/or other materials provided with the distribution.
|
11
|
+
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
13
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
14
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
15
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
16
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
17
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
18
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
19
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
20
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
21
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
22
|
+
SUCH DAMAGE.
|
@@ -0,0 +1,9 @@
|
|
1
|
+
This project is licensed under the MIT license.
|
2
|
+
|
3
|
+
Copyright (c) 2014 Samuel E. Giddins segiddins@segiddins.me
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative '../../../../vendored_tsort'
|
4
4
|
|
5
5
|
require_relative 'dependency_graph/log'
|
6
6
|
require_relative 'dependency_graph/vertex'
|
@@ -17,7 +17,7 @@ module Bundler::Molinillo
|
|
17
17
|
vertices.values.each { |v| yield v }
|
18
18
|
end
|
19
19
|
|
20
|
-
include TSort
|
20
|
+
include Bundler::TSort
|
21
21
|
|
22
22
|
# @!visibility private
|
23
23
|
alias tsort_each_node each
|
@@ -0,0 +1,82 @@
|
|
1
|
+
= net-http-persistent
|
2
|
+
|
3
|
+
home :: https://github.com/drbrain/net-http-persistent
|
4
|
+
rdoc :: http://docs.seattlerb.org/net-http-persistent
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
Manages persistent connections using Net::HTTP including a thread pool for
|
9
|
+
connecting to multiple hosts.
|
10
|
+
|
11
|
+
Using persistent HTTP connections can dramatically increase the speed of HTTP.
|
12
|
+
Creating a new HTTP connection for every request involves an extra TCP
|
13
|
+
round-trip and causes TCP congestion avoidance negotiation to start over.
|
14
|
+
|
15
|
+
Net::HTTP supports persistent connections with some API methods but does not
|
16
|
+
make setting up a single persistent connection or managing multiple
|
17
|
+
connections easy. Net::HTTP::Persistent wraps Net::HTTP and allows you to
|
18
|
+
focus on how to make HTTP requests.
|
19
|
+
|
20
|
+
== FEATURES/PROBLEMS:
|
21
|
+
|
22
|
+
* Supports TLS with secure defaults
|
23
|
+
* Thread-safe
|
24
|
+
* Pure ruby
|
25
|
+
|
26
|
+
== SYNOPSIS
|
27
|
+
|
28
|
+
The following example will make two requests to the same server. The
|
29
|
+
connection is kept alive between requests:
|
30
|
+
|
31
|
+
require 'net/http/persistent'
|
32
|
+
|
33
|
+
uri = URI 'http://example.com/awesome/web/service'
|
34
|
+
|
35
|
+
http = Net::HTTP::Persistent.new name: 'my_app_name'
|
36
|
+
|
37
|
+
# perform a GET
|
38
|
+
response = http.request uri
|
39
|
+
|
40
|
+
# create a POST
|
41
|
+
post_uri = uri + 'create'
|
42
|
+
post = Net::HTTP::Post.new post_uri.path
|
43
|
+
post.set_form_data 'some' => 'cool data'
|
44
|
+
|
45
|
+
# perform the POST, the URI is always required
|
46
|
+
response = http.request post_uri, post
|
47
|
+
|
48
|
+
# if you are done making http requests, or won't make requests for several
|
49
|
+
# minutes
|
50
|
+
http.shutdown
|
51
|
+
|
52
|
+
Please see the documentation on Net::HTTP::Persistent for more information,
|
53
|
+
including SSL connection verification, header handling and tunable options.
|
54
|
+
|
55
|
+
== INSTALL:
|
56
|
+
|
57
|
+
gem install net-http-persistent
|
58
|
+
|
59
|
+
== LICENSE:
|
60
|
+
|
61
|
+
(The MIT License)
|
62
|
+
|
63
|
+
Copyright (c) Eric Hodel, Aaron Patterson
|
64
|
+
|
65
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
66
|
+
a copy of this software and associated documentation files (the
|
67
|
+
'Software'), to deal in the Software without restriction, including
|
68
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
69
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
70
|
+
permit persons to whom the Software is furnished to do so, subject to
|
71
|
+
the following conditions:
|
72
|
+
|
73
|
+
The above copyright notice and this permission notice shall be
|
74
|
+
included in all copies or substantial portions of the Software.
|
75
|
+
|
76
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
77
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
78
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
79
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
80
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
81
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
82
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 Yehuda Katz, Eric Hodel, et al.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -210,9 +210,9 @@ class Bundler::Thor
|
|
210
210
|
#
|
211
211
|
# ==== Examples
|
212
212
|
#
|
213
|
-
# inject_into_class "app/controllers/application_controller.rb", ApplicationController, " filter_parameter :password\n"
|
213
|
+
# inject_into_class "app/controllers/application_controller.rb", "ApplicationController", " filter_parameter :password\n"
|
214
214
|
#
|
215
|
-
# inject_into_class "app/controllers/application_controller.rb", ApplicationController do
|
215
|
+
# inject_into_class "app/controllers/application_controller.rb", "ApplicationController" do
|
216
216
|
# " filter_parameter :password\n"
|
217
217
|
# end
|
218
218
|
#
|
@@ -233,9 +233,9 @@ class Bundler::Thor
|
|
233
233
|
#
|
234
234
|
# ==== Examples
|
235
235
|
#
|
236
|
-
# inject_into_module "app/helpers/application_helper.rb", ApplicationHelper, " def help; 'help'; end\n"
|
236
|
+
# inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper", " def help; 'help'; end\n"
|
237
237
|
#
|
238
|
-
# inject_into_module "app/helpers/application_helper.rb", ApplicationHelper do
|
238
|
+
# inject_into_module "app/helpers/application_helper.rb", "ApplicationHelper" do
|
239
239
|
# " def help; 'help'; end\n"
|
240
240
|
# end
|
241
241
|
#
|
@@ -252,7 +252,7 @@ class Bundler::Thor
|
|
252
252
|
# flag<Regexp|String>:: the regexp or string to be replaced
|
253
253
|
# replacement<String>:: the replacement, can be also given as a block
|
254
254
|
# config<Hash>:: give :verbose => false to not log the status, and
|
255
|
-
# :force => true, to force the replacement
|
255
|
+
# :force => true, to force the replacement regardles of runner behavior.
|
256
256
|
#
|
257
257
|
# ==== Example
|
258
258
|
#
|
@@ -331,7 +331,7 @@ class Bundler::Thor
|
|
331
331
|
path = File.expand_path(path, destination_root)
|
332
332
|
|
333
333
|
say_status :remove, relative_to_original_destination_root(path), config.fetch(:verbose, true)
|
334
|
-
if !options[:pretend] && File.exist?(path)
|
334
|
+
if !options[:pretend] && (File.exist?(path) || File.symlink?(path))
|
335
335
|
require "fileutils"
|
336
336
|
::FileUtils.rm_rf(path)
|
337
337
|
end
|
@@ -106,12 +106,11 @@ class Bundler::Thor
|
|
106
106
|
# Adds the content to the file.
|
107
107
|
#
|
108
108
|
def replace!(regexp, string, force)
|
109
|
-
return if pretend?
|
110
109
|
content = File.read(destination)
|
111
110
|
if force || !content.include?(replacement)
|
112
111
|
success = content.gsub!(regexp, string)
|
113
112
|
|
114
|
-
File.open(destination, "wb") { |file| file.write(content) }
|
113
|
+
File.open(destination, "wb") { |file| file.write(content) } unless pretend?
|
115
114
|
success
|
116
115
|
end
|
117
116
|
end
|
@@ -161,6 +161,8 @@ class Bundler::Thor
|
|
161
161
|
# to the block you provide. The path is set back to the previous path when
|
162
162
|
# the method exits.
|
163
163
|
#
|
164
|
+
# Returns the value yielded by the block.
|
165
|
+
#
|
164
166
|
# ==== Parameters
|
165
167
|
# dir<String>:: the directory to move to.
|
166
168
|
# config<Hash>:: give :verbose => true to log and use padding.
|
@@ -179,16 +181,18 @@ class Bundler::Thor
|
|
179
181
|
FileUtils.mkdir_p(destination_root)
|
180
182
|
end
|
181
183
|
|
184
|
+
result = nil
|
182
185
|
if pretend
|
183
186
|
# In pretend mode, just yield down to the block
|
184
|
-
block.arity == 1 ? yield(destination_root) : yield
|
187
|
+
result = block.arity == 1 ? yield(destination_root) : yield
|
185
188
|
else
|
186
189
|
require "fileutils"
|
187
|
-
FileUtils.cd(destination_root) { block.arity == 1 ? yield(destination_root) : yield }
|
190
|
+
FileUtils.cd(destination_root) { result = block.arity == 1 ? yield(destination_root) : yield }
|
188
191
|
end
|
189
192
|
|
190
193
|
@destination_stack.pop
|
191
194
|
shell.padding -= 1 if verbose
|
195
|
+
result
|
192
196
|
end
|
193
197
|
|
194
198
|
# Goes to the root and execute the given block.
|
@@ -102,9 +102,14 @@ class Bundler::Thor
|
|
102
102
|
end
|
103
103
|
|
104
104
|
if Correctable
|
105
|
-
DidYouMean
|
106
|
-
|
107
|
-
|
108
|
-
|
105
|
+
if DidYouMean.respond_to?(:correct_error)
|
106
|
+
DidYouMean.correct_error(Bundler::Thor::UndefinedCommandError, UndefinedCommandError::SpellChecker)
|
107
|
+
DidYouMean.correct_error(Bundler::Thor::UnknownArgumentError, UnknownArgumentError::SpellChecker)
|
108
|
+
else
|
109
|
+
DidYouMean::SPELL_CHECKERS.merge!(
|
110
|
+
'Bundler::Thor::UndefinedCommandError' => UndefinedCommandError::SpellChecker,
|
111
|
+
'Bundler::Thor::UnknownArgumentError' => UnknownArgumentError::SpellChecker
|
112
|
+
)
|
113
|
+
end
|
109
114
|
end
|
110
115
|
end
|
@@ -45,6 +45,7 @@ class Bundler::Thor
|
|
45
45
|
@switches = {}
|
46
46
|
@extra = []
|
47
47
|
@stopped_parsing_after_extra_index = nil
|
48
|
+
@is_treated_as_value = false
|
48
49
|
|
49
50
|
options.each do |option|
|
50
51
|
@switches[option.switch_name] = option
|
@@ -74,8 +75,19 @@ class Bundler::Thor
|
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
78
|
+
def shift
|
79
|
+
@is_treated_as_value = false
|
80
|
+
super
|
81
|
+
end
|
82
|
+
|
83
|
+
def unshift(arg, is_value: false)
|
84
|
+
@is_treated_as_value = is_value
|
85
|
+
super(arg)
|
86
|
+
end
|
87
|
+
|
77
88
|
def parse(args) # rubocop:disable MethodLength
|
78
89
|
@pile = args.dup
|
90
|
+
@is_treated_as_value = false
|
79
91
|
@parsing_options = true
|
80
92
|
|
81
93
|
while peek
|
@@ -88,7 +100,10 @@ class Bundler::Thor
|
|
88
100
|
when SHORT_SQ_RE
|
89
101
|
unshift($1.split("").map { |f| "-#{f}" })
|
90
102
|
next
|
91
|
-
when EQ_RE
|
103
|
+
when EQ_RE
|
104
|
+
unshift($2, is_value: true)
|
105
|
+
switch = $1
|
106
|
+
when SHORT_NUM
|
92
107
|
unshift($2)
|
93
108
|
switch = $1
|
94
109
|
when LONG_RE, SHORT_RE
|
@@ -148,6 +163,7 @@ class Bundler::Thor
|
|
148
163
|
# Two booleans are returned. The first is true if the current value
|
149
164
|
# starts with a hyphen; the second is true if it is a registered switch.
|
150
165
|
def current_is_switch?
|
166
|
+
return [false, false] if @is_treated_as_value
|
151
167
|
case peek
|
152
168
|
when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM
|
153
169
|
[true, switch?($1)]
|
@@ -159,6 +175,7 @@ class Bundler::Thor
|
|
159
175
|
end
|
160
176
|
|
161
177
|
def current_is_switch_formatted?
|
178
|
+
return false if @is_treated_as_value
|
162
179
|
case peek
|
163
180
|
when LONG_RE, SHORT_RE, EQ_RE, SHORT_NUM, SHORT_SQ_RE
|
164
181
|
true
|
@@ -168,6 +185,7 @@ class Bundler::Thor
|
|
168
185
|
end
|
169
186
|
|
170
187
|
def current_is_value?
|
188
|
+
return true if @is_treated_as_value
|
171
189
|
peek && (!parsing_options? || super)
|
172
190
|
end
|
173
191
|
|
@@ -103,6 +103,23 @@ class Bundler::Thor
|
|
103
103
|
stdout.flush
|
104
104
|
end
|
105
105
|
|
106
|
+
# Say (print) an error to the user. If the sentence ends with a whitespace
|
107
|
+
# or tab character, a new line is not appended (print + flush). Otherwise
|
108
|
+
# are passed straight to puts (behavior got from Highline).
|
109
|
+
#
|
110
|
+
# ==== Example
|
111
|
+
# say_error("error: something went wrong")
|
112
|
+
#
|
113
|
+
def say_error(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
|
114
|
+
return if quiet?
|
115
|
+
|
116
|
+
buffer = prepare_message(message, *color)
|
117
|
+
buffer << "\n" if force_new_line && !message.to_s.end_with?("\n")
|
118
|
+
|
119
|
+
stderr.print(buffer)
|
120
|
+
stderr.flush
|
121
|
+
end
|
122
|
+
|
106
123
|
# Say a status with the given color and appends the message. Since this
|
107
124
|
# method is used frequently by actions, it allows nil or false to be given
|
108
125
|
# in log_status, avoiding the message from being shown. If a Symbol is
|
@@ -111,13 +128,14 @@ class Bundler::Thor
|
|
111
128
|
def say_status(status, message, log_status = true)
|
112
129
|
return if quiet? || log_status == false
|
113
130
|
spaces = " " * (padding + 1)
|
114
|
-
color = log_status.is_a?(Symbol) ? log_status : :green
|
115
|
-
|
116
131
|
status = status.to_s.rjust(12)
|
132
|
+
margin = " " * status.length + spaces
|
133
|
+
|
134
|
+
color = log_status.is_a?(Symbol) ? log_status : :green
|
117
135
|
status = set_color status, color, true if color
|
118
136
|
|
119
|
-
|
120
|
-
buffer = "#{
|
137
|
+
message = message.to_s.chomp.gsub(/(?<!\A)^/, margin)
|
138
|
+
buffer = "#{status}#{spaces}#{message}\n"
|
121
139
|
|
122
140
|
stdout.print(buffer)
|
123
141
|
stdout.flush
|
@@ -21,7 +21,7 @@ class Bundler::Thor
|
|
21
21
|
end
|
22
22
|
|
23
23
|
module Shell
|
24
|
-
SHELL_DELEGATED_METHODS = [:ask, :error, :set_color, :yes?, :no?, :say, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
|
24
|
+
SHELL_DELEGATED_METHODS = [:ask, :error, :set_color, :yes?, :no?, :say, :say_error, :say_status, :print_in_columns, :print_table, :print_wrapped, :file_collision, :terminal_width]
|
25
25
|
attr_writer :shell
|
26
26
|
|
27
27
|
autoload :Basic, File.expand_path("shell/basic", __dir__)
|
@@ -211,7 +211,7 @@ class Bundler::Thor
|
|
211
211
|
#
|
212
212
|
def globs_for(path)
|
213
213
|
path = escape_globs(path)
|
214
|
-
["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks
|
214
|
+
["#{path}/Thorfile", "#{path}/*.thor", "#{path}/tasks/*.thor", "#{path}/lib/tasks/**/*.thor"]
|
215
215
|
end
|
216
216
|
|
217
217
|
# Return the path to the ruby interpreter taking into account multiple
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions
|
5
|
+
are met:
|
6
|
+
1. Redistributions of source code must retain the above copyright
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
10
|
+
documentation and/or other materials provided with the distribution.
|
11
|
+
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
13
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
14
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
15
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
16
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
17
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
18
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
19
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
20
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
21
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
22
|
+
SUCH DAMAGE.
|