bundler 2.1.4 → 2.2.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2017 -1430
- data/README.md +7 -9
- data/bundler.gemspec +5 -6
- data/exe/bundle +3 -0
- data/lib/bundler/build_metadata.rb +3 -11
- data/lib/bundler/cli/add.rb +1 -1
- data/lib/bundler/cli/binstubs.rb +6 -2
- data/lib/bundler/cli/cache.rb +3 -8
- data/lib/bundler/cli/check.rb +4 -2
- data/lib/bundler/cli/clean.rb +1 -1
- data/lib/bundler/cli/common.rb +29 -2
- data/lib/bundler/cli/console.rb +1 -1
- data/lib/bundler/cli/doctor.rb +16 -5
- data/lib/bundler/cli/exec.rb +5 -10
- data/lib/bundler/cli/fund.rb +36 -0
- data/lib/bundler/cli/gem.rb +209 -28
- data/lib/bundler/cli/info.rb +28 -5
- data/lib/bundler/cli/init.rb +2 -2
- data/lib/bundler/cli/inject.rb +1 -1
- data/lib/bundler/cli/install.rb +22 -34
- data/lib/bundler/cli/issue.rb +5 -4
- data/lib/bundler/cli/list.rb +19 -11
- data/lib/bundler/cli/lock.rb +5 -1
- data/lib/bundler/cli/open.rb +1 -2
- data/lib/bundler/cli/outdated.rb +95 -75
- data/lib/bundler/cli/plugin.rb +10 -0
- data/lib/bundler/cli/pristine.rb +5 -0
- data/lib/bundler/cli/remove.rb +1 -2
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +14 -7
- data/lib/bundler/cli.rb +89 -66
- data/lib/bundler/compact_index_client/cache.rb +6 -14
- data/lib/bundler/compact_index_client/gem_parser.rb +28 -0
- data/lib/bundler/compact_index_client/updater.rb +13 -22
- data/lib/bundler/compact_index_client.rb +3 -3
- data/lib/bundler/current_ruby.rb +5 -4
- data/lib/bundler/definition.rb +193 -363
- data/lib/bundler/dep_proxy.rb +16 -9
- data/lib/bundler/dependency.rb +3 -10
- data/lib/bundler/digest.rb +71 -0
- data/lib/bundler/dsl.rb +71 -47
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/env.rb +1 -1
- data/lib/bundler/environment_preserver.rb +29 -2
- data/lib/bundler/errors.rb +20 -3
- data/lib/bundler/feature_flag.rb +0 -8
- data/lib/bundler/fetcher/base.rb +1 -1
- data/lib/bundler/fetcher/compact_index.rb +2 -2
- data/lib/bundler/fetcher/downloader.rb +10 -7
- data/lib/bundler/fetcher/index.rb +3 -5
- data/lib/bundler/fetcher.rb +7 -5
- data/lib/bundler/friendly_errors.rb +25 -43
- data/lib/bundler/gem_helper.rb +53 -31
- data/lib/bundler/gem_helpers.rb +36 -25
- data/lib/bundler/gem_version_promoter.rb +4 -4
- data/lib/bundler/graph.rb +1 -1
- data/lib/bundler/index.rb +9 -9
- data/lib/bundler/injector.rb +23 -5
- data/lib/bundler/inline.rb +3 -2
- data/lib/bundler/installer/gem_installer.rb +6 -19
- data/lib/bundler/installer/parallel_installer.rb +46 -25
- data/lib/bundler/installer/standalone.rb +30 -10
- data/lib/bundler/installer.rb +36 -56
- data/lib/bundler/lazy_specification.rb +62 -26
- data/lib/bundler/lockfile_generator.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +8 -34
- data/lib/bundler/man/.document +1 -0
- data/{man → lib/bundler/man}/bundle-add.1 +1 -1
- data/{man/bundle-add.ronn → lib/bundler/man/bundle-add.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-binstubs.1 +5 -3
- data/{man/bundle-binstubs.ronn → lib/bundler/man/bundle-binstubs.1.ronn} +2 -4
- data/{man → lib/bundler/man}/bundle-cache.1 +1 -1
- data/{man/bundle-cache.ronn → lib/bundler/man/bundle-cache.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-check.1 +1 -1
- data/{man/bundle-check.ronn → lib/bundler/man/bundle-check.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-clean.1 +1 -1
- data/{man/bundle-clean.ronn → lib/bundler/man/bundle-clean.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-config.1 +40 -41
- data/{man/bundle-config.ronn → lib/bundler/man/bundle-config.1.ronn} +50 -53
- data/{man → lib/bundler/man}/bundle-doctor.1 +1 -1
- data/{man/bundle-doctor.ronn → lib/bundler/man/bundle-doctor.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-exec.1 +1 -1
- data/{man/bundle-exec.ronn → lib/bundler/man/bundle-exec.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-gem.1 +38 -3
- data/{man/bundle-gem.ronn → lib/bundler/man/bundle-gem.1.ronn} +46 -7
- data/{man → lib/bundler/man}/bundle-info.1 +1 -1
- data/{man/bundle-info.ronn → lib/bundler/man/bundle-info.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-init.1 +1 -1
- data/{man/bundle-init.ronn → lib/bundler/man/bundle-init.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-inject.1 +1 -1
- data/{man/bundle-inject.ronn → lib/bundler/man/bundle-inject.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-install.1 +30 -3
- data/{man/bundle-install.ronn → lib/bundler/man/bundle-install.1.ronn} +25 -3
- data/{man → lib/bundler/man}/bundle-list.1 +7 -7
- data/{man/bundle-list.ronn → lib/bundler/man/bundle-list.1.ronn} +6 -6
- data/{man → lib/bundler/man}/bundle-lock.1 +1 -1
- data/{man/bundle-lock.ronn → lib/bundler/man/bundle-lock.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-open.1 +1 -1
- data/{man/bundle-open.ronn → lib/bundler/man/bundle-open.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-outdated.1 +1 -1
- data/{man/bundle-outdated.ronn → lib/bundler/man/bundle-outdated.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-platform.1 +1 -1
- data/{man/bundle-platform.ronn → lib/bundler/man/bundle-platform.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-pristine.1 +1 -1
- data/{man/bundle-pristine.ronn → lib/bundler/man/bundle-pristine.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-remove.1 +1 -1
- data/{man/bundle-remove.ronn → lib/bundler/man/bundle-remove.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-show.1 +1 -1
- data/{man/bundle-show.ronn → lib/bundler/man/bundle-show.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle-update.1 +4 -4
- data/{man/bundle-update.ronn → lib/bundler/man/bundle-update.1.ronn} +3 -3
- data/{man → lib/bundler/man}/bundle-viz.1 +1 -1
- data/{man/bundle-viz.ronn → lib/bundler/man/bundle-viz.1.ronn} +0 -0
- data/{man → lib/bundler/man}/bundle.1 +1 -1
- data/{man/bundle.ronn → lib/bundler/man/bundle.1.ronn} +0 -0
- data/{man → lib/bundler/man}/gemfile.5 +30 -4
- data/{man → lib/bundler/man}/gemfile.5.ronn +12 -4
- data/{man → lib/bundler/man}/index.txt +0 -0
- data/lib/bundler/mirror.rb +2 -2
- data/lib/bundler/plugin/api/source.rb +23 -1
- data/lib/bundler/plugin/dsl.rb +1 -1
- data/lib/bundler/plugin/index.rb +13 -1
- data/lib/bundler/plugin/installer/rubygems.rb +1 -1
- data/lib/bundler/plugin/installer.rb +11 -11
- data/lib/bundler/plugin/source_list.rb +5 -1
- data/lib/bundler/plugin.rb +56 -11
- data/lib/bundler/psyched_yaml.rb +0 -15
- data/lib/bundler/remote_specification.rb +5 -2
- data/lib/bundler/resolver/spec_group.rb +56 -53
- data/lib/bundler/resolver.rb +94 -128
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +96 -16
- data/lib/bundler/rubygems_gem_installer.rb +69 -8
- data/lib/bundler/rubygems_integration.rb +57 -72
- data/lib/bundler/runtime.rb +22 -25
- data/lib/bundler/settings.rb +142 -64
- data/lib/bundler/setup.rb +2 -2
- data/lib/bundler/shared_helpers.rb +5 -13
- data/lib/bundler/similarity_detector.rb +1 -1
- data/lib/bundler/source/git/git_proxy.rb +88 -84
- data/lib/bundler/source/git.rb +43 -23
- data/lib/bundler/source/metadata.rb +0 -4
- data/lib/bundler/source/path/installer.rb +10 -10
- data/lib/bundler/source/path.rb +10 -4
- data/lib/bundler/source/rubygems/remote.rb +1 -1
- data/lib/bundler/source/rubygems.rb +126 -116
- data/lib/bundler/source/rubygems_aggregate.rb +68 -0
- data/lib/bundler/source.rb +22 -1
- data/lib/bundler/source_list.rb +101 -63
- data/lib/bundler/source_map.rb +58 -0
- data/lib/bundler/spec_set.rb +26 -41
- data/lib/bundler/stub_specification.rb +25 -7
- data/lib/bundler/templates/Executable.bundler +6 -6
- data/lib/bundler/templates/Gemfile +1 -1
- data/lib/bundler/templates/gems.rb +1 -1
- data/lib/bundler/templates/newgem/CHANGELOG.md.tt +5 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/lib/bundler/templates/newgem/Gemfile.tt +12 -1
- data/lib/bundler/templates/newgem/README.md.tt +6 -5
- data/lib/bundler/templates/newgem/Rakefile.tt +23 -5
- data/lib/bundler/templates/newgem/bin/console.tt +1 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +27 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +4 -2
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +27 -17
- data/lib/bundler/templates/newgem/rubocop.yml.tt +13 -0
- data/lib/bundler/templates/newgem/sig/newgem.rbs.tt +8 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +2 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/ui/shell.rb +5 -5
- data/lib/bundler/uri_credentials_filter.rb +3 -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/delegates/specification_provider.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +11 -5
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +36 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +3 -3
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +12 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +49 -47
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +0 -1
- data/lib/bundler/vendor/net-http-persistent/README.rdoc +82 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +82 -189
- data/lib/bundler/vendor/thor/LICENSE.md +20 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +4 -2
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- 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/vendor/thor/lib/thor.rb +5 -13
- data/lib/bundler/vendor/tmpdir/lib/tmpdir.rb +154 -0
- 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/vendored_persistent.rb +0 -7
- data/lib/bundler/vendored_tmpdir.rb +4 -0
- data/lib/bundler/vendored_tsort.rb +4 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/worker.rb +20 -5
- data/lib/bundler/yaml_serializer.rb +1 -1
- data/lib/bundler.rb +52 -37
- metadata +90 -89
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +0 -66
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +0 -26
- data/man/bundle-add.1.txt +0 -58
- data/man/bundle-binstubs.1.txt +0 -48
- data/man/bundle-cache.1.txt +0 -78
- data/man/bundle-check.1.txt +0 -33
- data/man/bundle-clean.1.txt +0 -26
- data/man/bundle-config.1.txt +0 -528
- data/man/bundle-doctor.1.txt +0 -44
- data/man/bundle-exec.1.txt +0 -178
- data/man/bundle-gem.1.txt +0 -91
- data/man/bundle-info.1.txt +0 -21
- data/man/bundle-init.1.txt +0 -34
- data/man/bundle-inject.1.txt +0 -32
- data/man/bundle-install.1.txt +0 -401
- data/man/bundle-list.1.txt +0 -43
- data/man/bundle-lock.1.txt +0 -93
- data/man/bundle-open.1.txt +0 -29
- data/man/bundle-outdated.1.txt +0 -131
- data/man/bundle-platform.1.txt +0 -57
- data/man/bundle-pristine.1.txt +0 -44
- data/man/bundle-remove.1.txt +0 -34
- data/man/bundle-show.1.txt +0 -27
- data/man/bundle-update.1.txt +0 -390
- data/man/bundle-viz.1.txt +0 -39
- data/man/bundle.1.txt +0 -116
- data/man/gemfile.5.txt +0 -649
data/lib/bundler/cli/outdated.rb
CHANGED
@@ -3,18 +3,16 @@
|
|
3
3
|
module Bundler
|
4
4
|
class CLI::Outdated
|
5
5
|
attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict
|
6
|
-
attr_accessor :
|
6
|
+
attr_accessor :outdated_gems
|
7
7
|
|
8
8
|
def initialize(options, gems)
|
9
9
|
@options = options
|
10
10
|
@gems = gems
|
11
11
|
@sources = Array(options[:source])
|
12
12
|
|
13
|
-
@filter_options_patch = options.keys &
|
14
|
-
%w[filter-major filter-minor filter-patch]
|
13
|
+
@filter_options_patch = options.keys & %w[filter-major filter-minor filter-patch]
|
15
14
|
|
16
|
-
@
|
17
|
-
@outdated_gems_list = []
|
15
|
+
@outdated_gems = []
|
18
16
|
|
19
17
|
@options_include_groups = [:group, :groups].any? do |v|
|
20
18
|
options.keys.include?(v.to_s)
|
@@ -22,8 +20,7 @@ module Bundler
|
|
22
20
|
|
23
21
|
# the patch level options imply strict is also true. It wouldn't make
|
24
22
|
# sense otherwise.
|
25
|
-
@strict = options["filter-strict"] ||
|
26
|
-
Bundler::CLI::Common.patch_level_options(options).any?
|
23
|
+
@strict = options["filter-strict"] || Bundler::CLI::Common.patch_level_options(options).any?
|
27
24
|
end
|
28
25
|
|
29
26
|
def run
|
@@ -75,87 +72,67 @@ module Bundler
|
|
75
72
|
gemfile_specs + dependency_specs
|
76
73
|
end
|
77
74
|
|
78
|
-
specs.sort_by(&:name).each do |current_spec|
|
79
|
-
next
|
75
|
+
specs.sort_by(&:name).uniq(&:name).each do |current_spec|
|
76
|
+
next unless gems.empty? || gems.include?(current_spec.name)
|
80
77
|
|
81
|
-
dependency = current_dependencies[current_spec.name]
|
82
78
|
active_spec = retrieve_active_spec(definition, current_spec)
|
79
|
+
next unless active_spec
|
83
80
|
|
84
|
-
next
|
85
|
-
next if filter_options_patch.any? &&
|
86
|
-
!update_present_via_semver_portions(current_spec, active_spec, options)
|
81
|
+
next unless filter_options_patch.empty? || update_present_via_semver_portions(current_spec, active_spec, options)
|
87
82
|
|
88
83
|
gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
|
89
84
|
next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
|
90
|
-
|
85
|
+
|
86
|
+
dependency = current_dependencies[current_spec.name]
|
87
|
+
groups = ""
|
91
88
|
if dependency && !options[:parseable]
|
92
89
|
groups = dependency.groups.join(", ")
|
93
90
|
end
|
94
91
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
outdated_gems_by_groups[groups] << outdated_gems_list[-1]
|
92
|
+
outdated_gems << {
|
93
|
+
:active_spec => active_spec,
|
94
|
+
:current_spec => current_spec,
|
95
|
+
:dependency => dependency,
|
96
|
+
:groups => groups,
|
97
|
+
}
|
102
98
|
end
|
103
99
|
|
104
|
-
if
|
105
|
-
display_nothing_outdated_message
|
106
|
-
else
|
100
|
+
if outdated_gems.empty?
|
107
101
|
unless options[:parseable]
|
108
|
-
Bundler.ui.info(
|
102
|
+
Bundler.ui.info(nothing_outdated_message)
|
109
103
|
end
|
110
|
-
|
104
|
+
else
|
111
105
|
if options_include_groups
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
contains_group = if groups
|
116
|
-
groups.split(", ").include?(options[:group])
|
117
|
-
else
|
118
|
-
options[:group] == "group"
|
119
|
-
end
|
106
|
+
relevant_outdated_gems = outdated_gems.group_by {|g| g[:groups] }.sort.flat_map do |groups, gems|
|
107
|
+
contains_group = groups.split(", ").include?(options[:group])
|
108
|
+
next unless options[:groups] || contains_group
|
120
109
|
|
121
|
-
|
110
|
+
gems
|
111
|
+
end.compact
|
122
112
|
|
123
|
-
|
124
|
-
|
113
|
+
if options[:parseable]
|
114
|
+
relevant_outdated_gems.each do |gems|
|
115
|
+
print_gems(gems)
|
125
116
|
end
|
126
|
-
|
127
|
-
|
117
|
+
else
|
118
|
+
print_gems_table(relevant_outdated_gems)
|
128
119
|
end
|
120
|
+
elsif options[:parseable]
|
121
|
+
print_gems(outdated_gems)
|
129
122
|
else
|
130
|
-
|
123
|
+
print_gems_table(outdated_gems)
|
131
124
|
end
|
132
125
|
|
133
126
|
exit 1
|
134
127
|
end
|
135
128
|
end
|
136
129
|
|
137
|
-
|
130
|
+
private
|
138
131
|
|
139
132
|
def groups_text(group_text, groups)
|
140
133
|
"#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
|
141
134
|
end
|
142
135
|
|
143
|
-
def header_outdated_message
|
144
|
-
if options[:pre]
|
145
|
-
"Outdated gems included in the bundle (including pre-releases):"
|
146
|
-
else
|
147
|
-
"Outdated gems included in the bundle:"
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
def header_group_message(groups)
|
152
|
-
if groups
|
153
|
-
"===== #{groups_text("Group", groups)} ====="
|
154
|
-
else
|
155
|
-
"===== Without group ====="
|
156
|
-
end
|
157
|
-
end
|
158
|
-
|
159
136
|
def nothing_outdated_message
|
160
137
|
if filter_options_patch.any?
|
161
138
|
display = filter_options_patch.map do |o|
|
@@ -169,23 +146,16 @@ module Bundler
|
|
169
146
|
end
|
170
147
|
|
171
148
|
def retrieve_active_spec(definition, current_spec)
|
172
|
-
|
173
|
-
|
174
|
-
else
|
175
|
-
active_specs = definition.find_indexed_specs(current_spec)
|
176
|
-
if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
|
177
|
-
active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
178
|
-
end
|
179
|
-
active_spec = active_specs.last
|
180
|
-
end
|
149
|
+
active_spec = definition.resolve.find_by_name_and_platform(current_spec.name, current_spec.platform)
|
150
|
+
return unless active_spec
|
181
151
|
|
182
|
-
active_spec
|
183
|
-
end
|
152
|
+
return active_spec if strict
|
184
153
|
|
185
|
-
|
186
|
-
|
187
|
-
|
154
|
+
active_specs = active_spec.source.specs.search(current_spec.name).select {|spec| spec.match_platform(current_spec.platform) }.sort_by(&:version)
|
155
|
+
if !current_spec.version.prerelease? && !options[:pre] && active_specs.size > 1
|
156
|
+
active_specs.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
|
188
157
|
end
|
158
|
+
active_specs.last
|
189
159
|
end
|
190
160
|
|
191
161
|
def print_gems(gems_list)
|
@@ -199,6 +169,19 @@ module Bundler
|
|
199
169
|
end
|
200
170
|
end
|
201
171
|
|
172
|
+
def print_gems_table(gems_list)
|
173
|
+
data = gems_list.map do |gem|
|
174
|
+
gem_column_for(
|
175
|
+
gem[:current_spec],
|
176
|
+
gem[:active_spec],
|
177
|
+
gem[:dependency],
|
178
|
+
gem[:groups],
|
179
|
+
)
|
180
|
+
end
|
181
|
+
|
182
|
+
print_indented([table_header] + data)
|
183
|
+
end
|
184
|
+
|
202
185
|
def print_gem(current_spec, active_spec, dependency, groups)
|
203
186
|
spec_version = "#{active_spec.version}#{active_spec.git_version}"
|
204
187
|
spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
|
@@ -213,7 +196,7 @@ module Bundler
|
|
213
196
|
|
214
197
|
output_message = if options[:parseable]
|
215
198
|
spec_outdated_info.to_s
|
216
|
-
elsif options_include_groups ||
|
199
|
+
elsif options_include_groups || groups.empty?
|
217
200
|
" * #{spec_outdated_info}"
|
218
201
|
else
|
219
202
|
" * #{spec_outdated_info} in #{groups_text("group", groups)}"
|
@@ -222,14 +205,22 @@ module Bundler
|
|
222
205
|
Bundler.ui.info output_message.rstrip
|
223
206
|
end
|
224
207
|
|
208
|
+
def gem_column_for(current_spec, active_spec, dependency, groups)
|
209
|
+
current_version = "#{current_spec.version}#{current_spec.git_version}"
|
210
|
+
spec_version = "#{active_spec.version}#{active_spec.git_version}"
|
211
|
+
dependency = dependency.requirement if dependency
|
212
|
+
|
213
|
+
ret_val = [active_spec.name, current_version, spec_version, dependency.to_s, groups.to_s]
|
214
|
+
ret_val << active_spec.loaded_from.to_s if Bundler.ui.debug?
|
215
|
+
ret_val
|
216
|
+
end
|
217
|
+
|
225
218
|
def check_for_deployment_mode!
|
226
219
|
return unless Bundler.frozen_bundle?
|
227
|
-
suggested_command = if Bundler.settings.locations("frozen")[:global]
|
220
|
+
suggested_command = if Bundler.settings.locations("frozen").keys.&([:global, :local]).any?
|
228
221
|
"bundle config unset frozen"
|
229
222
|
elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
|
230
223
|
"bundle config unset deployment"
|
231
|
-
else
|
232
|
-
"bundle install --no-deployment"
|
233
224
|
end
|
234
225
|
raise ProductionError, "You are trying to check outdated gems in " \
|
235
226
|
"deployment mode. Run `bundle outdated` elsewhere.\n" \
|
@@ -266,5 +257,34 @@ module Bundler
|
|
266
257
|
version_section = spec.version.segments[version_portion_index, 1]
|
267
258
|
version_section.to_a[0].to_i
|
268
259
|
end
|
260
|
+
|
261
|
+
def print_indented(matrix)
|
262
|
+
header = matrix[0]
|
263
|
+
data = matrix[1..-1]
|
264
|
+
|
265
|
+
column_sizes = Array.new(header.size) do |index|
|
266
|
+
matrix.max_by {|row| row[index].length }[index].length
|
267
|
+
end
|
268
|
+
|
269
|
+
Bundler.ui.info justify(header, column_sizes)
|
270
|
+
|
271
|
+
data.sort_by! {|row| row[0] }
|
272
|
+
|
273
|
+
data.each do |row|
|
274
|
+
Bundler.ui.info justify(row, column_sizes)
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
def table_header
|
279
|
+
header = ["Gem", "Current", "Latest", "Requested", "Groups"]
|
280
|
+
header << "Path" if Bundler.ui.debug?
|
281
|
+
header
|
282
|
+
end
|
283
|
+
|
284
|
+
def justify(row, sizes)
|
285
|
+
row.each_with_index.map do |element, index|
|
286
|
+
element.ljust(sizes[index])
|
287
|
+
end.join(" ").strip + "\n"
|
288
|
+
end
|
269
289
|
end
|
270
290
|
end
|
data/lib/bundler/cli/plugin.rb
CHANGED
@@ -23,6 +23,16 @@ module Bundler
|
|
23
23
|
Bundler::Plugin.install(plugins, options)
|
24
24
|
end
|
25
25
|
|
26
|
+
desc "uninstall PLUGINS", "Uninstall the plugins"
|
27
|
+
long_desc <<-D
|
28
|
+
Uninstall given list of plugins. To uninstall all the plugins, use -all option.
|
29
|
+
D
|
30
|
+
method_option "all", :type => :boolean, :default => nil, :banner =>
|
31
|
+
"Uninstall all the installed plugins. If no plugin is installed, then it does nothing."
|
32
|
+
def uninstall(*plugins)
|
33
|
+
Bundler::Plugin.uninstall(plugins, options)
|
34
|
+
end
|
35
|
+
|
26
36
|
desc "list", "List the installed plugins and available commands"
|
27
37
|
def list
|
28
38
|
Bundler::Plugin.list
|
data/lib/bundler/cli/pristine.rb
CHANGED
@@ -29,6 +29,11 @@ module Bundler
|
|
29
29
|
|
30
30
|
FileUtils.rm_rf spec.full_gem_path
|
31
31
|
when Source::Git
|
32
|
+
if source.local?
|
33
|
+
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overridden.")
|
34
|
+
next
|
35
|
+
end
|
36
|
+
|
32
37
|
source.remote!
|
33
38
|
if extension_cache_path = source.extension_cache_path(spec)
|
34
39
|
FileUtils.rm_rf extension_cache_path
|
data/lib/bundler/cli/remove.rb
CHANGED
@@ -11,8 +11,7 @@ module Bundler
|
|
11
11
|
raise InvalidOption, "Please specify gems to remove." if @gems.empty?
|
12
12
|
|
13
13
|
Injector.remove(@gems, {})
|
14
|
-
|
15
|
-
Installer.install(Bundler.root, Bundler.definition) if @options["install"]
|
14
|
+
Installer.install(Bundler.root, Bundler.definition)
|
16
15
|
end
|
17
16
|
end
|
18
17
|
end
|
data/lib/bundler/cli/show.rb
CHANGED
data/lib/bundler/cli/update.rb
CHANGED
@@ -9,7 +9,7 @@ module Bundler
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
-
Bundler.ui.level = "
|
12
|
+
Bundler.ui.level = "warn" if options[:quiet]
|
13
13
|
|
14
14
|
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
|
15
15
|
|
@@ -27,9 +27,14 @@ module Bundler
|
|
27
27
|
raise InvalidOption, "Cannot specify --all along with specific options."
|
28
28
|
end
|
29
29
|
|
30
|
+
conservative = options[:conservative]
|
31
|
+
|
30
32
|
if full_update
|
31
|
-
|
32
|
-
|
33
|
+
if conservative
|
34
|
+
Bundler.definition(:conservative => conservative)
|
35
|
+
else
|
36
|
+
Bundler.definition(true)
|
37
|
+
end
|
33
38
|
else
|
34
39
|
unless Bundler.default_lockfile.exist?
|
35
40
|
raise GemfileLockNotFound, "This Bundle hasn't been installed yet. " \
|
@@ -43,7 +48,7 @@ module Bundler
|
|
43
48
|
end
|
44
49
|
|
45
50
|
Bundler.definition(:gems => gems, :sources => sources, :ruby => options[:ruby],
|
46
|
-
:
|
51
|
+
:conservative => conservative,
|
47
52
|
:bundler => options[:bundler])
|
48
53
|
end
|
49
54
|
|
@@ -61,7 +66,7 @@ module Bundler
|
|
61
66
|
|
62
67
|
if locked_gems = Bundler.definition.locked_gems
|
63
68
|
previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
|
64
|
-
h[s.name] = { :spec => s, :version => s.version, :source => s.source.
|
69
|
+
h[s.name] = { :spec => s, :version => s.version, :source => s.source.identifier }
|
65
70
|
h
|
66
71
|
end
|
67
72
|
end
|
@@ -82,7 +87,7 @@ module Bundler
|
|
82
87
|
locked_spec = locked_info[:spec]
|
83
88
|
new_spec = Bundler.definition.specs[name].first
|
84
89
|
unless new_spec
|
85
|
-
|
90
|
+
unless locked_spec.match_platform(Bundler.local_platform)
|
86
91
|
Bundler.ui.warn "Bundler attempted to update #{name} but it was not considered because it is for a different platform from the current one"
|
87
92
|
end
|
88
93
|
|
@@ -90,7 +95,7 @@ module Bundler
|
|
90
95
|
end
|
91
96
|
|
92
97
|
locked_source = locked_info[:source]
|
93
|
-
new_source = new_spec.source.
|
98
|
+
new_source = new_spec.source.identifier
|
94
99
|
next if locked_source != new_source
|
95
100
|
|
96
101
|
new_version = new_spec.version
|
@@ -106,6 +111,8 @@ module Bundler
|
|
106
111
|
Bundler.ui.confirm "Bundle updated!"
|
107
112
|
Bundler::CLI::Common.output_without_groups_message(:update)
|
108
113
|
Bundler::CLI::Common.output_post_install_messages installer.post_install_messages
|
114
|
+
|
115
|
+
Bundler::CLI::Common.output_fund_metadata_summary
|
109
116
|
end
|
110
117
|
end
|
111
118
|
end
|