bundler 2.2.3 → 2.2.8
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 +73 -2
- data/bundler.gemspec +1 -1
- data/lib/bundler.rb +0 -1
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +3 -5
- data/lib/bundler/cli/cache.rb +1 -0
- data/lib/bundler/cli/gem.rb +14 -0
- data/lib/bundler/compact_index_client/updater.rb +0 -8
- data/lib/bundler/definition.rb +17 -27
- data/lib/bundler/dep_proxy.rb +15 -8
- data/lib/bundler/feature_flag.rb +0 -1
- data/lib/bundler/fetcher.rb +0 -1
- data/lib/bundler/gem_helper.rb +9 -7
- data/lib/bundler/gem_version_promoter.rb +2 -2
- data/lib/bundler/index.rb +6 -5
- data/lib/bundler/installer.rb +0 -17
- data/lib/bundler/installer/standalone.rb +15 -0
- data/lib/bundler/lazy_specification.rb +9 -18
- data/{man → lib/bundler/man}/bundle-add.1 +1 -1
- data/{man → lib/bundler/man}/bundle-binstubs.1 +1 -1
- data/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man → lib/bundler/man}/bundle-config.1 +4 -4
- data/lib/bundler/man/bundle-config.1.ronn +3 -3
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man → lib/bundler/man}/bundle-exec.1 +1 -1
- data/{man → lib/bundler/man}/bundle-gem.1 +1 -1
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man → lib/bundler/man}/bundle-install.1 +1 -1
- data/{man → lib/bundler/man}/bundle-list.1 +1 -1
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man → lib/bundler/man}/bundle-update.1 +1 -1
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man → lib/bundler/man}/bundle.1 +1 -1
- data/{man → lib/bundler/man}/gemfile.5 +1 -1
- data/{man → lib/bundler/man}/index.txt +0 -0
- data/lib/bundler/resolver.rb +82 -43
- data/lib/bundler/resolver/spec_group.rb +56 -44
- data/lib/bundler/rubygems_ext.rb +16 -0
- data/lib/bundler/settings.rb +1 -1
- data/lib/bundler/shared_helpers.rb +2 -2
- data/lib/bundler/source/git.rb +19 -17
- data/lib/bundler/source/git/git_proxy.rb +54 -49
- data/lib/bundler/source/path/installer.rb +2 -0
- data/lib/bundler/source/rubygems.rb +10 -2
- data/lib/bundler/source_list.rb +2 -4
- data/lib/bundler/spec_set.rb +5 -4
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/lib/bundler/templates/newgem/rubocop.yml.tt +3 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +0 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +11 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +11 -7
- data/lib/bundler/vendor/thor/lib/thor.rb +5 -6
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +4 -2
- data/lib/bundler/vendor/thor/lib/thor/error.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +9 -8
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +5 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +5 -1
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- metadata +30 -29
|
@@ -145,6 +145,8 @@ module Bundler
|
|
|
145
145
|
|
|
146
146
|
Bundler.mkdir_p bin_path, :no_sudo => true unless spec.executables.empty? || Bundler.rubygems.provides?(">= 2.7.5")
|
|
147
147
|
|
|
148
|
+
require_relative "../rubygems_gem_installer"
|
|
149
|
+
|
|
148
150
|
installed_spec = Bundler::RubyGemsGemInstaller.at(
|
|
149
151
|
path,
|
|
150
152
|
:install_dir => install_path.to_s,
|
|
@@ -351,7 +353,6 @@ module Bundler
|
|
|
351
353
|
def installed_specs
|
|
352
354
|
@installed_specs ||= Index.build do |idx|
|
|
353
355
|
Bundler.rubygems.all_specs.reverse_each do |spec|
|
|
354
|
-
next if spec.name == "bundler"
|
|
355
356
|
spec.source = self
|
|
356
357
|
if Bundler.rubygems.spec_missing_extensions?(spec, false)
|
|
357
358
|
Bundler.ui.debug "Source #{self} is ignoring #{spec} because it is missing extensions"
|
|
@@ -487,8 +488,15 @@ module Bundler
|
|
|
487
488
|
uri = spec.remote.uri
|
|
488
489
|
Bundler.ui.confirm("Fetching #{version_message(spec)}")
|
|
489
490
|
rubygems_local_path = Bundler.rubygems.download_gem(spec, uri, download_path)
|
|
491
|
+
|
|
492
|
+
# older rubygems return varying file:// variants depending on version
|
|
493
|
+
rubygems_local_path = rubygems_local_path.gsub(/\Afile:/, "") unless Bundler.rubygems.provides?(">= 3.2.0.rc.2")
|
|
494
|
+
rubygems_local_path = rubygems_local_path.gsub(%r{\A//}, "") if Bundler.rubygems.provides?("< 3.1.0")
|
|
495
|
+
|
|
490
496
|
if rubygems_local_path != local_path
|
|
491
|
-
|
|
497
|
+
SharedHelpers.filesystem_access(local_path) do
|
|
498
|
+
FileUtils.mv(rubygems_local_path, local_path)
|
|
499
|
+
end
|
|
492
500
|
end
|
|
493
501
|
cache_globally(spec, local_path)
|
|
494
502
|
end
|
data/lib/bundler/source_list.rb
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "set"
|
|
4
|
-
|
|
5
3
|
module Bundler
|
|
6
4
|
class SourceList
|
|
7
5
|
attr_reader :path_sources,
|
|
@@ -99,7 +97,7 @@ module Bundler
|
|
|
99
97
|
@rubygems_aggregate = replacement_rubygems if replacement_rubygems
|
|
100
98
|
|
|
101
99
|
return true if !equal_sources?(lock_sources, replacement_sources) && !equivalent_sources?(lock_sources, replacement_sources)
|
|
102
|
-
return true if replacement_rubygems && rubygems_remotes.
|
|
100
|
+
return true if replacement_rubygems && rubygems_remotes.sort_by(&:to_s) != replacement_rubygems.remotes.sort_by(&:to_s)
|
|
103
101
|
|
|
104
102
|
false
|
|
105
103
|
end
|
|
@@ -153,7 +151,7 @@ module Bundler
|
|
|
153
151
|
end
|
|
154
152
|
|
|
155
153
|
def equal_sources?(lock_sources, replacement_sources)
|
|
156
|
-
lock_sources.
|
|
154
|
+
lock_sources.sort_by(&:to_s) == replacement_sources.sort_by(&:to_s)
|
|
157
155
|
end
|
|
158
156
|
|
|
159
157
|
def equal_source?(source, other_source)
|
data/lib/bundler/spec_set.rb
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "tsort"
|
|
4
|
-
require "set"
|
|
5
4
|
|
|
6
5
|
module Bundler
|
|
7
6
|
class SpecSet
|
|
@@ -13,14 +12,16 @@ module Bundler
|
|
|
13
12
|
end
|
|
14
13
|
|
|
15
14
|
def for(dependencies, skip = [], check = false, match_current_platform = false, raise_on_missing = true)
|
|
16
|
-
handled =
|
|
15
|
+
handled = []
|
|
17
16
|
deps = dependencies.dup
|
|
18
17
|
specs = []
|
|
19
18
|
skip += ["bundler"]
|
|
20
19
|
|
|
21
20
|
loop do
|
|
22
21
|
break unless dep = deps.shift
|
|
23
|
-
next if
|
|
22
|
+
next if handled.include?(dep) || skip.include?(dep.name)
|
|
23
|
+
|
|
24
|
+
handled << dep
|
|
24
25
|
|
|
25
26
|
specs_for_dep = spec_for_dependency(dep, match_current_platform)
|
|
26
27
|
if specs_for_dep.any?
|
|
@@ -28,7 +29,7 @@ module Bundler
|
|
|
28
29
|
|
|
29
30
|
specs_for_dep.first.dependencies.each do |d|
|
|
30
31
|
next if d.type == :development
|
|
31
|
-
d = DepProxy.
|
|
32
|
+
d = DepProxy.get_proxy(d, dep.__platform) unless match_current_platform
|
|
32
33
|
deps << d
|
|
33
34
|
end
|
|
34
35
|
elsif check
|
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
<%- if config[:mit] -%>
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
<%- end -%>
|
|
17
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
|
17
|
+
spec.required_ruby_version = Gem::Requirement.new(">= <%= config[:required_ruby_version] %>")
|
|
18
18
|
|
|
19
19
|
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
|
20
20
|
|
|
@@ -26,6 +26,13 @@ module Bundler::Molinillo
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
# (see Bundler::Molinillo::SpecificationProvider#dependencies_equal?)
|
|
30
|
+
def dependencies_equal?(dependencies, other_dependencies)
|
|
31
|
+
with_no_such_dependency_error_handling do
|
|
32
|
+
specification_provider.dependencies_equal?(dependencies, other_dependencies)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
29
36
|
# (see Bundler::Molinillo::SpecificationProvider#name_for)
|
|
30
37
|
def name_for(dependency)
|
|
31
38
|
with_no_such_dependency_error_handling do
|
|
@@ -59,7 +59,7 @@ module Bundler::Molinillo
|
|
|
59
59
|
# @param [Set<Vertex>] vertices the set to add the predecessors to
|
|
60
60
|
# @return [Set<Vertex>] the vertices of {#graph} where `self` is a
|
|
61
61
|
# {#descendent?}
|
|
62
|
-
def _recursive_predecessors(vertices =
|
|
62
|
+
def _recursive_predecessors(vertices = new_vertex_set)
|
|
63
63
|
incoming_edges.each do |edge|
|
|
64
64
|
vertex = edge.origin
|
|
65
65
|
next unless vertices.add?(vertex)
|
|
@@ -85,7 +85,7 @@ module Bundler::Molinillo
|
|
|
85
85
|
# @param [Set<Vertex>] vertices the set to add the successors to
|
|
86
86
|
# @return [Set<Vertex>] the vertices of {#graph} where `self` is an
|
|
87
87
|
# {#ancestor?}
|
|
88
|
-
def _recursive_successors(vertices =
|
|
88
|
+
def _recursive_successors(vertices = new_vertex_set)
|
|
89
89
|
outgoing_edges.each do |edge|
|
|
90
90
|
vertex = edge.destination
|
|
91
91
|
next unless vertices.add?(vertex)
|
|
@@ -128,7 +128,7 @@ module Bundler::Molinillo
|
|
|
128
128
|
|
|
129
129
|
# Is there a path from `self` to `other` following edges in the
|
|
130
130
|
# dependency graph?
|
|
131
|
-
# @return
|
|
131
|
+
# @return whether there is a path following edges within this {#graph}
|
|
132
132
|
def path_to?(other)
|
|
133
133
|
_path_to?(other)
|
|
134
134
|
end
|
|
@@ -138,7 +138,7 @@ module Bundler::Molinillo
|
|
|
138
138
|
# @param [Vertex] other the vertex to check if there's a path to
|
|
139
139
|
# @param [Set<Vertex>] visited the vertices of {#graph} that have been visited
|
|
140
140
|
# @return [Boolean] whether there is a path to `other` from `self`
|
|
141
|
-
def _path_to?(other, visited =
|
|
141
|
+
def _path_to?(other, visited = new_vertex_set)
|
|
142
142
|
return false unless visited.add?(self)
|
|
143
143
|
return true if equal?(other)
|
|
144
144
|
successors.any? { |v| v._path_to?(other, visited) }
|
|
@@ -147,12 +147,18 @@ module Bundler::Molinillo
|
|
|
147
147
|
|
|
148
148
|
# Is there a path from `other` to `self` following edges in the
|
|
149
149
|
# dependency graph?
|
|
150
|
-
# @return
|
|
150
|
+
# @return whether there is a path following edges within this {#graph}
|
|
151
151
|
def ancestor?(other)
|
|
152
152
|
other.path_to?(self)
|
|
153
153
|
end
|
|
154
154
|
|
|
155
155
|
alias is_reachable_from? ancestor?
|
|
156
|
+
|
|
157
|
+
def new_vertex_set
|
|
158
|
+
require 'set'
|
|
159
|
+
Set.new
|
|
160
|
+
end
|
|
161
|
+
private :new_vertex_set
|
|
156
162
|
end
|
|
157
163
|
end
|
|
158
164
|
end
|
|
@@ -34,7 +34,7 @@ module Bundler::Molinillo
|
|
|
34
34
|
|
|
35
35
|
# An error caused by attempting to fulfil a dependency that was circular
|
|
36
36
|
#
|
|
37
|
-
# @note This exception will be thrown
|
|
37
|
+
# @note This exception will be thrown if and only if a {Vertex} is added to a
|
|
38
38
|
# {DependencyGraph} that has a {DependencyGraph::Vertex#path_to?} an
|
|
39
39
|
# existing {DependencyGraph::Vertex}
|
|
40
40
|
class CircularDependencyError < ResolverError
|
|
@@ -121,7 +121,7 @@ module Bundler::Molinillo
|
|
|
121
121
|
t = ''.dup
|
|
122
122
|
depth = 2
|
|
123
123
|
tree.each do |req|
|
|
124
|
-
t << ' ' * depth << req
|
|
124
|
+
t << ' ' * depth << printable_requirement.call(req)
|
|
125
125
|
unless tree.last == req
|
|
126
126
|
if spec = conflict.activated_by_name[name_for(req)]
|
|
127
127
|
t << %( was resolved to #{version_for_spec.call(spec)}, which)
|
|
@@ -45,6 +45,17 @@ module Bundler::Molinillo
|
|
|
45
45
|
true
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
# Determines whether two arrays of dependencies are equal, and thus can be
|
|
49
|
+
# grouped.
|
|
50
|
+
#
|
|
51
|
+
# @param [Array<Object>] dependencies
|
|
52
|
+
# @param [Array<Object>] other_dependencies
|
|
53
|
+
# @return [Boolean] whether `dependencies` and `other_dependencies` should
|
|
54
|
+
# be considered equal.
|
|
55
|
+
def dependencies_equal?(dependencies, other_dependencies)
|
|
56
|
+
dependencies == other_dependencies
|
|
57
|
+
end
|
|
58
|
+
|
|
48
59
|
# Returns the name for the given `dependency`.
|
|
49
60
|
# @note This method should be 'pure', i.e. the return value should depend
|
|
50
61
|
# only on the `dependency` parameter.
|
|
@@ -329,11 +329,11 @@ module Bundler::Molinillo
|
|
|
329
329
|
|
|
330
330
|
# Look for past conflicts that could be unwound to affect the
|
|
331
331
|
# requirement tree for the current conflict
|
|
332
|
+
all_reqs = last_detail_for_current_unwind.all_requirements
|
|
333
|
+
all_reqs_size = all_reqs.size
|
|
332
334
|
relevant_unused_unwinds = unused_unwind_options.select do |alternative|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
alternative.requirements_unwound_to_instead
|
|
336
|
-
next if intersecting_requirements.empty?
|
|
335
|
+
diff_reqs = all_reqs - alternative.requirements_unwound_to_instead
|
|
336
|
+
next if diff_reqs.size == all_reqs_size
|
|
337
337
|
# Find the highest index unwind whilst looping through
|
|
338
338
|
current_detail = alternative if alternative > current_detail
|
|
339
339
|
alternative
|
|
@@ -344,8 +344,12 @@ module Bundler::Molinillo
|
|
|
344
344
|
state.unused_unwind_options += unwind_details.reject { |detail| detail.state_index == -1 }
|
|
345
345
|
|
|
346
346
|
# Update the requirements_unwound_to_instead on any relevant unused unwinds
|
|
347
|
-
relevant_unused_unwinds.each
|
|
348
|
-
|
|
347
|
+
relevant_unused_unwinds.each do |d|
|
|
348
|
+
(d.requirements_unwound_to_instead << current_detail.state_requirement).uniq!
|
|
349
|
+
end
|
|
350
|
+
unwind_details.each do |d|
|
|
351
|
+
(d.requirements_unwound_to_instead << current_detail.state_requirement).uniq!
|
|
352
|
+
end
|
|
349
353
|
|
|
350
354
|
current_detail
|
|
351
355
|
end
|
|
@@ -803,7 +807,7 @@ module Bundler::Molinillo
|
|
|
803
807
|
|
|
804
808
|
possibilities.reverse_each do |possibility|
|
|
805
809
|
dependencies = dependencies_for(possibility)
|
|
806
|
-
if current_possibility_set && current_possibility_set.dependencies
|
|
810
|
+
if current_possibility_set && dependencies_equal?(current_possibility_set.dependencies, dependencies)
|
|
807
811
|
current_possibility_set.possibilities.unshift(possibility)
|
|
808
812
|
else
|
|
809
813
|
possibility_sets.unshift(PossibilitySet.new(dependencies, [possibility]))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
require "set"
|
|
2
1
|
require_relative "thor/base"
|
|
3
2
|
|
|
4
3
|
class Bundler::Thor
|
|
4
|
+
$thor_runner ||= false
|
|
5
5
|
class << self
|
|
6
6
|
# Allows for custom "Command" package naming.
|
|
7
7
|
#
|
|
@@ -323,7 +323,7 @@ class Bundler::Thor
|
|
|
323
323
|
# ==== Parameters
|
|
324
324
|
# Symbol ...:: A list of commands that should be affected.
|
|
325
325
|
def stop_on_unknown_option!(*command_names)
|
|
326
|
-
stop_on_unknown_option
|
|
326
|
+
@stop_on_unknown_option = stop_on_unknown_option | command_names
|
|
327
327
|
end
|
|
328
328
|
|
|
329
329
|
def stop_on_unknown_option?(command) #:nodoc:
|
|
@@ -337,7 +337,7 @@ class Bundler::Thor
|
|
|
337
337
|
# ==== Parameters
|
|
338
338
|
# Symbol ...:: A list of commands that should be affected.
|
|
339
339
|
def disable_required_check!(*command_names)
|
|
340
|
-
disable_required_check
|
|
340
|
+
@disable_required_check = disable_required_check | command_names
|
|
341
341
|
end
|
|
342
342
|
|
|
343
343
|
def disable_required_check?(command) #:nodoc:
|
|
@@ -347,12 +347,12 @@ class Bundler::Thor
|
|
|
347
347
|
protected
|
|
348
348
|
|
|
349
349
|
def stop_on_unknown_option #:nodoc:
|
|
350
|
-
@stop_on_unknown_option ||=
|
|
350
|
+
@stop_on_unknown_option ||= []
|
|
351
351
|
end
|
|
352
352
|
|
|
353
353
|
# help command has the required check disabled by default.
|
|
354
354
|
def disable_required_check #:nodoc:
|
|
355
|
-
@disable_required_check ||=
|
|
355
|
+
@disable_required_check ||= [:help]
|
|
356
356
|
end
|
|
357
357
|
|
|
358
358
|
# The method responsible for dispatching given the args.
|
|
@@ -398,7 +398,6 @@ class Bundler::Thor
|
|
|
398
398
|
# the namespace should be displayed as arguments.
|
|
399
399
|
#
|
|
400
400
|
def banner(command, namespace = nil, subcommand = false)
|
|
401
|
-
$thor_runner ||= false
|
|
402
401
|
command.formatted_usage(self, $thor_runner, subcommand).split("\n").map do |formatted_usage|
|
|
403
402
|
"#{basename} #{formatted_usage}"
|
|
404
403
|
end.join("\n")
|
|
@@ -251,7 +251,8 @@ class Bundler::Thor
|
|
|
251
251
|
# path<String>:: path of the file to be changed
|
|
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
|
-
# config<Hash>:: give :verbose => false to not log the status
|
|
254
|
+
# config<Hash>:: give :verbose => false to not log the status, and
|
|
255
|
+
# :force => true, to force the replacement regardles of runner behavior.
|
|
255
256
|
#
|
|
256
257
|
# ==== Example
|
|
257
258
|
#
|
|
@@ -262,9 +263,10 @@ class Bundler::Thor
|
|
|
262
263
|
# end
|
|
263
264
|
#
|
|
264
265
|
def gsub_file(path, flag, *args, &block)
|
|
265
|
-
return unless behavior == :invoke
|
|
266
266
|
config = args.last.is_a?(Hash) ? args.pop : {}
|
|
267
267
|
|
|
268
|
+
return unless behavior == :invoke || config.fetch(:force, false)
|
|
269
|
+
|
|
268
270
|
path = File.expand_path(path, destination_root)
|
|
269
271
|
say_status :gsub, relative_to_original_destination_root(path), config.fetch(:verbose, true)
|
|
270
272
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
class Bundler::Thor
|
|
2
|
-
Correctable = if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable)
|
|
2
|
+
Correctable = if defined?(DidYouMean::SpellChecker) && defined?(DidYouMean::Correctable) # rubocop:disable Naming/ConstantName
|
|
3
3
|
# In order to support versions of Ruby that don't have keyword
|
|
4
4
|
# arguments, we need our own spell checker class that doesn't take key
|
|
5
5
|
# words. Even though this code wouldn't be hit because of the check
|
|
@@ -30,7 +30,11 @@ class Bundler::Thor
|
|
|
30
30
|
|
|
31
31
|
arguments.each do |argument|
|
|
32
32
|
if !argument.default.nil?
|
|
33
|
-
|
|
33
|
+
begin
|
|
34
|
+
@assigns[argument.human_name] = argument.default.dup
|
|
35
|
+
rescue TypeError # Compatibility shim for un-dup-able Fixnum in Ruby < 2.4
|
|
36
|
+
@assigns[argument.human_name] = argument.default
|
|
37
|
+
end
|
|
34
38
|
elsif argument.required?
|
|
35
39
|
@non_assigned_required << argument
|
|
36
40
|
end
|
|
@@ -133,15 +133,16 @@ class Bundler::Thor
|
|
|
133
133
|
|
|
134
134
|
protected
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
136
|
+
def assign_result!(option, result)
|
|
137
|
+
if option.repeatable && option.type == :hash
|
|
138
|
+
(@assigns[option.human_name] ||= {}).merge!(result)
|
|
139
|
+
elsif option.repeatable
|
|
140
|
+
(@assigns[option.human_name] ||= []) << result
|
|
141
|
+
else
|
|
142
|
+
@assigns[option.human_name] = result
|
|
143
|
+
end
|
|
143
144
|
end
|
|
144
|
-
|
|
145
|
+
|
|
145
146
|
# Check if the current value in peek is a registered switch.
|
|
146
147
|
#
|
|
147
148
|
# Two booleans are returned. The first is true if the current value
|
|
@@ -94,6 +94,8 @@ class Bundler::Thor
|
|
|
94
94
|
# say("I know you knew that.")
|
|
95
95
|
#
|
|
96
96
|
def say(message = "", color = nil, force_new_line = (message.to_s !~ /( |\t)\Z/))
|
|
97
|
+
return if quiet?
|
|
98
|
+
|
|
97
99
|
buffer = prepare_message(message, *color)
|
|
98
100
|
buffer << "\n" if force_new_line && !message.to_s.end_with?("\n")
|
|
99
101
|
|
|
@@ -230,8 +232,9 @@ class Bundler::Thor
|
|
|
230
232
|
paras = message.split("\n\n")
|
|
231
233
|
|
|
232
234
|
paras.map! do |unwrapped|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
words = unwrapped.split(" ")
|
|
236
|
+
counter = words.first.length
|
|
237
|
+
words.inject do |memo, word|
|
|
235
238
|
word = word.gsub(/\n\005/, "\n").gsub(/\005/, "\n")
|
|
236
239
|
counter = 0 if word.include? "\n"
|
|
237
240
|
if (counter + word.length + 1) < width
|