bundler 2.4.21 → 2.5.0
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 +74 -0
- data/README.md +1 -2
- data/bundler.gemspec +4 -2
- data/exe/bundle +1 -10
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/capistrano.rb +1 -1
- data/lib/bundler/checksum.rb +245 -0
- data/lib/bundler/ci_detector.rb +75 -0
- data/lib/bundler/cli/add.rb +3 -3
- data/lib/bundler/cli/binstubs.rb +4 -4
- data/lib/bundler/cli/cache.rb +1 -1
- data/lib/bundler/cli/check.rb +1 -1
- data/lib/bundler/cli/common.rb +9 -1
- data/lib/bundler/cli/config.rb +8 -7
- data/lib/bundler/cli/console.rb +3 -2
- data/lib/bundler/cli/doctor.rb +2 -2
- data/lib/bundler/cli/exec.rb +1 -1
- data/lib/bundler/cli/gem.rb +31 -23
- data/lib/bundler/cli/info.rb +2 -13
- data/lib/bundler/cli/install.rb +5 -4
- data/lib/bundler/cli/issue.rb +1 -1
- data/lib/bundler/cli/lock.rb +4 -4
- data/lib/bundler/cli/open.rb +1 -1
- data/lib/bundler/cli/outdated.rb +6 -6
- data/lib/bundler/cli/plugin.rb +7 -14
- data/lib/bundler/cli/pristine.rb +38 -30
- data/lib/bundler/cli/show.rb +2 -2
- data/lib/bundler/cli/update.rb +5 -5
- data/lib/bundler/cli.rb +215 -263
- data/lib/bundler/compact_index_client/cache.rb +29 -9
- data/lib/bundler/compact_index_client/cache_file.rb +153 -0
- data/lib/bundler/compact_index_client/gem_parser.rb +7 -3
- data/lib/bundler/compact_index_client/updater.rb +79 -81
- data/lib/bundler/compact_index_client.rb +14 -7
- data/lib/bundler/constants.rb +1 -1
- data/lib/bundler/current_ruby.rb +5 -21
- data/lib/bundler/definition.rb +43 -16
- data/lib/bundler/dependency.rb +16 -12
- data/lib/bundler/digest.rb +2 -2
- data/lib/bundler/dsl.rb +43 -25
- data/lib/bundler/endpoint_specification.rb +6 -2
- data/lib/bundler/env.rb +1 -3
- data/lib/bundler/errors.rb +58 -0
- data/lib/bundler/fetcher/base.rb +3 -1
- data/lib/bundler/fetcher/compact_index.rb +4 -4
- data/lib/bundler/fetcher/downloader.rb +13 -11
- data/lib/bundler/fetcher/gem_remote_fetcher.rb +16 -0
- data/lib/bundler/fetcher/index.rb +1 -1
- data/lib/bundler/fetcher.rb +28 -25
- data/lib/bundler/friendly_errors.rb +5 -5
- data/lib/bundler/gem_helper.rb +1 -1
- data/lib/bundler/gem_helpers.rb +12 -2
- data/lib/bundler/graph.rb +9 -9
- data/lib/bundler/index.rb +1 -2
- data/lib/bundler/injector.rb +1 -1
- data/lib/bundler/inline.rb +3 -3
- data/lib/bundler/installer/gem_installer.rb +10 -10
- data/lib/bundler/installer/parallel_installer.rb +16 -8
- data/lib/bundler/installer/standalone.rb +2 -3
- data/lib/bundler/installer.rb +9 -9
- data/lib/bundler/lazy_specification.rb +28 -17
- data/lib/bundler/lockfile_generator.rb +9 -0
- data/lib/bundler/lockfile_parser.rb +81 -10
- data/lib/bundler/man/bundle-add.1 +3 -26
- data/lib/bundler/man/bundle-binstubs.1 +4 -16
- data/lib/bundler/man/bundle-cache.1 +3 -24
- data/lib/bundler/man/bundle-check.1 +3 -12
- data/lib/bundler/man/bundle-clean.1 +3 -10
- data/lib/bundler/man/bundle-config.1 +20 -211
- data/lib/bundler/man/bundle-config.1.ronn +6 -0
- data/lib/bundler/man/bundle-console.1 +4 -22
- data/lib/bundler/man/bundle-doctor.1 +4 -18
- data/lib/bundler/man/bundle-exec.1 +12 -73
- data/lib/bundler/man/bundle-gem.1 +13 -49
- data/lib/bundler/man/bundle-help.1 +3 -7
- data/lib/bundler/man/bundle-info.1 +3 -9
- data/lib/bundler/man/bundle-init.1 +3 -12
- data/lib/bundler/man/bundle-inject.1 +6 -19
- data/lib/bundler/man/bundle-install.1 +27 -125
- data/lib/bundler/man/bundle-install.1.ronn +1 -0
- data/lib/bundler/man/bundle-list.1 +4 -19
- data/lib/bundler/man/bundle-lock.1 +5 -29
- data/lib/bundler/man/bundle-open.1 +7 -27
- data/lib/bundler/man/bundle-outdated.1 +3 -55
- data/lib/bundler/man/bundle-outdated.1.ronn +1 -0
- data/lib/bundler/man/bundle-platform.1 +5 -27
- data/lib/bundler/man/bundle-plugin.1 +3 -29
- data/lib/bundler/man/bundle-pristine.1 +5 -16
- data/lib/bundler/man/bundle-remove.1 +4 -14
- data/lib/bundler/man/bundle-show.1 +3 -10
- data/lib/bundler/man/bundle-update.1 +18 -137
- data/lib/bundler/man/bundle-version.1 +3 -16
- data/lib/bundler/man/bundle-viz.1 +4 -16
- data/lib/bundler/man/bundle.1 +5 -44
- data/lib/bundler/man/gemfile.5 +24 -301
- data/lib/bundler/man/gemfile.5.ronn +4 -0
- data/lib/bundler/match_metadata.rb +4 -0
- data/lib/bundler/match_platform.rb +1 -1
- data/lib/bundler/plugin/api/source.rb +3 -2
- data/lib/bundler/plugin/index.rb +8 -0
- data/lib/bundler/plugin/installer.rb +1 -1
- data/lib/bundler/plugin.rb +12 -5
- data/lib/bundler/resolver/base.rb +1 -1
- data/lib/bundler/resolver/incompatibility.rb +1 -1
- data/lib/bundler/resolver/spec_group.rb +1 -4
- data/lib/bundler/resolver.rb +16 -16
- data/lib/bundler/ruby_dsl.rb +20 -12
- data/lib/bundler/ruby_version.rb +1 -1
- data/lib/bundler/rubygems_ext.rb +27 -54
- data/lib/bundler/rubygems_gem_installer.rb +23 -58
- data/lib/bundler/rubygems_integration.rb +25 -94
- data/lib/bundler/runtime.rb +2 -2
- data/lib/bundler/self_manager.rb +23 -7
- data/lib/bundler/settings.rb +27 -7
- data/lib/bundler/setup.rb +4 -1
- data/lib/bundler/shared_helpers.rb +35 -13
- data/lib/bundler/source/git/git_proxy.rb +22 -14
- data/lib/bundler/source/git.rb +4 -3
- data/lib/bundler/source/metadata.rb +16 -16
- data/lib/bundler/source/path.rb +7 -6
- data/lib/bundler/source/rubygems.rb +21 -14
- data/lib/bundler/source.rb +2 -0
- data/lib/bundler/spec_set.rb +43 -12
- data/lib/bundler/stub_specification.rb +1 -0
- data/lib/bundler/templates/Executable.bundler +1 -1
- data/lib/bundler/templates/newgem/README.md.tt +3 -3
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -6
- data/lib/bundler/templates/newgem/ext/newgem/Cargo.toml.tt +1 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +1 -1
- data/lib/bundler/templates/newgem/standard.yml.tt +1 -1
- data/lib/bundler/ui/shell.rb +2 -2
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +1 -1
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +53 -6
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +8 -20
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +4 -3
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +23 -11
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +1 -1
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +36 -36
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +3 -2
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +8 -10
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +15 -4
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +15 -15
- data/lib/bundler/vendor/thor/lib/thor/base.rb +140 -14
- data/lib/bundler/vendor/thor/lib/thor/command.rb +13 -4
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +4 -0
- data/lib/bundler/vendor/thor/lib/thor/error.rb +16 -25
- data/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +20 -1
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +33 -17
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +27 -8
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +44 -6
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +40 -30
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +26 -150
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +4 -46
- data/lib/bundler/vendor/thor/lib/thor/shell/column_printer.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -45
- data/lib/bundler/vendor/thor/lib/thor/shell/lcs_diff.rb +49 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/table_printer.rb +134 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/terminal.rb +42 -0
- data/lib/bundler/vendor/thor/lib/thor/shell/wrapped_printer.rb +38 -0
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +8 -7
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +155 -8
- data/lib/bundler/vendor/tsort/lib/tsort.rb +3 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +256 -132
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +95 -31
- data/lib/bundler/vendor/uri/lib/uri/version.rb +1 -1
- data/lib/bundler/vendored_net_http.rb +8 -0
- data/lib/bundler/vendored_persistent.rb +0 -4
- data/lib/bundler/vendored_timeout.rb +8 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +1 -1
- data/lib/bundler/yaml_serializer.rb +9 -4
- data/lib/bundler.rb +38 -35
- metadata +16 -5
data/lib/bundler/cli/gem.rb
CHANGED
|
@@ -11,7 +11,7 @@ module Bundler
|
|
|
11
11
|
class CLI::Gem
|
|
12
12
|
TEST_FRAMEWORK_VERSIONS = {
|
|
13
13
|
"rspec" => "3.0",
|
|
14
|
-
"minitest" => "5.
|
|
14
|
+
"minitest" => "5.16",
|
|
15
15
|
"test-unit" => "3.0",
|
|
16
16
|
}.freeze
|
|
17
17
|
|
|
@@ -59,23 +59,23 @@ module Bundler
|
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
config = {
|
|
62
|
-
:
|
|
63
|
-
:
|
|
64
|
-
:
|
|
65
|
-
:
|
|
66
|
-
:
|
|
67
|
-
:
|
|
68
|
-
:
|
|
69
|
-
:
|
|
70
|
-
:
|
|
71
|
-
:
|
|
72
|
-
:
|
|
73
|
-
:
|
|
74
|
-
:
|
|
75
|
-
:
|
|
76
|
-
:
|
|
77
|
-
:
|
|
78
|
-
:
|
|
62
|
+
name: name,
|
|
63
|
+
underscored_name: underscored_name,
|
|
64
|
+
namespaced_path: namespaced_path,
|
|
65
|
+
makefile_path: "#{underscored_name}/#{underscored_name}",
|
|
66
|
+
constant_name: constant_name,
|
|
67
|
+
constant_array: constant_array,
|
|
68
|
+
author: git_author_name.empty? ? "TODO: Write your name" : git_author_name,
|
|
69
|
+
email: git_user_email.empty? ? "TODO: Write your email address" : git_user_email,
|
|
70
|
+
test: options[:test],
|
|
71
|
+
ext: extension,
|
|
72
|
+
exe: options[:exe],
|
|
73
|
+
bundler_version: bundler_dependency_version,
|
|
74
|
+
git: use_git,
|
|
75
|
+
github_username: github_username.empty? ? "[USERNAME]" : github_username,
|
|
76
|
+
required_ruby_version: required_ruby_version,
|
|
77
|
+
rust_builder_required_rubygems_version: rust_builder_required_rubygems_version,
|
|
78
|
+
minitest_constant_name: minitest_constant_name,
|
|
79
79
|
}
|
|
80
80
|
ensure_safe_gem_name(name, constant_array)
|
|
81
81
|
|
|
@@ -137,10 +137,13 @@ module Bundler
|
|
|
137
137
|
case config[:ci]
|
|
138
138
|
when "github"
|
|
139
139
|
templates.merge!("github/workflows/main.yml.tt" => ".github/workflows/main.yml")
|
|
140
|
+
config[:ci_config_path] = ".github "
|
|
140
141
|
when "gitlab"
|
|
141
142
|
templates.merge!("gitlab-ci.yml.tt" => ".gitlab-ci.yml")
|
|
143
|
+
config[:ci_config_path] = ".gitlab-ci.yml "
|
|
142
144
|
when "circle"
|
|
143
145
|
templates.merge!("circleci/config.yml.tt" => ".circleci/config.yml")
|
|
146
|
+
config[:ci_config_path] = ".circleci "
|
|
144
147
|
end
|
|
145
148
|
|
|
146
149
|
if ask_and_set(:mit, "Do you want to license your code permissively under the MIT license?",
|
|
@@ -233,7 +236,7 @@ module Bundler
|
|
|
233
236
|
end
|
|
234
237
|
|
|
235
238
|
if use_git
|
|
236
|
-
IO.popen(%w[git add .], { :
|
|
239
|
+
IO.popen(%w[git add .], { chdir: target }, &:read)
|
|
237
240
|
end
|
|
238
241
|
|
|
239
242
|
# Open gemspec in editor
|
|
@@ -346,7 +349,7 @@ module Bundler
|
|
|
346
349
|
Bundler.ui.confirm "Do you want to add a code linter and formatter to your gem? " \
|
|
347
350
|
"Supported Linters:\n" \
|
|
348
351
|
"* RuboCop: https://rubocop.org\n" \
|
|
349
|
-
"* Standard: https://github.com/
|
|
352
|
+
"* Standard: https://github.com/standardrb/standard\n" \
|
|
350
353
|
"\n"
|
|
351
354
|
Bundler.ui.info hint_text("linter")
|
|
352
355
|
|
|
@@ -377,15 +380,20 @@ module Bundler
|
|
|
377
380
|
def deprecated_rubocop_option
|
|
378
381
|
if !options[:rubocop].nil?
|
|
379
382
|
if options[:rubocop]
|
|
380
|
-
Bundler::SharedHelpers.major_deprecation 2,
|
|
383
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
|
384
|
+
"--rubocop is deprecated, use --linter=rubocop",
|
|
385
|
+
removed_message: "--rubocop has been removed, use --linter=rubocop"
|
|
381
386
|
"rubocop"
|
|
382
387
|
else
|
|
383
|
-
Bundler::SharedHelpers.major_deprecation 2,
|
|
388
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
|
389
|
+
"--no-rubocop is deprecated, use --linter",
|
|
390
|
+
removed_message: "--no-rubocop has been removed, use --linter"
|
|
384
391
|
false
|
|
385
392
|
end
|
|
386
393
|
elsif !Bundler.settings["gem.rubocop"].nil?
|
|
387
394
|
Bundler::SharedHelpers.major_deprecation 2,
|
|
388
|
-
"config gem.rubocop is deprecated; we've updated your config to use gem.linter instead"
|
|
395
|
+
"config gem.rubocop is deprecated; we've updated your config to use gem.linter instead",
|
|
396
|
+
removed_message: "config gem.rubocop has been removed; we've updated your config to use gem.linter instead"
|
|
389
397
|
Bundler.settings["gem.rubocop"] ? "rubocop" : false
|
|
390
398
|
end
|
|
391
399
|
end
|
data/lib/bundler/cli/info.rb
CHANGED
|
@@ -25,19 +25,8 @@ module Bundler
|
|
|
25
25
|
|
|
26
26
|
private
|
|
27
27
|
|
|
28
|
-
def spec_for_gem(
|
|
29
|
-
|
|
30
|
-
spec || default_gem_spec(gem_name) || Bundler::CLI::Common.select_spec(gem_name, :regex_match)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def default_gem_spec(gem_name)
|
|
34
|
-
return unless Gem::Specification.respond_to?(:find_all_by_name)
|
|
35
|
-
gem_spec = Gem::Specification.find_all_by_name(gem_name).last
|
|
36
|
-
gem_spec if gem_spec&.default_gem?
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def spec_not_found(gem_name)
|
|
40
|
-
raise GemNotFound, Bundler::CLI::Common.gem_not_found_message(gem_name, Bundler.definition.dependencies)
|
|
28
|
+
def spec_for_gem(name)
|
|
29
|
+
Bundler::CLI::Common.select_spec(name, :regex_match)
|
|
41
30
|
end
|
|
42
31
|
|
|
43
32
|
def print_gem_version(spec)
|
data/lib/bundler/cli/install.rb
CHANGED
|
@@ -51,7 +51,8 @@ module Bundler
|
|
|
51
51
|
|
|
52
52
|
if options["binstubs"]
|
|
53
53
|
Bundler::SharedHelpers.major_deprecation 2,
|
|
54
|
-
"The --binstubs option will be removed in favor of `bundle binstubs --all`"
|
|
54
|
+
"The --binstubs option will be removed in favor of `bundle binstubs --all`",
|
|
55
|
+
removed_message: "The --binstubs option have been removed in favor of `bundle binstubs --all`"
|
|
55
56
|
end
|
|
56
57
|
|
|
57
58
|
Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
|
|
@@ -61,7 +62,7 @@ module Bundler
|
|
|
61
62
|
|
|
62
63
|
installer = Installer.install(Bundler.root, definition, options)
|
|
63
64
|
|
|
64
|
-
Bundler.settings.temporary(:
|
|
65
|
+
Bundler.settings.temporary(cache_all_platforms: options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
|
|
65
66
|
Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
|
|
66
67
|
end
|
|
67
68
|
|
|
@@ -95,7 +96,7 @@ module Bundler
|
|
|
95
96
|
def warn_if_root
|
|
96
97
|
return if Bundler.settings[:silence_root_warning] || Gem.win_platform? || !Process.uid.zero?
|
|
97
98
|
Bundler.ui.warn "Don't run Bundler as root. Installing your bundle as root " \
|
|
98
|
-
"will break this application for all non-root users on this machine.", :
|
|
99
|
+
"will break this application for all non-root users on this machine.", wrap: true
|
|
99
100
|
end
|
|
100
101
|
|
|
101
102
|
def dependencies_count_for(definition)
|
|
@@ -148,7 +149,7 @@ module Bundler
|
|
|
148
149
|
Bundler.settings.set_command_option_if_given :path, options[:path]
|
|
149
150
|
|
|
150
151
|
if options["standalone"] && Bundler.settings[:path].nil? && !options["local"]
|
|
151
|
-
Bundler.settings.temporary(:
|
|
152
|
+
Bundler.settings.temporary(path_relative_to_cwd: false) do
|
|
152
153
|
Bundler.settings.set_command_option :path, "bundle"
|
|
153
154
|
end
|
|
154
155
|
end
|
data/lib/bundler/cli/issue.rb
CHANGED
data/lib/bundler/cli/lock.rb
CHANGED
|
@@ -26,14 +26,14 @@ module Bundler
|
|
|
26
26
|
|
|
27
27
|
if update.is_a?(Array) # unlocking specific gems
|
|
28
28
|
Bundler::CLI::Common.ensure_all_gems_in_lockfile!(update)
|
|
29
|
-
update = { :
|
|
29
|
+
update = { gems: update, conservative: conservative }
|
|
30
30
|
elsif update && conservative
|
|
31
|
-
update = { :
|
|
31
|
+
update = { conservative: conservative }
|
|
32
32
|
elsif update && bundler
|
|
33
|
-
update = { :
|
|
33
|
+
update = { bundler: bundler }
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
Bundler.settings.temporary(:
|
|
36
|
+
Bundler.settings.temporary(frozen: false) do
|
|
37
37
|
definition = Bundler.definition(update)
|
|
38
38
|
|
|
39
39
|
Bundler::CLI::Common.configure_gem_version_promoter(definition, options) if options[:update]
|
data/lib/bundler/cli/open.rb
CHANGED
|
@@ -21,7 +21,7 @@ module Bundler
|
|
|
21
21
|
require "shellwords"
|
|
22
22
|
command = Shellwords.split(editor) << File.join([root_path, path].compact)
|
|
23
23
|
Bundler.with_original_env do
|
|
24
|
-
system(*command, { :
|
|
24
|
+
system(*command, { chdir: root_path })
|
|
25
25
|
end || Bundler.ui.info("Could not run '#{command.join(" ")}'")
|
|
26
26
|
end
|
|
27
27
|
end
|
data/lib/bundler/cli/outdated.rb
CHANGED
|
@@ -41,12 +41,12 @@ module Bundler
|
|
|
41
41
|
# We're doing a full update
|
|
42
42
|
Bundler.definition(true)
|
|
43
43
|
else
|
|
44
|
-
Bundler.definition(:
|
|
44
|
+
Bundler.definition(gems: gems, sources: sources)
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
Bundler::CLI::Common.configure_gem_version_promoter(
|
|
48
48
|
Bundler.definition,
|
|
49
|
-
options.merge(:
|
|
49
|
+
options.merge(strict: @strict)
|
|
50
50
|
)
|
|
51
51
|
|
|
52
52
|
definition_resolution = proc do
|
|
@@ -90,10 +90,10 @@ module Bundler
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
outdated_gems << {
|
|
93
|
-
:
|
|
94
|
-
:
|
|
95
|
-
:
|
|
96
|
-
:
|
|
93
|
+
active_spec: active_spec,
|
|
94
|
+
current_spec: current_spec,
|
|
95
|
+
dependency: dependency,
|
|
96
|
+
groups: groups,
|
|
97
97
|
}
|
|
98
98
|
end
|
|
99
99
|
|
data/lib/bundler/cli/plugin.rb
CHANGED
|
@@ -7,18 +7,12 @@ module Bundler
|
|
|
7
7
|
long_desc <<-D
|
|
8
8
|
Install plugins either from the rubygems source provided (with --source option) or from a git source provided with --git (for remote repos) or --local_git (for local repos). If no sources are provided, it uses Gem.sources
|
|
9
9
|
D
|
|
10
|
-
method_option "source", :
|
|
11
|
-
|
|
12
|
-
method_option "
|
|
13
|
-
|
|
14
|
-
method_option "
|
|
15
|
-
|
|
16
|
-
method_option "local_git", :type => :string, :default => nil, :banner =>
|
|
17
|
-
"Path of the local git repo to fetch from"
|
|
18
|
-
method_option "branch", :type => :string, :default => nil, :banner =>
|
|
19
|
-
"The git branch to checkout"
|
|
20
|
-
method_option "ref", :type => :string, :default => nil, :banner =>
|
|
21
|
-
"The git revision to check out"
|
|
10
|
+
method_option "source", type: :string, default: nil, banner: "URL of the RubyGems source to fetch the plugin from"
|
|
11
|
+
method_option "version", type: :string, default: nil, banner: "The version of the plugin to fetch"
|
|
12
|
+
method_option "git", type: :string, default: nil, banner: "URL of the git repo to fetch from"
|
|
13
|
+
method_option "local_git", type: :string, default: nil, banner: "Path of the local git repo to fetch from"
|
|
14
|
+
method_option "branch", type: :string, default: nil, banner: "The git branch to checkout"
|
|
15
|
+
method_option "ref", type: :string, default: nil, banner: "The git revision to check out"
|
|
22
16
|
def install(*plugins)
|
|
23
17
|
Bundler::Plugin.install(plugins, options)
|
|
24
18
|
end
|
|
@@ -27,8 +21,7 @@ module Bundler
|
|
|
27
21
|
long_desc <<-D
|
|
28
22
|
Uninstall given list of plugins. To uninstall all the plugins, use -all option.
|
|
29
23
|
D
|
|
30
|
-
method_option "all", :
|
|
31
|
-
"Uninstall all the installed plugins. If no plugin is installed, then it does nothing."
|
|
24
|
+
method_option "all", type: :boolean, default: nil, banner: "Uninstall all the installed plugins. If no plugin is installed, then it does nothing."
|
|
32
25
|
def uninstall(*plugins)
|
|
33
26
|
Bundler::Plugin.uninstall(plugins, options)
|
|
34
27
|
end
|
data/lib/bundler/cli/pristine.rb
CHANGED
|
@@ -12,40 +12,48 @@ module Bundler
|
|
|
12
12
|
definition.validate_runtime!
|
|
13
13
|
installer = Bundler::Installer.new(Bundler.root, definition)
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
ProcessLock.lock do
|
|
16
|
+
installed_specs = definition.specs.reject do |spec|
|
|
17
|
+
next if spec.name == "bundler" # Source::Rubygems doesn't install bundler
|
|
18
|
+
next if !@gems.empty? && !@gems.include?(spec.name)
|
|
19
|
+
|
|
20
|
+
gem_name = "#{spec.name} (#{spec.version}#{spec.git_version})"
|
|
21
|
+
gem_name += " (#{spec.platform})" if !spec.platform.nil? && spec.platform != Gem::Platform::RUBY
|
|
22
|
+
|
|
23
|
+
case source = spec.source
|
|
24
|
+
when Source::Rubygems
|
|
25
|
+
cached_gem = spec.cache_file
|
|
26
|
+
unless File.exist?(cached_gem)
|
|
27
|
+
Bundler.ui.error("Failed to pristine #{gem_name}. Cached gem #{cached_gem} does not exist.")
|
|
28
|
+
next
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
FileUtils.rm_rf spec.full_gem_path
|
|
32
|
+
when Source::Git
|
|
33
|
+
if source.local?
|
|
34
|
+
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overridden.")
|
|
35
|
+
next
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
source.remote!
|
|
39
|
+
if extension_cache_path = source.extension_cache_path(spec)
|
|
40
|
+
FileUtils.rm_rf extension_cache_path
|
|
41
|
+
end
|
|
42
|
+
FileUtils.rm_rf spec.extension_dir
|
|
43
|
+
FileUtils.rm_rf spec.full_gem_path
|
|
44
|
+
else
|
|
45
|
+
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
|
|
27
46
|
next
|
|
28
47
|
end
|
|
29
48
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if source.local?
|
|
33
|
-
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is locally overridden.")
|
|
34
|
-
next
|
|
35
|
-
end
|
|
49
|
+
true
|
|
50
|
+
end.map(&:name)
|
|
36
51
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
FileUtils.rm_rf spec.full_gem_path
|
|
43
|
-
else
|
|
44
|
-
Bundler.ui.warn("Cannot pristine #{gem_name}. Gem is sourced from local path.")
|
|
45
|
-
next
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
Bundler::GemInstaller.new(spec, installer, false, 0, true).install_from_spec
|
|
52
|
+
jobs = installer.send(:installation_parallelization, {})
|
|
53
|
+
pristine_count = definition.specs.count - installed_specs.count
|
|
54
|
+
# allow a pristining a single gem to skip the parallel worker
|
|
55
|
+
jobs = [jobs, pristine_count].min
|
|
56
|
+
ParallelInstaller.call(installer, definition.specs, jobs, false, true, skip: installed_specs)
|
|
49
57
|
end
|
|
50
58
|
end
|
|
51
59
|
end
|
data/lib/bundler/cli/show.rb
CHANGED
|
@@ -40,8 +40,8 @@ module Bundler
|
|
|
40
40
|
desc = " * #{s.name} (#{s.version}#{s.git_version})"
|
|
41
41
|
if @verbose
|
|
42
42
|
latest = latest_specs.find {|l| l.name == s.name }
|
|
43
|
-
Bundler.ui.info
|
|
44
|
-
#{desc}
|
|
43
|
+
Bundler.ui.info <<~END
|
|
44
|
+
#{desc.lstrip}
|
|
45
45
|
\tSummary: #{s.summary || "No description available."}
|
|
46
46
|
\tHomepage: #{s.homepage || "No website available."}
|
|
47
47
|
\tStatus: #{outdated?(s, latest) ? "Outdated - #{s.version} < #{latest.version}" : "Up to date"}
|
data/lib/bundler/cli/update.rb
CHANGED
|
@@ -35,7 +35,7 @@ module Bundler
|
|
|
35
35
|
|
|
36
36
|
if full_update
|
|
37
37
|
if conservative
|
|
38
|
-
Bundler.definition(:
|
|
38
|
+
Bundler.definition(conservative: conservative)
|
|
39
39
|
else
|
|
40
40
|
Bundler.definition(true)
|
|
41
41
|
end
|
|
@@ -51,9 +51,9 @@ module Bundler
|
|
|
51
51
|
gems.concat(deps.map(&:name))
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
Bundler.definition(:
|
|
55
|
-
:
|
|
56
|
-
:
|
|
54
|
+
Bundler.definition(gems: gems, sources: sources, ruby: options[:ruby],
|
|
55
|
+
conservative: conservative,
|
|
56
|
+
bundler: update_bundler)
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
Bundler::CLI::Common.configure_gem_version_promoter(Bundler.definition, options)
|
|
@@ -71,7 +71,7 @@ module Bundler
|
|
|
71
71
|
|
|
72
72
|
if locked_gems = Bundler.definition.locked_gems
|
|
73
73
|
previous_locked_info = locked_gems.specs.reduce({}) do |h, s|
|
|
74
|
-
h[s.name] = { :
|
|
74
|
+
h[s.name] = { spec: s, version: s.version, source: s.source.identifier }
|
|
75
75
|
h
|
|
76
76
|
end
|
|
77
77
|
end
|