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.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +206 -1
  3. data/README.md +1 -1
  4. data/exe/bundle +7 -8
  5. data/lib/bundler/.document +1 -0
  6. data/lib/bundler/build_metadata.rb +2 -2
  7. data/lib/bundler/cli/check.rb +1 -1
  8. data/lib/bundler/cli/config.rb +10 -1
  9. data/lib/bundler/cli/doctor.rb +12 -3
  10. data/lib/bundler/cli/gem.rb +98 -9
  11. data/lib/bundler/cli/info.rb +26 -5
  12. data/lib/bundler/cli/install.rb +8 -28
  13. data/lib/bundler/cli/issue.rb +4 -3
  14. data/lib/bundler/cli/platform.rb +1 -1
  15. data/lib/bundler/cli/remove.rb +1 -2
  16. data/lib/bundler/cli/update.rb +8 -4
  17. data/lib/bundler/cli.rb +13 -11
  18. data/lib/bundler/compact_index_client/cache.rb +0 -9
  19. data/lib/bundler/compact_index_client/updater.rb +0 -5
  20. data/lib/bundler/compact_index_client.rb +2 -8
  21. data/lib/bundler/definition.rb +79 -133
  22. data/lib/bundler/dependency.rb +5 -7
  23. data/lib/bundler/digest.rb +71 -0
  24. data/lib/bundler/dsl.rb +18 -30
  25. data/lib/bundler/endpoint_specification.rb +21 -11
  26. data/lib/bundler/env.rb +1 -1
  27. data/lib/bundler/environment_preserver.rb +4 -1
  28. data/lib/bundler/errors.rb +18 -2
  29. data/lib/bundler/fetcher/compact_index.rb +9 -14
  30. data/lib/bundler/fetcher/index.rb +0 -26
  31. data/lib/bundler/fetcher.rb +13 -20
  32. data/lib/bundler/friendly_errors.rb +5 -30
  33. data/lib/bundler/gem_helper.rb +7 -18
  34. data/lib/bundler/injector.rb +10 -1
  35. data/lib/bundler/installer/gem_installer.rb +1 -6
  36. data/lib/bundler/installer.rb +1 -5
  37. data/lib/bundler/lazy_specification.rb +19 -3
  38. data/lib/bundler/lockfile_generator.rb +1 -1
  39. data/lib/bundler/lockfile_parser.rb +10 -12
  40. data/lib/bundler/man/bundle-add.1 +10 -2
  41. data/lib/bundler/man/bundle-add.1.ronn +7 -1
  42. data/lib/bundler/man/bundle-binstubs.1 +1 -1
  43. data/lib/bundler/man/bundle-cache.1 +1 -1
  44. data/lib/bundler/man/bundle-check.1 +1 -1
  45. data/lib/bundler/man/bundle-clean.1 +1 -1
  46. data/lib/bundler/man/bundle-config.1 +5 -5
  47. data/lib/bundler/man/bundle-config.1.ronn +5 -5
  48. data/lib/bundler/man/bundle-doctor.1 +1 -1
  49. data/lib/bundler/man/bundle-exec.1 +1 -1
  50. data/lib/bundler/man/bundle-gem.1 +14 -1
  51. data/lib/bundler/man/bundle-gem.1.ronn +16 -0
  52. data/lib/bundler/man/bundle-info.1 +1 -1
  53. data/lib/bundler/man/bundle-init.1 +1 -1
  54. data/lib/bundler/man/bundle-inject.1 +1 -1
  55. data/lib/bundler/man/bundle-install.1 +2 -2
  56. data/lib/bundler/man/bundle-install.1.ronn +2 -2
  57. data/lib/bundler/man/bundle-list.1 +1 -1
  58. data/lib/bundler/man/bundle-lock.1 +1 -1
  59. data/lib/bundler/man/bundle-open.1 +1 -1
  60. data/lib/bundler/man/bundle-outdated.1 +1 -1
  61. data/lib/bundler/man/bundle-platform.1 +1 -1
  62. data/lib/bundler/man/bundle-pristine.1 +1 -1
  63. data/lib/bundler/man/bundle-remove.1 +1 -1
  64. data/lib/bundler/man/bundle-show.1 +1 -1
  65. data/lib/bundler/man/bundle-update.1 +2 -2
  66. data/lib/bundler/man/bundle-update.1.ronn +2 -1
  67. data/lib/bundler/man/bundle-viz.1 +1 -1
  68. data/lib/bundler/man/bundle.1 +1 -1
  69. data/lib/bundler/man/gemfile.5 +28 -2
  70. data/lib/bundler/man/gemfile.5.ronn +9 -1
  71. data/lib/bundler/plugin/api/source.rb +1 -0
  72. data/lib/bundler/plugin/installer.rb +3 -1
  73. data/lib/bundler/plugin.rb +23 -6
  74. data/lib/bundler/process_lock.rb +1 -1
  75. data/lib/bundler/remote_specification.rb +7 -0
  76. data/lib/bundler/resolver/spec_group.rb +1 -1
  77. data/lib/bundler/resolver.rb +38 -40
  78. data/lib/bundler/ruby_version.rb +1 -1
  79. data/lib/bundler/rubygems_ext.rb +19 -10
  80. data/lib/bundler/rubygems_gem_installer.rb +21 -5
  81. data/lib/bundler/rubygems_integration.rb +40 -70
  82. data/lib/bundler/runtime.rb +2 -2
  83. data/lib/bundler/self_manager.rb +168 -0
  84. data/lib/bundler/settings.rb +11 -2
  85. data/lib/bundler/shared_helpers.rb +4 -12
  86. data/lib/bundler/source/git/git_proxy.rb +7 -4
  87. data/lib/bundler/source/git.rb +22 -4
  88. data/lib/bundler/source/metadata.rb +1 -1
  89. data/lib/bundler/source/rubygems.rb +60 -85
  90. data/lib/bundler/source/rubygems_aggregate.rb +1 -1
  91. data/lib/bundler/source.rb +3 -1
  92. data/lib/bundler/source_list.rb +11 -29
  93. data/lib/bundler/spec_set.rb +2 -2
  94. data/lib/bundler/templates/Executable.bundler +1 -1
  95. data/lib/bundler/templates/Gemfile +0 -2
  96. data/lib/bundler/templates/gems.rb +0 -3
  97. data/lib/bundler/templates/newgem/Gemfile.tt +5 -2
  98. data/lib/bundler/templates/newgem/Rakefile.tt +15 -2
  99. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +4 -3
  100. data/lib/bundler/templates/newgem/newgem.gemspec.tt +15 -15
  101. data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
  102. data/lib/bundler/templates/newgem/standard.yml.tt +3 -0
  103. data/lib/bundler/templates/newgem/test/minitest/{newgem_test.rb.tt → test_newgem.rb.tt} +1 -1
  104. data/lib/bundler/ui/shell.rb +1 -1
  105. data/lib/bundler/vendor/.document +1 -0
  106. data/lib/bundler/vendor/connection_pool/LICENSE +20 -0
  107. data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +19 -21
  108. data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
  109. data/lib/bundler/vendor/connection_pool/lib/connection_pool/wrapper.rb +57 -0
  110. data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +39 -74
  111. data/lib/bundler/vendor/fileutils/LICENSE.txt +22 -0
  112. data/lib/bundler/vendor/molinillo/LICENSE +9 -0
  113. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
  114. data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
  115. data/lib/bundler/vendor/thor/LICENSE.md +20 -0
  116. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +6 -6
  117. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -2
  118. data/lib/bundler/vendor/thor/lib/thor/actions.rb +6 -2
  119. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +6 -0
  120. data/lib/bundler/vendor/thor/lib/thor/error.rb +9 -4
  121. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +19 -1
  122. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +22 -4
  123. data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
  124. data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
  125. data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
  126. data/lib/bundler/vendor/tsort/LICENSE.txt +22 -0
  127. data/lib/bundler/vendor/tsort/lib/tsort.rb +453 -0
  128. data/lib/bundler/vendor/uri/LICENSE.txt +22 -0
  129. data/lib/bundler/vendor/uri/lib/uri/common.rb +17 -80
  130. data/lib/bundler/vendor/uri/lib/uri/ftp.rb +0 -1
  131. data/lib/bundler/vendor/uri/lib/uri/generic.rb +5 -6
  132. data/lib/bundler/vendor/uri/lib/uri/http.rb +0 -1
  133. data/lib/bundler/vendor/uri/lib/uri/https.rb +0 -1
  134. data/lib/bundler/vendor/uri/lib/uri/ldap.rb +1 -1
  135. data/lib/bundler/vendor/uri/lib/uri/mailto.rb +0 -1
  136. data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +1 -14
  137. data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +1 -12
  138. data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
  139. data/lib/bundler/vendor/uri/lib/uri/ws.rb +84 -0
  140. data/lib/bundler/vendor/uri/lib/uri/wss.rb +22 -0
  141. data/lib/bundler/vendor/uri/lib/uri.rb +0 -1
  142. data/lib/bundler/vendored_tsort.rb +4 -0
  143. data/lib/bundler/version.rb +1 -1
  144. data/lib/bundler/worker.rb +2 -2
  145. data/lib/bundler.rb +23 -22
  146. metadata +25 -10
  147. data/lib/bundler/gemdeps.rb +0 -29
  148. data/lib/bundler/psyched_yaml.rb +0 -22
  149. 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
- require 'tsort'
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 regardless of runner behavior.
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.
@@ -28,6 +28,12 @@ class Bundler::Thor
28
28
  super(convert_key(key))
29
29
  end
30
30
 
31
+ def except(*keys)
32
+ dup.tap do |hash|
33
+ keys.each { |key| hash.delete(convert_key(key)) }
34
+ end
35
+ end
36
+
31
37
  def fetch(key, *args)
32
38
  super(convert_key(key), *args)
33
39
  end
@@ -102,9 +102,14 @@ class Bundler::Thor
102
102
  end
103
103
 
104
104
  if Correctable
105
- DidYouMean::SPELL_CHECKERS.merge!(
106
- 'Bundler::Thor::UndefinedCommandError' => UndefinedCommandError::SpellChecker,
107
- 'Bundler::Thor::UnknownArgumentError' => UnknownArgumentError::SpellChecker
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, SHORT_NUM
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
- buffer = "#{status}#{spaces}#{message}"
120
- buffer = "#{buffer}\n" unless buffer.end_with?("\n")
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/*.thor"]
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
@@ -1,3 +1,3 @@
1
1
  class Bundler::Thor
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -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.