bundler 1.15.1 → 1.17.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +320 -0
- data/README.md +17 -8
- data/bundler.gemspec +25 -9
- data/exe/bundle +1 -6
- data/exe/bundle_ruby +4 -3
- data/lib/bundler/build_metadata.rb +53 -0
- data/lib/bundler/capistrano.rb +5 -0
- data/lib/bundler/cli/add.rb +15 -6
- data/lib/bundler/cli/binstubs.rb +17 -9
- data/lib/bundler/cli/cache.rb +5 -4
- data/lib/bundler/cli/check.rb +3 -5
- data/lib/bundler/cli/clean.rb +5 -6
- data/lib/bundler/cli/common.rb +11 -2
- data/lib/bundler/cli/config.rb +2 -1
- data/lib/bundler/cli/console.rb +2 -1
- data/lib/bundler/cli/doctor.rb +48 -1
- data/lib/bundler/cli/exec.rb +6 -5
- data/lib/bundler/cli/gem.rb +13 -8
- data/lib/bundler/cli/info.rb +0 -1
- data/lib/bundler/cli/init.rb +18 -6
- data/lib/bundler/cli/inject.rb +1 -0
- data/lib/bundler/cli/install.rb +64 -77
- data/lib/bundler/cli/issue.rb +1 -1
- data/lib/bundler/cli/list.rb +58 -0
- data/lib/bundler/cli/lock.rb +0 -1
- data/lib/bundler/cli/open.rb +2 -2
- data/lib/bundler/cli/outdated.rb +20 -9
- data/lib/bundler/cli/package.rb +9 -6
- data/lib/bundler/cli/platform.rb +1 -0
- data/lib/bundler/cli/plugin.rb +1 -0
- data/lib/bundler/cli/pristine.rb +20 -6
- data/lib/bundler/cli/remove.rb +18 -0
- data/lib/bundler/cli/show.rb +0 -1
- data/lib/bundler/cli/update.rb +35 -7
- data/lib/bundler/cli/viz.rb +4 -0
- data/lib/bundler/cli.rb +234 -90
- data/lib/bundler/compact_index_client/cache.rb +1 -2
- data/lib/bundler/compact_index_client/updater.rb +35 -7
- data/lib/bundler/compact_index_client.rb +1 -0
- data/lib/bundler/compatibility_guard.rb +14 -0
- data/lib/bundler/constants.rb +1 -0
- data/lib/bundler/current_ruby.rb +13 -5
- data/lib/bundler/definition.rb +192 -139
- data/lib/bundler/dep_proxy.rb +3 -1
- data/lib/bundler/dependency.rb +9 -9
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/deprecate.rb +15 -3
- data/lib/bundler/dsl.rb +115 -64
- data/lib/bundler/endpoint_specification.rb +10 -1
- data/lib/bundler/env.rb +90 -29
- data/lib/bundler/environment_preserver.rb +27 -6
- data/lib/bundler/errors.rb +1 -0
- data/lib/bundler/feature_flag.rb +46 -4
- data/lib/bundler/fetcher/base.rb +1 -0
- data/lib/bundler/fetcher/compact_index.rb +2 -11
- data/lib/bundler/fetcher/dependency.rb +2 -1
- data/lib/bundler/fetcher/downloader.rb +11 -5
- data/lib/bundler/fetcher/index.rb +3 -2
- data/lib/bundler/fetcher.rb +18 -11
- data/lib/bundler/friendly_errors.rb +6 -1
- data/lib/bundler/gem_helper.rb +19 -10
- data/lib/bundler/gem_helpers.rb +1 -0
- data/lib/bundler/gem_remote_fetcher.rb +1 -0
- data/lib/bundler/gem_tasks.rb +1 -0
- data/lib/bundler/gem_version_promoter.rb +17 -2
- data/lib/bundler/gemdeps.rb +1 -0
- data/lib/bundler/graph.rb +1 -0
- data/lib/bundler/index.rb +8 -8
- data/lib/bundler/injector.rb +192 -30
- data/lib/bundler/inline.rb +10 -10
- data/lib/bundler/installer/gem_installer.rb +12 -2
- data/lib/bundler/installer/parallel_installer.rb +78 -42
- data/lib/bundler/installer/standalone.rb +1 -0
- data/lib/bundler/installer.rb +138 -53
- data/lib/bundler/lazy_specification.rb +3 -2
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +10 -4
- data/lib/bundler/match_platform.rb +1 -0
- data/lib/bundler/mirror.rb +8 -5
- data/lib/bundler/plugin/api/source.rb +9 -2
- data/lib/bundler/plugin/events.rb +61 -0
- data/lib/bundler/plugin/index.rb +7 -2
- data/lib/bundler/plugin/installer.rb +7 -6
- data/lib/bundler/plugin/source_list.rb +7 -8
- data/lib/bundler/plugin.rb +13 -5
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +10 -0
- data/lib/bundler/remote_specification.rb +10 -1
- data/lib/bundler/resolver/spec_group.rb +106 -0
- data/lib/bundler/resolver.rb +158 -195
- data/lib/bundler/retry.rb +1 -0
- data/lib/bundler/ruby_dsl.rb +1 -0
- data/lib/bundler/ruby_version.rb +2 -1
- data/lib/bundler/rubygems_ext.rb +5 -4
- data/lib/bundler/rubygems_gem_installer.rb +31 -1
- data/lib/bundler/rubygems_integration.rb +71 -32
- data/lib/bundler/runtime.rb +11 -9
- data/lib/bundler/settings/validator.rb +102 -0
- data/lib/bundler/settings.rb +213 -86
- data/lib/bundler/setup.rb +4 -7
- data/lib/bundler/shared_helpers.rb +131 -26
- data/lib/bundler/similarity_detector.rb +1 -0
- data/lib/bundler/source/gemspec.rb +1 -0
- data/lib/bundler/source/git/git_proxy.rb +21 -11
- data/lib/bundler/source/git.rb +24 -19
- data/lib/bundler/source/metadata.rb +62 -0
- data/lib/bundler/source/path/installer.rb +2 -0
- data/lib/bundler/source/path.rb +11 -7
- data/lib/bundler/source/rubygems/remote.rb +8 -2
- data/lib/bundler/source/rubygems.rb +161 -84
- data/lib/bundler/source.rb +36 -0
- data/lib/bundler/source_list.rb +75 -15
- data/lib/bundler/spec_set.rb +12 -6
- data/lib/bundler/ssl_certs/certificate_manager.rb +2 -1
- data/lib/bundler/stub_specification.rb +1 -0
- data/lib/bundler/templates/.document +1 -0
- data/lib/bundler/templates/Executable +12 -0
- data/lib/bundler/templates/Executable.bundler +105 -0
- data/lib/bundler/templates/Gemfile +3 -0
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/Gemfile.tt +2 -0
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/templates/newgem/gitignore.tt +0 -1
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +1 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +12 -3
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +0 -2
- data/lib/bundler/templates/newgem/{.travis.yml.tt → travis.yml.tt} +2 -0
- data/lib/bundler/ui/rg_proxy.rb +1 -0
- data/lib/bundler/ui/shell.rb +17 -4
- data/lib/bundler/ui/silent.rb +1 -0
- data/lib/bundler/ui.rb +1 -0
- data/lib/bundler/uri_credentials_filter.rb +1 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +15 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +3 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +75 -7
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +491 -148
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +2 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +3 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +9 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +45 -8
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +9 -3
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +6 -3
- data/lib/bundler/vendor/thor/lib/thor/base.rb +27 -4
- data/lib/bundler/vendor/thor/lib/thor/command.rb +9 -7
- data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +12 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +2 -0
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +5 -5
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +6 -5
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +6 -4
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +10 -9
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor.rb +25 -8
- data/lib/bundler/vendored_fileutils.rb +9 -0
- data/lib/bundler/vendored_molinillo.rb +1 -0
- data/lib/bundler/vendored_persistent.rb +35 -0
- data/lib/bundler/vendored_thor.rb +1 -0
- data/lib/bundler/version.rb +6 -2
- data/lib/bundler/version_ranges.rb +1 -0
- data/lib/bundler/vlad.rb +5 -0
- data/lib/bundler/worker.rb +1 -0
- data/lib/bundler/yaml_serializer.rb +3 -3
- data/lib/bundler.rb +86 -52
- data/man/bundle-add.1 +18 -3
- data/man/bundle-add.1.txt +26 -14
- data/man/bundle-add.ronn +13 -2
- data/man/bundle-binstubs.1 +11 -1
- data/man/bundle-binstubs.1.txt +33 -18
- data/man/bundle-binstubs.ronn +15 -1
- data/man/bundle-check.1 +4 -4
- data/man/bundle-check.1.txt +15 -14
- data/man/bundle-check.ronn +3 -3
- data/man/bundle-clean.1 +1 -1
- data/man/bundle-clean.1.txt +10 -10
- data/man/bundle-config.1 +129 -29
- data/man/bundle-config.1.txt +285 -174
- data/man/bundle-config.ronn +167 -88
- data/man/bundle-doctor.1 +44 -0
- data/man/bundle-doctor.1.txt +44 -0
- data/man/bundle-doctor.ronn +33 -0
- data/man/bundle-exec.1 +6 -3
- data/man/bundle-exec.1.txt +78 -71
- data/man/bundle-exec.ronn +10 -3
- data/man/bundle-gem.1 +4 -4
- data/man/bundle-gem.1.txt +41 -40
- data/man/bundle-gem.ronn +3 -2
- data/man/bundle-info.1 +1 -1
- data/man/bundle-info.1.txt +8 -8
- data/man/bundle-init.1 +9 -4
- data/man/bundle-init.1.txt +23 -13
- data/man/bundle-init.ronn +15 -4
- data/man/bundle-inject.1 +4 -4
- data/man/bundle-inject.1.txt +10 -10
- data/man/bundle-inject.ronn +3 -3
- data/man/bundle-install.1 +31 -28
- data/man/bundle-install.1.txt +205 -194
- data/man/bundle-install.ronn +44 -35
- data/man/bundle-list.1 +50 -0
- data/man/bundle-list.1.txt +43 -0
- data/man/bundle-list.ronn +33 -0
- data/man/bundle-lock.1 +1 -1
- data/man/bundle-lock.1.txt +47 -47
- data/man/bundle-lock.ronn +1 -1
- data/man/bundle-open.1 +1 -1
- data/man/bundle-open.1.txt +7 -7
- data/man/bundle-outdated.1 +7 -3
- data/man/bundle-outdated.1.txt +40 -36
- data/man/bundle-outdated.ronn +6 -2
- data/man/bundle-package.1 +6 -3
- data/man/bundle-package.1.txt +44 -39
- data/man/bundle-package.ronn +7 -2
- data/man/bundle-platform.1 +1 -1
- data/man/bundle-platform.1.txt +13 -13
- data/man/bundle-pristine.1 +21 -3
- data/man/bundle-pristine.1.txt +33 -10
- data/man/bundle-pristine.ronn +24 -3
- data/man/bundle-remove.1 +31 -0
- data/man/bundle-remove.1.txt +34 -0
- data/man/bundle-remove.ronn +23 -0
- data/man/bundle-show.1 +3 -3
- data/man/bundle-show.1.txt +14 -12
- data/man/bundle-show.ronn +3 -2
- data/man/bundle-update.1 +13 -9
- data/man/bundle-update.1.txt +133 -130
- data/man/bundle-update.ronn +21 -17
- data/man/bundle-viz.1 +7 -7
- data/man/bundle-viz.1.txt +17 -15
- data/man/bundle-viz.ronn +6 -6
- data/man/bundle.1 +31 -32
- data/man/bundle.1.txt +63 -75
- data/man/bundle.ronn +35 -47
- data/man/gemfile.5 +44 -8
- data/man/gemfile.5.ronn +54 -8
- data/man/gemfile.5.txt +218 -165
- data/man/index.txt +25 -15
- metadata +36 -44
- data/.codeclimate.yml +0 -25
- data/.gitignore +0 -18
- data/.rspec +0 -3
- data/.rubocop.yml +0 -131
- data/.rubocop_todo.yml +0 -418
- data/.travis.yml +0 -122
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -17
- data/Rakefile +0 -346
- data/bin/rake +0 -19
- data/bin/rspec +0 -15
- data/bin/rubocop +0 -17
- data/bin/with_rubygems +0 -39
- data/doc/README.md +0 -30
- data/doc/TROUBLESHOOTING.md +0 -64
- data/doc/contributing/BUG_TRIAGE.md +0 -36
- data/doc/contributing/COMMUNITY.md +0 -13
- data/doc/contributing/GETTING_HELP.md +0 -11
- data/doc/contributing/HOW_YOU_CAN_HELP.md +0 -27
- data/doc/contributing/ISSUES.md +0 -51
- data/doc/contributing/README.md +0 -38
- data/doc/development/NEW_FEATURES.md +0 -10
- data/doc/development/PULL_REQUESTS.md +0 -40
- data/doc/development/README.md +0 -19
- data/doc/development/RELEASING.md +0 -9
- data/doc/development/SETUP.md +0 -29
- data/doc/documentation/README.md +0 -29
- data/doc/documentation/VISION.md +0 -26
- data/doc/documentation/WRITING.md +0 -54
- data/lib/bundler/postit_trampoline.rb +0 -73
- data/lib/bundler/vendor/postit/lib/postit/environment.rb +0 -44
- data/lib/bundler/vendor/postit/lib/postit/installer.rb +0 -28
- data/lib/bundler/vendor/postit/lib/postit/parser.rb +0 -21
- data/lib/bundler/vendor/postit/lib/postit/setup.rb +0 -12
- data/lib/bundler/vendor/postit/lib/postit/version.rb +0 -3
- data/lib/bundler/vendor/postit/lib/postit.rb +0 -15
- data/task/release.rake +0 -116
data/lib/bundler/cli.rb
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "bundler"
|
3
4
|
require "bundler/vendored_thor"
|
4
5
|
|
5
6
|
module Bundler
|
6
7
|
class CLI < Thor
|
7
|
-
|
8
|
+
require "bundler/cli/common"
|
9
|
+
|
10
|
+
package_name "Bundler"
|
11
|
+
|
12
|
+
AUTO_INSTALL_CMDS = %w[show binstubs outdated exec open console licenses clean].freeze
|
13
|
+
PARSEABLE_COMMANDS = %w[
|
14
|
+
check config help exec platform show version
|
15
|
+
].freeze
|
8
16
|
|
9
17
|
def self.start(*)
|
10
18
|
super
|
@@ -12,12 +20,14 @@ module Bundler
|
|
12
20
|
Bundler.ui = UI::Shell.new
|
13
21
|
raise e
|
14
22
|
ensure
|
15
|
-
warn_on_outdated_bundler
|
16
23
|
Bundler::SharedHelpers.print_major_deprecations!
|
17
24
|
end
|
18
25
|
|
19
26
|
def self.dispatch(*)
|
20
|
-
super
|
27
|
+
super do |i|
|
28
|
+
i.send(:print_command)
|
29
|
+
i.send(:warn_on_outdated_bundler)
|
30
|
+
end
|
21
31
|
end
|
22
32
|
|
23
33
|
def initialize(*args)
|
@@ -25,11 +35,11 @@ module Bundler
|
|
25
35
|
|
26
36
|
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
|
27
37
|
if custom_gemfile && !custom_gemfile.empty?
|
28
|
-
|
38
|
+
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
|
29
39
|
Bundler.reset_paths!
|
30
40
|
end
|
31
41
|
|
32
|
-
Bundler.settings
|
42
|
+
Bundler.settings.set_command_option_if_given :retry, options[:retry]
|
33
43
|
|
34
44
|
current_cmd = args.last[:current_command].name
|
35
45
|
auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
|
@@ -37,7 +47,6 @@ module Bundler
|
|
37
47
|
raise InvalidOption, e.message
|
38
48
|
ensure
|
39
49
|
self.options ||= {}
|
40
|
-
Bundler.settings.cli_flags_given = !options.empty?
|
41
50
|
unprinted_warnings = Bundler.ui.unprinted_warnings
|
42
51
|
Bundler.ui = UI::Shell.new(options)
|
43
52
|
Bundler.ui.level = "debug" if options["verbose"]
|
@@ -52,10 +61,41 @@ module Bundler
|
|
52
61
|
end
|
53
62
|
end
|
54
63
|
|
64
|
+
def self.deprecated_option(*args, &blk)
|
65
|
+
return if Bundler.feature_flag.forget_cli_options?
|
66
|
+
method_option(*args, &blk)
|
67
|
+
end
|
68
|
+
|
55
69
|
check_unknown_options!(:except => [:config, :exec])
|
56
70
|
stop_on_unknown_option! :exec
|
57
71
|
|
58
|
-
|
72
|
+
desc "cli_help", "Prints a summary of bundler commands", :hide => true
|
73
|
+
def cli_help
|
74
|
+
version
|
75
|
+
Bundler.ui.info "\n"
|
76
|
+
|
77
|
+
primary_commands = ["install", "update",
|
78
|
+
Bundler.feature_flag.cache_command_is_package? ? "cache" : "package",
|
79
|
+
"exec", "config", "help"]
|
80
|
+
|
81
|
+
list = self.class.printable_commands(true)
|
82
|
+
by_name = list.group_by {|name, _message| name.match(/^bundle (\w+)/)[1] }
|
83
|
+
utilities = by_name.keys.sort - primary_commands
|
84
|
+
primary_commands.map! {|name| (by_name[name] || raise("no primary command #{name}")).first }
|
85
|
+
utilities.map! {|name| by_name[name].first }
|
86
|
+
|
87
|
+
shell.say "Bundler commands:\n\n"
|
88
|
+
|
89
|
+
shell.say " Primary commands:\n"
|
90
|
+
shell.print_table(primary_commands, :indent => 4, :truncate => true)
|
91
|
+
shell.say
|
92
|
+
shell.say " Utilities:\n"
|
93
|
+
shell.print_table(utilities, :indent => 4, :truncate => true)
|
94
|
+
shell.say
|
95
|
+
self.class.send(:class_options_help, shell)
|
96
|
+
end
|
97
|
+
default_task(Bundler.feature_flag.default_cli_command)
|
98
|
+
|
59
99
|
class_option "no-color", :type => :boolean, :desc => "Disable colorization in output"
|
60
100
|
class_option "retry", :type => :numeric, :aliases => "-r", :banner => "NUM",
|
61
101
|
:desc => "Specify the number of times you wish to attempt network commands"
|
@@ -86,9 +126,6 @@ module Bundler
|
|
86
126
|
end
|
87
127
|
end
|
88
128
|
|
89
|
-
# Ensure `bundle help --no-color` is valid
|
90
|
-
all_commands["help"].disable_class_options = false
|
91
|
-
|
92
129
|
def self.handle_no_command_error(command, has_namespace = $thor_runner)
|
93
130
|
if Bundler.feature_flag.plugins? && Bundler::Plugin.command?(command)
|
94
131
|
return Bundler::Plugin.exec_command(command, ARGV[1..-1])
|
@@ -105,7 +142,7 @@ module Bundler
|
|
105
142
|
Gemfile to a gem with a gemspec, the --gemspec option will automatically add each
|
106
143
|
dependency listed in the gemspec file to the newly created Gemfile.
|
107
144
|
D
|
108
|
-
|
145
|
+
deprecated_option "gemspec", :type => :string, :banner => "Use the specified .gemspec to create the Gemfile"
|
109
146
|
def init
|
110
147
|
require "bundler/cli/init"
|
111
148
|
Init.new(options.dup).run
|
@@ -122,13 +159,24 @@ module Bundler
|
|
122
159
|
method_option "gemfile", :type => :string, :banner =>
|
123
160
|
"Use the specified gemfile instead of Gemfile"
|
124
161
|
method_option "path", :type => :string, :banner =>
|
125
|
-
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME)
|
162
|
+
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME).#{" Bundler will remember this value for future installs on this machine" unless Bundler.feature_flag.forget_cli_options?}"
|
126
163
|
map "c" => "check"
|
127
164
|
def check
|
128
165
|
require "bundler/cli/check"
|
129
166
|
Check.new(options).run
|
130
167
|
end
|
131
168
|
|
169
|
+
desc "remove [GEM [GEM ...]]", "Removes gems from the Gemfile"
|
170
|
+
long_desc <<-D
|
171
|
+
Removes the given gems from the Gemfile while ensuring that the resulting Gemfile is still valid. If the gem is not found, Bundler prints a error message and if gem could not be removed due to any reason Bundler will display a warning.
|
172
|
+
D
|
173
|
+
method_option "install", :type => :boolean, :banner =>
|
174
|
+
"Runs 'bundle install' after removing the gems from the Gemfile"
|
175
|
+
def remove(*gems)
|
176
|
+
require "bundler/cli/remove"
|
177
|
+
Remove.new(gems, options).run
|
178
|
+
end
|
179
|
+
|
132
180
|
desc "install [OPTIONS]", "Install the current environment to the system"
|
133
181
|
long_desc <<-D
|
134
182
|
Install will install all of the gems in the current bundle, making them available
|
@@ -140,13 +188,13 @@ module Bundler
|
|
140
188
|
|
141
189
|
If the bundle has already been installed, bundler will tell you so and then exit.
|
142
190
|
D
|
143
|
-
|
191
|
+
deprecated_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
|
144
192
|
"Generate bin stubs for bundled gems to ./bin"
|
145
|
-
|
193
|
+
deprecated_option "clean", :type => :boolean, :banner =>
|
146
194
|
"Run bundle clean automatically after install"
|
147
|
-
|
195
|
+
deprecated_option "deployment", :type => :boolean, :banner =>
|
148
196
|
"Install using defaults tuned for deployment environments"
|
149
|
-
|
197
|
+
deprecated_option "frozen", :type => :boolean, :banner =>
|
150
198
|
"Do not allow the Gemfile.lock to be updated after this install"
|
151
199
|
method_option "full-index", :type => :boolean, :banner =>
|
152
200
|
"Fall back to using the single-file index of all gems"
|
@@ -156,38 +204,39 @@ module Bundler
|
|
156
204
|
"Specify the number of jobs to run in parallel"
|
157
205
|
method_option "local", :type => :boolean, :banner =>
|
158
206
|
"Do not attempt to fetch gems remotely and use the gem cache instead"
|
159
|
-
|
207
|
+
deprecated_option "no-cache", :type => :boolean, :banner =>
|
160
208
|
"Don't update the existing gem cache."
|
161
|
-
method_option "
|
209
|
+
method_option "redownload", :type => :boolean, :aliases => "--force", :banner =>
|
162
210
|
"Force downloading every gem."
|
163
|
-
|
211
|
+
deprecated_option "no-prune", :type => :boolean, :banner =>
|
164
212
|
"Don't remove stale gems from the cache."
|
165
|
-
|
213
|
+
deprecated_option "path", :type => :string, :banner =>
|
166
214
|
"Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine"
|
167
215
|
method_option "quiet", :type => :boolean, :banner =>
|
168
216
|
"Only output warnings and errors."
|
169
|
-
|
217
|
+
deprecated_option "shebang", :type => :string, :banner =>
|
170
218
|
"Specify a different shebang executable name than the default (usually 'ruby')"
|
171
219
|
method_option "standalone", :type => :array, :lazy_default => [], :banner =>
|
172
220
|
"Make a bundle that can work without the Bundler runtime"
|
173
|
-
|
221
|
+
deprecated_option "system", :type => :boolean, :banner =>
|
174
222
|
"Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application"
|
175
223
|
method_option "trust-policy", :alias => "P", :type => :string, :banner =>
|
176
224
|
"Gem trust policy (like gem install -P). Must be one of " +
|
177
225
|
Bundler.rubygems.security_policy_keys.join("|")
|
178
|
-
|
226
|
+
deprecated_option "without", :type => :array, :banner =>
|
179
227
|
"Exclude gems that are part of the specified named group."
|
180
|
-
|
228
|
+
deprecated_option "with", :type => :array, :banner =>
|
181
229
|
"Include gems that are part of the specified named group."
|
182
230
|
map "i" => "install"
|
183
231
|
def install
|
232
|
+
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
|
184
233
|
require "bundler/cli/install"
|
185
234
|
Bundler.settings.temporary(:no_install => false) do
|
186
235
|
Install.new(options.dup).run
|
187
236
|
end
|
188
237
|
end
|
189
238
|
|
190
|
-
desc "update [OPTIONS]", "
|
239
|
+
desc "update [OPTIONS]", "Update the current environment"
|
191
240
|
long_desc <<-D
|
192
241
|
Update will install the newest versions of the gems listed in the Gemfile. Use
|
193
242
|
update when you have changed the Gemfile, or if you want to get the newest
|
@@ -195,6 +244,8 @@ module Bundler
|
|
195
244
|
D
|
196
245
|
method_option "full-index", :type => :boolean, :banner =>
|
197
246
|
"Fall back to using the single-file index of all gems"
|
247
|
+
method_option "gemfile", :type => :string, :banner =>
|
248
|
+
"Use the specified gemfile instead of Gemfile"
|
198
249
|
method_option "group", :aliases => "-g", :type => :array, :banner =>
|
199
250
|
"Update a specific group"
|
200
251
|
method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>
|
@@ -205,7 +256,7 @@ module Bundler
|
|
205
256
|
"Only output warnings and errors."
|
206
257
|
method_option "source", :type => :array, :banner =>
|
207
258
|
"Update a specific source (and all gems associated with it)"
|
208
|
-
method_option "
|
259
|
+
method_option "redownload", :type => :boolean, :aliases => "--force", :banner =>
|
209
260
|
"Force downloading every gem."
|
210
261
|
method_option "ruby", :type => :boolean, :banner =>
|
211
262
|
"Update ruby specified in Gemfile.lock"
|
@@ -221,7 +272,10 @@ module Bundler
|
|
221
272
|
"Do not allow any gem to be updated past latest --patch | --minor | --major"
|
222
273
|
method_option "conservative", :type => :boolean, :banner =>
|
223
274
|
"Use bundle install conservative update behavior and do not allow shared dependencies to be updated."
|
275
|
+
method_option "all", :type => :boolean, :banner =>
|
276
|
+
"Update everything."
|
224
277
|
def update(*gems)
|
278
|
+
SharedHelpers.major_deprecation(2, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
|
225
279
|
require "bundler/cli/update"
|
226
280
|
Update.new(options, gems).run
|
227
281
|
end
|
@@ -236,12 +290,41 @@ module Bundler
|
|
236
290
|
method_option "outdated", :type => :boolean,
|
237
291
|
:banner => "Show verbose output including whether gems are outdated."
|
238
292
|
def show(gem_name = nil)
|
239
|
-
|
293
|
+
if ARGV[0] == "show"
|
294
|
+
rest = ARGV[1..-1]
|
295
|
+
|
296
|
+
new_command = rest.find {|arg| !arg.start_with?("--") } ? "info" : "list"
|
297
|
+
|
298
|
+
new_arguments = rest.map do |arg|
|
299
|
+
next arg if arg != "--paths"
|
300
|
+
next "--path" if new_command == "info"
|
301
|
+
end
|
302
|
+
|
303
|
+
old_argv = ARGV.join(" ")
|
304
|
+
new_argv = [new_command, *new_arguments.compact].join(" ")
|
305
|
+
|
306
|
+
Bundler::SharedHelpers.major_deprecation(2, "use `bundle #{new_argv}` instead of `bundle #{old_argv}`")
|
307
|
+
end
|
240
308
|
require "bundler/cli/show"
|
241
309
|
Show.new(options, gem_name).run
|
242
310
|
end
|
243
|
-
# TODO: 2.0 remove `bundle
|
244
|
-
|
311
|
+
# TODO: 2.0 remove `bundle show`
|
312
|
+
|
313
|
+
if Bundler.feature_flag.list_command?
|
314
|
+
desc "list", "List all gems in the bundle"
|
315
|
+
method_option "name-only", :type => :boolean, :banner => "print only the gem names"
|
316
|
+
method_option "only-group", :type => :string, :banner => "print gems from a particular group"
|
317
|
+
method_option "without-group", :type => :string, :banner => "print all gems expect from a group"
|
318
|
+
method_option "paths", :type => :boolean, :banner => "print the path to each gem in the bundle"
|
319
|
+
def list
|
320
|
+
require "bundler/cli/list"
|
321
|
+
List.new(options).run
|
322
|
+
end
|
323
|
+
|
324
|
+
map %w[ls] => "list"
|
325
|
+
else
|
326
|
+
map %w[list] => "show"
|
327
|
+
end
|
245
328
|
|
246
329
|
desc "info GEM [OPTIONS]", "Show information for the given gem"
|
247
330
|
method_option "path", :type => :boolean, :banner => "Print full path to gem"
|
@@ -260,8 +343,12 @@ module Bundler
|
|
260
343
|
"Overwrite existing binstubs if they exist"
|
261
344
|
method_option "path", :type => :string, :lazy_default => "bin", :banner =>
|
262
345
|
"Binstub destination directory (default bin)"
|
346
|
+
method_option "shebang", :type => :string, :banner =>
|
347
|
+
"Specify a different shebang executable name than the default (usually 'ruby')"
|
263
348
|
method_option "standalone", :type => :boolean, :banner =>
|
264
349
|
"Make binstubs that can work without the Bundler runtime"
|
350
|
+
method_option "all", :type => :boolean, :banner =>
|
351
|
+
"Install binstubs for all gems"
|
265
352
|
def binstubs(*gems)
|
266
353
|
require "bundler/cli/binstubs"
|
267
354
|
Binstubs.new(options, gems).run
|
@@ -274,13 +361,16 @@ module Bundler
|
|
274
361
|
method_option "version", :aliases => "-v", :type => :string
|
275
362
|
method_option "group", :aliases => "-g", :type => :string
|
276
363
|
method_option "source", :aliases => "-s", :type => :string
|
277
|
-
|
278
|
-
|
364
|
+
method_option "skip-install", :type => :boolean, :banner =>
|
365
|
+
"Adds gem to the Gemfile but does not install it"
|
366
|
+
method_option "optimistic", :type => :boolean, :banner => "Adds optimistic declaration of version to gem"
|
367
|
+
method_option "strict", :type => :boolean, :banner => "Adds strict declaration of version to gem"
|
368
|
+
def add(*gems)
|
279
369
|
require "bundler/cli/add"
|
280
|
-
Add.new(options.dup,
|
370
|
+
Add.new(options.dup, gems).run
|
281
371
|
end
|
282
372
|
|
283
|
-
desc "outdated GEM [OPTIONS]", "
|
373
|
+
desc "outdated GEM [OPTIONS]", "List installed gems with newer versions available"
|
284
374
|
long_desc <<-D
|
285
375
|
Outdated lists the names and versions of gems that have a newer version available
|
286
376
|
in the given source. Calling outdated with [GEM [GEM]] will only check for newer
|
@@ -290,8 +380,8 @@ module Bundler
|
|
290
380
|
For more information on patch level options (--major, --minor, --patch,
|
291
381
|
--update-strict) see documentation on the same options on the update command.
|
292
382
|
D
|
293
|
-
method_option "group", :
|
294
|
-
method_option "groups", :
|
383
|
+
method_option "group", :type => :string, :banner => "List gems from a specific group"
|
384
|
+
method_option "groups", :type => :boolean, :banner => "List gems organized by groups"
|
295
385
|
method_option "local", :type => :boolean, :banner =>
|
296
386
|
"Do not attempt to fetch gems remotely and use the gem cache instead"
|
297
387
|
method_option "pre", :type => :boolean, :banner => "Check for newer pre-release gems"
|
@@ -308,22 +398,34 @@ module Bundler
|
|
308
398
|
method_option "filter-patch", :type => :boolean, :banner => "Only list patch newer versions"
|
309
399
|
method_option "parseable", :aliases => "--porcelain", :type => :boolean, :banner =>
|
310
400
|
"Use minimal formatting for more parseable output"
|
401
|
+
method_option "only-explicit", :type => :boolean, :banner =>
|
402
|
+
"Only list gems specified in your Gemfile, not their dependencies"
|
311
403
|
def outdated(*gems)
|
312
404
|
require "bundler/cli/outdated"
|
313
405
|
Outdated.new(options, gems).run
|
314
406
|
end
|
315
407
|
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
408
|
+
if Bundler.feature_flag.cache_command_is_package?
|
409
|
+
map %w[cache] => :package
|
410
|
+
else
|
411
|
+
desc "cache [OPTIONS]", "Cache all the gems to vendor/cache", :hide => true
|
412
|
+
unless Bundler.feature_flag.cache_command_is_package?
|
413
|
+
method_option "all", :type => :boolean,
|
414
|
+
:banner => "Include all sources (including path and git)."
|
415
|
+
end
|
416
|
+
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
|
417
|
+
method_option "no-prune", :type => :boolean, :banner => "Don't remove stale gems from the cache."
|
418
|
+
def cache
|
419
|
+
require "bundler/cli/cache"
|
420
|
+
Cache.new(options).run
|
421
|
+
end
|
323
422
|
end
|
324
423
|
|
325
|
-
desc "package [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
|
326
|
-
|
424
|
+
desc "#{Bundler.feature_flag.cache_command_is_package? ? :cache : :package} [OPTIONS]", "Locks and then caches all of the gems into vendor/cache"
|
425
|
+
unless Bundler.feature_flag.cache_command_is_package?
|
426
|
+
method_option "all", :type => :boolean,
|
427
|
+
:banner => "Include all sources (including path and git)."
|
428
|
+
end
|
327
429
|
method_option "all-platforms", :type => :boolean, :banner => "Include gems for all platforms present in the lockfile, not only the current one"
|
328
430
|
method_option "cache-path", :type => :string, :banner =>
|
329
431
|
"Specify a different cache path than the default (vendor/cache)."
|
@@ -345,14 +447,15 @@ module Bundler
|
|
345
447
|
require "bundler/cli/package"
|
346
448
|
Package.new(options).run
|
347
449
|
end
|
348
|
-
map %w
|
450
|
+
map %w[pack] => :package
|
349
451
|
|
350
452
|
desc "exec [OPTIONS]", "Run the command in context of the bundle"
|
351
453
|
method_option :keep_file_descriptors, :type => :boolean, :default => false
|
454
|
+
method_option :gemfile, :type => :string, :required => false
|
352
455
|
long_desc <<-D
|
353
456
|
Exec runs a command, providing it access to the gems in the bundle. While using
|
354
457
|
bundle exec you can require and call the bundled gems as if they were installed
|
355
|
-
into the system wide
|
458
|
+
into the system wide RubyGems repository.
|
356
459
|
D
|
357
460
|
map "e" => "exec"
|
358
461
|
def exec(*args)
|
@@ -360,7 +463,7 @@ module Bundler
|
|
360
463
|
Exec.new(options, args).run
|
361
464
|
end
|
362
465
|
|
363
|
-
desc "config NAME [VALUE]", "
|
466
|
+
desc "config NAME [VALUE]", "Retrieve or set a configuration value"
|
364
467
|
long_desc <<-D
|
365
468
|
Retrieves or sets a configuration value. If only one parameter is provided, retrieve the value. If two parameters are provided, replace the
|
366
469
|
existing value with the newly provided one.
|
@@ -384,18 +487,28 @@ module Bundler
|
|
384
487
|
Open.new(options, name).run
|
385
488
|
end
|
386
489
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
490
|
+
if Bundler.feature_flag.console_command?
|
491
|
+
desc "console [GROUP]", "Opens an IRB session with the bundle pre-loaded"
|
492
|
+
def console(group = nil)
|
493
|
+
require "bundler/cli/console"
|
494
|
+
Console.new(options, group).run
|
495
|
+
end
|
392
496
|
end
|
393
497
|
|
394
498
|
desc "version", "Prints the bundler's version information"
|
395
499
|
def version
|
396
|
-
|
500
|
+
cli_help = current_command.name == "cli_help"
|
501
|
+
if cli_help || ARGV.include?("version")
|
502
|
+
build_info = " (#{BuildMetadata.built_at} commit #{BuildMetadata.git_commit_sha})"
|
503
|
+
end
|
504
|
+
|
505
|
+
if !cli_help && Bundler.feature_flag.print_only_version_number?
|
506
|
+
Bundler.ui.info "#{Bundler::VERSION}#{build_info}"
|
507
|
+
else
|
508
|
+
Bundler.ui.info "Bundler version #{Bundler::VERSION}#{build_info}"
|
509
|
+
end
|
397
510
|
end
|
398
|
-
map %w
|
511
|
+
map %w[-v --version] => :version
|
399
512
|
|
400
513
|
desc "licenses", "Prints the license of all gems in the bundle"
|
401
514
|
def licenses
|
@@ -411,25 +524,28 @@ module Bundler
|
|
411
524
|
end
|
412
525
|
end
|
413
526
|
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
527
|
+
if Bundler.feature_flag.viz_command?
|
528
|
+
desc "viz [OPTIONS]", "Generates a visual dependency graph", :hide => true
|
529
|
+
long_desc <<-D
|
530
|
+
Viz generates a PNG file of the current Gemfile as a dependency graph.
|
531
|
+
Viz requires the ruby-graphviz gem (and its dependencies).
|
532
|
+
The associated gems must also be installed via 'bundle install'.
|
533
|
+
D
|
534
|
+
method_option :file, :type => :string, :default => "gem_graph", :aliases => "-f", :desc => "The name to use for the generated file. see format option"
|
535
|
+
method_option :format, :type => :string, :default => "png", :aliases => "-F", :desc => "This is output format option. Supported format is png, jpg, svg, dot ..."
|
536
|
+
method_option :requirements, :type => :boolean, :default => false, :aliases => "-R", :desc => "Set to show the version of each required dependency."
|
537
|
+
method_option :version, :type => :boolean, :default => false, :aliases => "-v", :desc => "Set to show each gem version."
|
538
|
+
method_option :without, :type => :array, :default => [], :aliases => "-W", :banner => "GROUP[ GROUP...]", :desc => "Exclude gems that are part of the specified named group."
|
539
|
+
def viz
|
540
|
+
SharedHelpers.major_deprecation 2, "The `viz` command has been moved to the `bundle-viz` gem, see https://github.com/bundler/bundler-viz"
|
541
|
+
require "bundler/cli/viz"
|
542
|
+
Viz.new(options.dup).run
|
543
|
+
end
|
428
544
|
end
|
429
545
|
|
430
546
|
old_gem = instance_method(:gem)
|
431
547
|
|
432
|
-
desc "gem
|
548
|
+
desc "gem NAME [OPTIONS]", "Creates a skeleton for creating a rubygem"
|
433
549
|
method_option :exe, :type => :boolean, :default => false, :aliases => ["--bin", "-b"], :desc => "Generate a binary executable for your library."
|
434
550
|
method_option :coc, :type => :boolean, :desc => "Generate a code of conduct file. Set a default with `bundle config gem.coc true`."
|
435
551
|
method_option :edit, :type => :string, :aliases => "-e", :required => false, :banner => "EDITOR",
|
@@ -468,7 +584,7 @@ module Bundler
|
|
468
584
|
File.expand_path(File.join(File.dirname(__FILE__), "templates"))
|
469
585
|
end
|
470
586
|
|
471
|
-
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory"
|
587
|
+
desc "clean [OPTIONS]", "Cleans up unused gems in your bundler directory", :hide => true
|
472
588
|
method_option "dry-run", :type => :boolean, :default => false, :banner =>
|
473
589
|
"Only print out changes, do not clean gems"
|
474
590
|
method_option "force", :type => :boolean, :default => false, :banner =>
|
@@ -486,13 +602,13 @@ module Bundler
|
|
486
602
|
Platform.new(options).run
|
487
603
|
end
|
488
604
|
|
489
|
-
desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile"
|
605
|
+
desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile", :hide => true
|
490
606
|
method_option "source", :type => :string, :banner =>
|
491
607
|
"Install gem from the given source"
|
492
608
|
method_option "group", :type => :string, :banner =>
|
493
609
|
"Install gem into a bundler group"
|
494
610
|
def inject(name, version)
|
495
|
-
SharedHelpers.major_deprecation "The `inject` command has been replaced by the `add` command"
|
611
|
+
SharedHelpers.major_deprecation 2, "The `inject` command has been replaced by the `add` command"
|
496
612
|
require "bundler/cli/inject"
|
497
613
|
Inject.new(options.dup, name, version).run
|
498
614
|
end
|
@@ -529,7 +645,7 @@ module Bundler
|
|
529
645
|
|
530
646
|
desc "env", "Print information about the environment Bundler is running under"
|
531
647
|
def env
|
532
|
-
Env.
|
648
|
+
Env.write($stdout)
|
533
649
|
end
|
534
650
|
|
535
651
|
desc "doctor [OPTIONS]", "Checks the bundle for common problems"
|
@@ -553,15 +669,20 @@ module Bundler
|
|
553
669
|
Issue.new.run
|
554
670
|
end
|
555
671
|
|
556
|
-
desc "pristine", "Restores installed gems to pristine condition
|
557
|
-
|
672
|
+
desc "pristine [GEMS...]", "Restores installed gems to pristine condition"
|
673
|
+
long_desc <<-D
|
674
|
+
Restores installed gems to pristine condition from files located in the
|
675
|
+
gem cache. Gems installed from a git repository will be issued `git
|
676
|
+
checkout --force`.
|
677
|
+
D
|
678
|
+
def pristine(*gems)
|
558
679
|
require "bundler/cli/pristine"
|
559
|
-
Pristine.new.run
|
680
|
+
Pristine.new(gems).run
|
560
681
|
end
|
561
682
|
|
562
683
|
if Bundler.feature_flag.plugins?
|
563
684
|
require "bundler/cli/plugin"
|
564
|
-
desc "plugin
|
685
|
+
desc "plugin", "Manage the bundler plugins"
|
565
686
|
subcommand "plugin", Plugin
|
566
687
|
end
|
567
688
|
|
@@ -569,14 +690,14 @@ module Bundler
|
|
569
690
|
# into the corresponding `bundle help #{command}` call
|
570
691
|
def self.reformatted_help_args(args)
|
571
692
|
bundler_commands = all_commands.keys
|
572
|
-
help_flags = %w
|
573
|
-
exec_commands = %w
|
693
|
+
help_flags = %w[--help -h]
|
694
|
+
exec_commands = %w[e ex exe exec]
|
574
695
|
help_used = args.index {|a| help_flags.include? a }
|
575
696
|
exec_used = args.index {|a| exec_commands.include? a }
|
576
697
|
command = args.find {|a| bundler_commands.include? a }
|
577
698
|
if exec_used && help_used
|
578
699
|
if exec_used + help_used == 1
|
579
|
-
%w
|
700
|
+
%w[help exec]
|
580
701
|
else
|
581
702
|
args
|
582
703
|
end
|
@@ -611,20 +732,35 @@ module Bundler
|
|
611
732
|
end
|
612
733
|
end
|
613
734
|
|
614
|
-
def
|
615
|
-
return unless ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"] || Bundler.ui.debug?
|
735
|
+
def current_command
|
616
736
|
_, _, config = @_initializer
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
737
|
+
config[:current_command]
|
738
|
+
end
|
739
|
+
|
740
|
+
def print_command
|
741
|
+
return unless Bundler.ui.debug?
|
742
|
+
cmd = current_command
|
743
|
+
command_name = cmd.name
|
744
|
+
return if PARSEABLE_COMMANDS.include?(command_name)
|
745
|
+
command = ["bundle", command_name] + args
|
746
|
+
options_to_print = options.dup
|
747
|
+
options_to_print.delete_if do |k, v|
|
748
|
+
next unless o = cmd.options[k]
|
749
|
+
o.default == v
|
750
|
+
end
|
751
|
+
command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
|
621
752
|
command.reject!(&:empty?)
|
622
753
|
Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler::VERSION}"
|
623
754
|
end
|
624
755
|
|
625
|
-
def
|
756
|
+
def warn_on_outdated_bundler
|
626
757
|
return if Bundler.settings[:disable_version_check]
|
627
758
|
|
759
|
+
command_name = current_command.name
|
760
|
+
return if PARSEABLE_COMMANDS.include?(command_name)
|
761
|
+
|
762
|
+
return unless SharedHelpers.md5_available?
|
763
|
+
|
628
764
|
latest = Fetcher::CompactIndex.
|
629
765
|
new(nil, Source::Rubygems::Remote.new(URI("https://rubygems.org")), nil).
|
630
766
|
send(:compact_index_client).
|
@@ -636,11 +772,19 @@ module Bundler
|
|
636
772
|
|
637
773
|
current = Gem::Version.new(VERSION)
|
638
774
|
return if current >= latest
|
775
|
+
latest_installed = Bundler.rubygems.find_name("bundler").map(&:version).max
|
776
|
+
|
777
|
+
installation = "To install the latest version, run `gem install bundler#{" --pre" if latest.prerelease?}`"
|
778
|
+
if latest_installed && latest_installed > current
|
779
|
+
suggestion = "To update to the most recent installed version (#{latest_installed}), run `bundle update --bundler`"
|
780
|
+
suggestion = "#{installation}\n#{suggestion}" if latest_installed < latest
|
781
|
+
else
|
782
|
+
suggestion = installation
|
783
|
+
end
|
639
784
|
|
640
|
-
Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\
|
641
|
-
rescue
|
785
|
+
Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\n#{suggestion}"
|
786
|
+
rescue RuntimeError
|
642
787
|
nil
|
643
788
|
end
|
644
|
-
private_class_method :warn_on_outdated_bundler
|
645
789
|
end
|
646
790
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require "digest/md5"
|
3
2
|
|
4
3
|
module Bundler
|
5
4
|
class CompactIndexClient
|
@@ -68,7 +67,7 @@ module Bundler
|
|
68
67
|
def info_path(name)
|
69
68
|
name = name.to_s
|
70
69
|
if name =~ /[^a-z0-9_-]/
|
71
|
-
name += "-#{
|
70
|
+
name += "-#{SharedHelpers.digest(:MD5).hexdigest(name).downcase}"
|
72
71
|
info_roots.last.join(name)
|
73
72
|
else
|
74
73
|
info_roots.first.join(name)
|