bundler 2.2.32 → 2.2.34
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 +29 -0
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli/doctor.rb +3 -2
- data/lib/bundler/cli/gem.rb +1 -0
- data/lib/bundler/cli/info.rb +6 -1
- data/lib/bundler/cli/update.rb +2 -2
- data/lib/bundler/cli.rb +1 -0
- data/lib/bundler/compact_index_client/updater.rb +0 -5
- data/lib/bundler/definition.rb +17 -50
- data/lib/bundler/dsl.rb +18 -3
- data/lib/bundler/environment_preserver.rb +4 -1
- data/lib/bundler/lazy_specification.rb +17 -1
- data/lib/bundler/man/bundle-add.1 +1 -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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- data/lib/bundler/man/bundle-viz.1 +1 -1
- data/lib/bundler/man/bundle.1 +1 -1
- data/lib/bundler/man/gemfile.5 +27 -1
- data/lib/bundler/man/gemfile.5.ronn +8 -0
- data/lib/bundler/plugin/api/source.rb +1 -0
- data/lib/bundler/resolver.rb +2 -4
- data/lib/bundler/shared_helpers.rb +2 -3
- data/lib/bundler/source/git/git_proxy.rb +2 -2
- data/lib/bundler/source/rubygems.rb +16 -12
- data/lib/bundler/source/rubygems_aggregate.rb +1 -1
- data/lib/bundler/source.rb +1 -1
- data/lib/bundler/source_list.rb +7 -29
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +2 -2
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/vendor/.document +1 -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/version.rb +1 -1
- metadata +5 -3
data/lib/bundler/man/gemfile.5
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 "GEMFILE" "5" "
|
|
4
|
+
.TH "GEMFILE" "5" "December 2021" "" ""
|
|
5
5
|
.
|
|
6
6
|
.SH "NAME"
|
|
7
7
|
\fBGemfile\fR \- A format for describing gem dependencies for Ruby programs
|
|
@@ -506,6 +506,32 @@ gem "rails", :git => "git://github\.com/rails/rails\.git"
|
|
|
506
506
|
.P
|
|
507
507
|
Since the \fBgithub\fR method is a specialization of \fBgit_source\fR, it accepts a \fB:branch\fR named argument\.
|
|
508
508
|
.
|
|
509
|
+
.P
|
|
510
|
+
You can also directly pass a pull request URL:
|
|
511
|
+
.
|
|
512
|
+
.IP "" 4
|
|
513
|
+
.
|
|
514
|
+
.nf
|
|
515
|
+
|
|
516
|
+
gem "rails", :github => "https://github\.com/rails/rails/pull/43753"
|
|
517
|
+
.
|
|
518
|
+
.fi
|
|
519
|
+
.
|
|
520
|
+
.IP "" 0
|
|
521
|
+
.
|
|
522
|
+
.P
|
|
523
|
+
Which is equivalent to:
|
|
524
|
+
.
|
|
525
|
+
.IP "" 4
|
|
526
|
+
.
|
|
527
|
+
.nf
|
|
528
|
+
|
|
529
|
+
gem "rails", :github => "rails/rails", branch: "refs/pull/43753/head"
|
|
530
|
+
.
|
|
531
|
+
.fi
|
|
532
|
+
.
|
|
533
|
+
.IP "" 0
|
|
534
|
+
.
|
|
509
535
|
.SS "GIST"
|
|
510
536
|
If the git repository you want to use is hosted as a Github Gist and is public, you can use the :gist shorthand to specify the gist identifier (without the trailing "\.git")\.
|
|
511
537
|
.
|
|
@@ -372,6 +372,14 @@ Are both equivalent to
|
|
|
372
372
|
|
|
373
373
|
Since the `github` method is a specialization of `git_source`, it accepts a `:branch` named argument.
|
|
374
374
|
|
|
375
|
+
You can also directly pass a pull request URL:
|
|
376
|
+
|
|
377
|
+
gem "rails", :github => "https://github.com/rails/rails/pull/43753"
|
|
378
|
+
|
|
379
|
+
Which is equivalent to:
|
|
380
|
+
|
|
381
|
+
gem "rails", :github => "rails/rails", branch: "refs/pull/43753/head"
|
|
382
|
+
|
|
375
383
|
### GIST
|
|
376
384
|
|
|
377
385
|
If the git repository you want to use is hosted as a Github Gist and is public, you can use
|
data/lib/bundler/resolver.rb
CHANGED
|
@@ -30,10 +30,8 @@ module Bundler
|
|
|
30
30
|
@resolver = Molinillo::Resolver.new(self, self)
|
|
31
31
|
@search_for = {}
|
|
32
32
|
@base_dg = Molinillo::DependencyGraph.new
|
|
33
|
-
aggregate_global_source = @source_requirements[:default].is_a?(Source::RubygemsAggregate)
|
|
34
33
|
@base.each do |ls|
|
|
35
34
|
dep = Dependency.new(ls.name, ls.version)
|
|
36
|
-
ls.source = source_for(ls.name) unless aggregate_global_source
|
|
37
35
|
@base_dg.add_vertex(ls.name, DepProxy.get_proxy(dep, ls.platform), true)
|
|
38
36
|
end
|
|
39
37
|
additional_base_requirements.each {|d| @base_dg.add_vertex(d.name, d) }
|
|
@@ -272,7 +270,7 @@ module Bundler
|
|
|
272
270
|
rescue GemfileNotFound
|
|
273
271
|
nil
|
|
274
272
|
end
|
|
275
|
-
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source
|
|
273
|
+
message = String.new("Could not find gem '#{SharedHelpers.pretty_dependency(requirement)}' in #{source}#{cache_message}.\n")
|
|
276
274
|
message << "The source contains the following versions of '#{name}': #{formatted_versions_with_platforms(versions_with_platforms)}" if versions_with_platforms.any?
|
|
277
275
|
end
|
|
278
276
|
raise GemNotFound, message
|
|
@@ -371,7 +369,7 @@ module Bundler
|
|
|
371
369
|
o << if metadata_requirement
|
|
372
370
|
"is not available in #{relevant_source}"
|
|
373
371
|
else
|
|
374
|
-
"in #{relevant_source
|
|
372
|
+
"in #{relevant_source}.\n"
|
|
375
373
|
end
|
|
376
374
|
end
|
|
377
375
|
end,
|
|
@@ -320,12 +320,11 @@ module Bundler
|
|
|
320
320
|
end
|
|
321
321
|
|
|
322
322
|
def clean_load_path
|
|
323
|
-
bundler_lib = bundler_ruby_lib
|
|
324
|
-
|
|
325
323
|
loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
|
|
326
324
|
|
|
327
325
|
$LOAD_PATH.reject! do |p|
|
|
328
|
-
|
|
326
|
+
resolved_path = resolve_path(p)
|
|
327
|
+
next if $LOADED_FEATURES.any? {|lf| lf.start_with?(resolved_path) }
|
|
329
328
|
loaded_gem_paths.delete(p)
|
|
330
329
|
end
|
|
331
330
|
$LOAD_PATH.uniq!
|
|
@@ -95,12 +95,12 @@ module Bundler
|
|
|
95
95
|
SharedHelpers.filesystem_access(path.dirname) do |p|
|
|
96
96
|
FileUtils.mkdir_p(p)
|
|
97
97
|
end
|
|
98
|
-
git_retry "clone",
|
|
98
|
+
git_retry "clone", "--bare", "--no-hardlinks", "--quiet", "--", configured_uri, path.to_s
|
|
99
99
|
return unless extra_ref
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
with_path do
|
|
103
|
-
git_retry(*["fetch", "--force", "--quiet", "--tags", configured_uri, "refs/heads/*:refs/heads/*", extra_ref].compact, :dir => path)
|
|
103
|
+
git_retry(*["fetch", "--force", "--quiet", "--tags", "--", configured_uri, "refs/heads/*:refs/heads/*", extra_ref].compact, :dir => path)
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
106
|
|
|
@@ -98,26 +98,30 @@ module Bundler
|
|
|
98
98
|
out << " specs:\n"
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
-
def
|
|
101
|
+
def to_s
|
|
102
102
|
if remotes.empty?
|
|
103
103
|
"locally installed gems"
|
|
104
|
-
elsif @allow_remote
|
|
104
|
+
elsif @allow_remote && @allow_cached && @allow_local
|
|
105
|
+
"rubygems repository #{remote_names}, cached gems or installed locally"
|
|
106
|
+
elsif @allow_remote && @allow_local
|
|
105
107
|
"rubygems repository #{remote_names} or installed locally"
|
|
106
|
-
elsif @
|
|
107
|
-
"
|
|
108
|
+
elsif @allow_remote
|
|
109
|
+
"rubygems repository #{remote_names}"
|
|
110
|
+
elsif @allow_cached && @allow_local
|
|
111
|
+
"cached gems or installed locally"
|
|
108
112
|
else
|
|
109
113
|
"locally installed gems"
|
|
110
114
|
end
|
|
111
115
|
end
|
|
112
116
|
|
|
113
|
-
def
|
|
117
|
+
def identifier
|
|
114
118
|
if remotes.empty?
|
|
115
119
|
"locally installed gems"
|
|
116
120
|
else
|
|
117
|
-
"rubygems repository #{remote_names}
|
|
121
|
+
"rubygems repository #{remote_names}"
|
|
118
122
|
end
|
|
119
123
|
end
|
|
120
|
-
alias_method :name, :
|
|
124
|
+
alias_method :name, :identifier
|
|
121
125
|
|
|
122
126
|
def specs
|
|
123
127
|
@specs ||= begin
|
|
@@ -262,10 +266,6 @@ module Bundler
|
|
|
262
266
|
@remotes.unshift(uri) unless @remotes.include?(uri)
|
|
263
267
|
end
|
|
264
268
|
|
|
265
|
-
def equivalent_remotes?(other_remotes)
|
|
266
|
-
other_remotes.map(&method(:remove_auth)) == @remotes.map(&method(:remove_auth))
|
|
267
|
-
end
|
|
268
|
-
|
|
269
269
|
def spec_names
|
|
270
270
|
if @allow_remote && dependency_api_available?
|
|
271
271
|
remote_specs.spec_names
|
|
@@ -334,7 +334,11 @@ module Bundler
|
|
|
334
334
|
end
|
|
335
335
|
|
|
336
336
|
def credless_remotes
|
|
337
|
-
|
|
337
|
+
if Bundler.settings[:allow_deployment_source_credential_changes]
|
|
338
|
+
remotes.map(&method(:remove_auth))
|
|
339
|
+
else
|
|
340
|
+
remotes.map(&method(:suppress_configured_credentials))
|
|
341
|
+
end
|
|
338
342
|
end
|
|
339
343
|
|
|
340
344
|
def remotes_for_spec(spec)
|
data/lib/bundler/source.rb
CHANGED
data/lib/bundler/source_list.rb
CHANGED
|
@@ -98,7 +98,7 @@ module Bundler
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
def get(source)
|
|
101
|
-
source_list_for(source).find {|s|
|
|
101
|
+
source_list_for(source).find {|s| equivalent_source?(source, s) }
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
def lock_sources
|
|
@@ -106,14 +106,14 @@ module Bundler
|
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
def lock_other_sources
|
|
109
|
-
(path_sources + git_sources + plugin_sources).sort_by(&:
|
|
109
|
+
(path_sources + git_sources + plugin_sources).sort_by(&:identifier)
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def lock_rubygems_sources
|
|
113
113
|
if merged_gem_lockfile_sections?
|
|
114
114
|
[combine_rubygems_sources]
|
|
115
115
|
else
|
|
116
|
-
rubygems_sources.sort_by(&:
|
|
116
|
+
rubygems_sources.sort_by(&:identifier)
|
|
117
117
|
end
|
|
118
118
|
end
|
|
119
119
|
|
|
@@ -173,7 +173,7 @@ module Bundler
|
|
|
173
173
|
end
|
|
174
174
|
|
|
175
175
|
def different_sources?(lock_sources, replacement_sources)
|
|
176
|
-
!
|
|
176
|
+
!equivalent_sources?(lock_sources, replacement_sources)
|
|
177
177
|
end
|
|
178
178
|
|
|
179
179
|
def rubygems_aggregate_class
|
|
@@ -210,34 +210,12 @@ module Bundler
|
|
|
210
210
|
end
|
|
211
211
|
end
|
|
212
212
|
|
|
213
|
-
def equal_sources?(lock_sources, replacement_sources)
|
|
214
|
-
lock_sources.sort_by(&:to_s) == replacement_sources.sort_by(&:to_s)
|
|
215
|
-
end
|
|
216
|
-
|
|
217
|
-
def equal_source?(source, other_source)
|
|
218
|
-
return source.include?(other_source) if source.is_a?(Source::Rubygems) && other_source.is_a?(Source::Rubygems)
|
|
219
|
-
|
|
220
|
-
source == other_source
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
def equivalent_source?(source, other_source)
|
|
224
|
-
return false unless Bundler.settings[:allow_deployment_source_credential_changes] && source.is_a?(Source::Rubygems)
|
|
225
|
-
|
|
226
|
-
equivalent_rubygems_sources?([source], [other_source])
|
|
227
|
-
end
|
|
228
|
-
|
|
229
213
|
def equivalent_sources?(lock_sources, replacement_sources)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
lock_rubygems_sources, lock_other_sources = lock_sources.partition {|s| s.is_a?(Source::Rubygems) }
|
|
233
|
-
replacement_rubygems_sources, replacement_other_sources = replacement_sources.partition {|s| s.is_a?(Source::Rubygems) }
|
|
234
|
-
|
|
235
|
-
equivalent_rubygems_sources?(lock_rubygems_sources, replacement_rubygems_sources) && equal_sources?(lock_other_sources, replacement_other_sources)
|
|
214
|
+
lock_sources.sort_by(&:identifier) == replacement_sources.sort_by(&:identifier)
|
|
236
215
|
end
|
|
237
216
|
|
|
238
|
-
def
|
|
239
|
-
|
|
240
|
-
lock_sources.all? {|s| s.equivalent_remotes?(actual_remotes) }
|
|
217
|
+
def equivalent_source?(source, other_source)
|
|
218
|
+
source == other_source
|
|
241
219
|
end
|
|
242
220
|
end
|
|
243
221
|
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<%- config[:constant_array].each_with_index do |c, i| -%>
|
|
2
|
+
<%= " " * i %>module <%= c %>
|
|
3
|
+
<%- end -%>
|
|
4
|
+
<%= " " * config[:constant_array].size %>VERSION: String
|
|
5
|
+
<%= " " * config[:constant_array].size %># See the writing guide of rbs: https://github.com/ruby/rbs#guides
|
|
6
|
+
<%- (config[:constant_array].size-1).downto(0) do |i| -%>
|
|
7
|
+
<%= " " * i %>end
|
|
8
|
+
<%- end -%>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Vendored files do not need to be documented
|
|
@@ -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
|
data/lib/bundler/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bundler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.34
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- André Arko
|
|
@@ -22,7 +22,7 @@ authors:
|
|
|
22
22
|
autorequire:
|
|
23
23
|
bindir: exe
|
|
24
24
|
cert_chain: []
|
|
25
|
-
date:
|
|
25
|
+
date: 2023-02-06 00:00:00.000000000 Z
|
|
26
26
|
dependencies: []
|
|
27
27
|
description: Bundler manages an application's dependencies through its entire life,
|
|
28
28
|
across many machines, systematically and repeatably
|
|
@@ -235,6 +235,7 @@ files:
|
|
|
235
235
|
- lib/bundler/templates/newgem/newgem.gemspec.tt
|
|
236
236
|
- lib/bundler/templates/newgem/rspec.tt
|
|
237
237
|
- lib/bundler/templates/newgem/rubocop.yml.tt
|
|
238
|
+
- lib/bundler/templates/newgem/sig/newgem.rbs.tt
|
|
238
239
|
- lib/bundler/templates/newgem/spec/newgem_spec.rb.tt
|
|
239
240
|
- lib/bundler/templates/newgem/spec/spec_helper.rb.tt
|
|
240
241
|
- lib/bundler/templates/newgem/standard.yml.tt
|
|
@@ -248,6 +249,7 @@ files:
|
|
|
248
249
|
- lib/bundler/ui/shell.rb
|
|
249
250
|
- lib/bundler/ui/silent.rb
|
|
250
251
|
- lib/bundler/uri_credentials_filter.rb
|
|
252
|
+
- lib/bundler/vendor/.document
|
|
251
253
|
- lib/bundler/vendor/connection_pool/LICENSE
|
|
252
254
|
- lib/bundler/vendor/connection_pool/lib/connection_pool.rb
|
|
253
255
|
- lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb
|
|
@@ -365,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
365
367
|
- !ruby/object:Gem::Version
|
|
366
368
|
version: 2.5.2
|
|
367
369
|
requirements: []
|
|
368
|
-
rubygems_version: 3.2.
|
|
370
|
+
rubygems_version: 3.2.33
|
|
369
371
|
signing_key:
|
|
370
372
|
specification_version: 4
|
|
371
373
|
summary: The best way to manage your application's dependencies
|