bundler 1.17.2 → 2.1.0
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 +4 -4
- data/CHANGELOG.md +799 -571
- data/LICENSE.md +18 -19
- data/README.md +9 -8
- data/bundler.gemspec +8 -25
- data/exe/bundle +19 -3
- data/lib/bundler.rb +202 -87
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/capistrano.rb +4 -4
- data/lib/bundler/cli.rb +178 -140
- data/lib/bundler/cli/add.rb +28 -16
- data/lib/bundler/cli/cache.rb +25 -13
- data/lib/bundler/cli/common.rb +11 -12
- data/lib/bundler/cli/config.rb +161 -86
- data/lib/bundler/cli/console.rb +1 -1
- data/lib/bundler/cli/doctor.rb +4 -4
- data/lib/bundler/cli/exec.rb +15 -18
- data/lib/bundler/cli/gem.rb +5 -5
- data/lib/bundler/cli/info.rb +17 -5
- data/lib/bundler/cli/init.rb +1 -1
- data/lib/bundler/cli/install.rb +11 -10
- data/lib/bundler/cli/issue.rb +3 -3
- data/lib/bundler/cli/open.rb +10 -6
- data/lib/bundler/cli/outdated.rb +85 -81
- data/lib/bundler/cli/plugin.rb +9 -2
- data/lib/bundler/cli/pristine.rb +1 -1
- data/lib/bundler/cli/show.rb +1 -1
- data/lib/bundler/cli/update.rb +32 -12
- data/lib/bundler/compact_index_client.rb +25 -9
- data/lib/bundler/compact_index_client/updater.rb +2 -6
- data/lib/bundler/current_ruby.rb +9 -7
- data/lib/bundler/definition.rb +35 -26
- data/lib/bundler/dependency.rb +16 -4
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/dsl.rb +16 -40
- data/lib/bundler/env.rb +8 -13
- data/lib/bundler/environment_preserver.rb +0 -1
- data/lib/bundler/feature_flag.rb +23 -34
- data/lib/bundler/fetcher.rb +16 -13
- data/lib/bundler/fetcher/compact_index.rb +26 -12
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +5 -2
- data/lib/bundler/fetcher/index.rb +5 -3
- data/lib/bundler/friendly_errors.rb +6 -7
- data/lib/bundler/gem_helper.rb +40 -25
- data/lib/bundler/gem_helpers.rb +2 -4
- data/lib/bundler/gem_tasks.rb +1 -1
- data/lib/bundler/gem_version_promoter.rb +3 -3
- data/lib/bundler/graph.rb +2 -2
- data/lib/bundler/injector.rb +10 -8
- data/lib/bundler/inline.rb +40 -30
- data/lib/bundler/installer.rb +7 -14
- data/lib/bundler/installer/gem_installer.rb +5 -1
- data/lib/bundler/installer/parallel_installer.rb +4 -8
- data/lib/bundler/installer/standalone.rb +1 -2
- data/lib/bundler/lazy_specification.rb +2 -3
- data/lib/bundler/lockfile_parser.rb +14 -21
- data/lib/bundler/match_platform.rb +1 -1
- data/lib/bundler/mirror.rb +3 -3
- data/lib/bundler/plugin.rb +42 -29
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/api/source.rb +4 -6
- data/lib/bundler/plugin/index.rb +14 -3
- data/lib/bundler/plugin/installer.rb +28 -15
- data/lib/bundler/psyched_yaml.rb +1 -1
- data/lib/bundler/remote_specification.rb +0 -2
- data/lib/bundler/resolver.rb +72 -24
- data/lib/bundler/resolver/spec_group.rb +3 -2
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_version.rb +4 -19
- data/lib/bundler/rubygems_ext.rb +11 -67
- data/lib/bundler/rubygems_gem_installer.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +142 -402
- data/lib/bundler/runtime.rb +2 -9
- data/lib/bundler/settings.rb +22 -51
- data/lib/bundler/setup.rb +7 -13
- data/lib/bundler/shared_helpers.rb +51 -77
- data/lib/bundler/similarity_detector.rb +2 -2
- data/lib/bundler/source.rb +5 -5
- data/lib/bundler/source/git.rb +24 -17
- data/lib/bundler/source/git/git_proxy.rb +38 -41
- data/lib/bundler/source/metadata.rb +9 -5
- data/lib/bundler/source/path.rb +13 -8
- data/lib/bundler/source/rubygems.rb +14 -8
- data/lib/bundler/source/rubygems/remote.rb +2 -3
- data/lib/bundler/source_list.rb +9 -12
- data/lib/bundler/spec_set.rb +23 -12
- data/lib/bundler/stub_specification.rb +18 -30
- data/lib/bundler/templates/Executable.bundler +23 -14
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +3 -3
- data/lib/bundler/templates/newgem/Gemfile.tt +8 -2
- data/lib/bundler/templates/newgem/README.md.tt +4 -3
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -27
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +1 -1
- data/lib/bundler/templates/newgem/travis.yml.tt +0 -1
- data/lib/bundler/ui.rb +3 -3
- data/lib/bundler/ui/rg_proxy.rb +1 -1
- data/lib/bundler/ui/shell.rb +4 -8
- data/lib/bundler/uri_credentials_filter.rb +7 -3
- data/lib/bundler/vendor/connection_pool/lib/connection_pool.rb +161 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/monotonic_time.rb +66 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/timed_stack.rb +176 -0
- data/lib/bundler/vendor/connection_pool/lib/connection_pool/version.rb +3 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +273 -147
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +6 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +2 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +6 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +30 -8
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +4 -4
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +2 -2
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +273 -304
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb +40 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/pool.rb +53 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/timed_stack_multi.rb +79 -0
- data/lib/bundler/vendor/thor/lib/thor.rb +19 -4
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +27 -12
- data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +7 -17
- data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +16 -7
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +19 -8
- data/lib/bundler/vendor/thor/lib/thor/base.rb +54 -43
- data/lib/bundler/vendor/thor/lib/thor/command.rb +21 -14
- data/lib/bundler/vendor/thor/lib/thor/error.rb +78 -0
- data/lib/bundler/vendor/thor/lib/thor/group.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/invocation.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +6 -6
- data/lib/bundler/vendor/thor/lib/thor/nested_context.rb +29 -0
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +20 -7
- data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +20 -5
- data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +1 -0
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +15 -14
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +62 -8
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +6 -2
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/util.rb +18 -2
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/vendor/uri/lib/uri.rb +104 -0
- data/lib/bundler/vendor/uri/lib/uri/common.rb +744 -0
- data/lib/bundler/vendor/uri/lib/uri/file.rb +94 -0
- data/lib/bundler/vendor/uri/lib/uri/ftp.rb +267 -0
- data/lib/bundler/vendor/uri/lib/uri/generic.rb +1568 -0
- data/lib/bundler/vendor/uri/lib/uri/http.rb +88 -0
- data/lib/bundler/vendor/uri/lib/uri/https.rb +23 -0
- data/lib/bundler/vendor/uri/lib/uri/ldap.rb +261 -0
- data/lib/bundler/vendor/uri/lib/uri/ldaps.rb +21 -0
- data/lib/bundler/vendor/uri/lib/uri/mailto.rb +294 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc2396_parser.rb +546 -0
- data/lib/bundler/vendor/uri/lib/uri/rfc3986_parser.rb +125 -0
- data/lib/bundler/vendor/uri/lib/uri/version.rb +6 -0
- data/lib/bundler/vendored_fileutils.rb +1 -6
- data/lib/bundler/vendored_molinillo.rb +1 -1
- data/lib/bundler/vendored_persistent.rb +7 -5
- data/lib/bundler/vendored_thor.rb +2 -2
- data/lib/bundler/vendored_uri.rb +4 -0
- data/lib/bundler/version.rb +1 -20
- data/lib/bundler/version_ranges.rb +51 -5
- data/lib/bundler/vlad.rb +2 -2
- data/lib/bundler/worker.rb +1 -3
- data/lib/bundler/yaml_serializer.rb +2 -3
- data/man/bundle-add.1 +10 -2
- data/man/bundle-add.1.txt +11 -5
- data/man/bundle-add.ronn +7 -1
- data/man/bundle-binstubs.1 +2 -2
- data/man/bundle-binstubs.1.txt +2 -2
- data/man/bundle-binstubs.ronn +1 -1
- data/man/bundle-cache.1 +55 -0
- data/man/bundle-cache.1.txt +78 -0
- data/man/{bundle-package.ronn → bundle-cache.ronn} +15 -15
- data/man/bundle-check.1 +1 -1
- data/man/bundle-check.1.txt +6 -6
- data/man/bundle-clean.1 +1 -1
- data/man/bundle-clean.1.txt +1 -1
- data/man/bundle-config.1 +36 -36
- data/man/bundle-config.1.txt +66 -67
- data/man/bundle-config.ronn +42 -40
- data/man/bundle-doctor.1 +1 -1
- data/man/bundle-doctor.1.txt +1 -1
- data/man/bundle-exec.1 +2 -2
- data/man/bundle-exec.1.txt +2 -2
- data/man/bundle-exec.ronn +1 -1
- data/man/bundle-gem.1 +1 -1
- data/man/bundle-gem.1.txt +3 -3
- data/man/bundle-info.1 +1 -1
- data/man/bundle-info.1.txt +1 -1
- data/man/bundle-init.1 +2 -2
- data/man/bundle-init.1.txt +2 -2
- data/man/bundle-init.ronn +1 -1
- data/man/bundle-inject.1 +1 -1
- data/man/bundle-inject.1.txt +1 -1
- data/man/bundle-install.1 +8 -5
- data/man/bundle-install.1.txt +56 -51
- data/man/bundle-install.ronn +9 -4
- data/man/bundle-list.1 +1 -1
- data/man/bundle-list.1.txt +1 -1
- data/man/bundle-lock.1 +1 -1
- data/man/bundle-lock.1.txt +16 -16
- data/man/bundle-open.1 +1 -1
- data/man/bundle-open.1.txt +1 -1
- data/man/bundle-outdated.1 +1 -1
- data/man/bundle-outdated.1.txt +1 -1
- data/man/bundle-platform.1 +1 -1
- data/man/bundle-platform.1.txt +1 -1
- data/man/bundle-pristine.1 +1 -1
- data/man/bundle-pristine.1.txt +1 -1
- data/man/bundle-remove.1 +1 -1
- data/man/bundle-remove.1.txt +1 -1
- data/man/bundle-show.1 +1 -1
- data/man/bundle-show.1.txt +1 -1
- data/man/bundle-update.1 +4 -4
- data/man/bundle-update.1.txt +64 -65
- data/man/bundle-update.ronn +3 -3
- data/man/bundle-viz.1 +1 -1
- data/man/bundle-viz.1.txt +1 -1
- data/man/bundle.1 +7 -3
- data/man/bundle.1.txt +11 -8
- data/man/bundle.ronn +5 -2
- data/man/gemfile.5 +17 -20
- data/man/gemfile.5.ronn +14 -18
- data/man/gemfile.5.txt +108 -112
- data/man/index.txt +1 -1
- metadata +34 -110
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/package.rb +0 -49
- data/lib/bundler/compatibility_guard.rb +0 -14
- data/lib/bundler/gem_remote_fetcher.rb +0 -43
- data/lib/bundler/ssl_certs/.document +0 -1
- data/lib/bundler/ssl_certs/certificate_manager.rb +0 -66
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +0 -21
- data/lib/bundler/ssl_certs/rubygems.global.ssl.fastly.net/DigiCertHighAssuranceEVRootCA.pem +0 -23
- data/lib/bundler/ssl_certs/rubygems.org/AddTrustExternalCARoot.pem +0 -25
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/faster.rb +0 -27
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/ssl_reuse.rb +0 -129
- data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +0 -12
- data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +0 -129
- data/man/bundle-package.1 +0 -55
- data/man/bundle-package.1.txt +0 -79
data/lib/bundler/cli/console.rb
CHANGED
@@ -12,7 +12,7 @@ module Bundler
|
|
12
12
|
Bundler::SharedHelpers.major_deprecation 2, "bundle console will be replaced " \
|
13
13
|
"by `bin/console` generated by `bundle gem <name>`"
|
14
14
|
|
15
|
-
group ? Bundler.require(:default, *
|
15
|
+
group ? Bundler.require(:default, *group.split.map!(&:to_sym)) : Bundler.require
|
16
16
|
ARGV.clear
|
17
17
|
|
18
18
|
console = get_console(Bundler.settings[:console] || "irb")
|
data/lib/bundler/cli/doctor.rb
CHANGED
@@ -4,8 +4,8 @@ require "rbconfig"
|
|
4
4
|
|
5
5
|
module Bundler
|
6
6
|
class CLI::Doctor
|
7
|
-
DARWIN_REGEX = /\s+(.+) \(compatibility
|
8
|
-
LDD_REGEX = /\t\S+ => (\S+) \(\S+\)
|
7
|
+
DARWIN_REGEX = /\s+(.+) \(compatibility /.freeze
|
8
|
+
LDD_REGEX = /\t\S+ => (\S+) \(\S+\)/.freeze
|
9
9
|
|
10
10
|
attr_reader :options
|
11
11
|
|
@@ -56,7 +56,7 @@ module Bundler
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def check!
|
59
|
-
|
59
|
+
require_relative "check"
|
60
60
|
Bundler::CLI::Check.new({}).run
|
61
61
|
end
|
62
62
|
|
@@ -100,7 +100,7 @@ module Bundler
|
|
100
100
|
files_not_readable_or_writable = []
|
101
101
|
files_not_rw_and_owned_by_different_user = []
|
102
102
|
files_not_owned_by_current_user_but_still_rw = []
|
103
|
-
Find.find(Bundler.
|
103
|
+
Find.find(Bundler.bundle_path.to_s).each do |f|
|
104
104
|
if !File.writable?(f) || !File.readable?(f)
|
105
105
|
if File.stat(f).uid != Process.uid
|
106
106
|
files_not_rw_and_owned_by_different_user << f
|
data/lib/bundler/cli/exec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../current_ruby"
|
4
4
|
|
5
5
|
module Bundler
|
6
6
|
class CLI::Exec
|
@@ -13,7 +13,7 @@ module Bundler
|
|
13
13
|
@cmd = args.shift
|
14
14
|
@args = args
|
15
15
|
|
16
|
-
if
|
16
|
+
if !Bundler.current_ruby.jruby?
|
17
17
|
@args << { :close_others => !options.keep_file_descriptors? }
|
18
18
|
elsif options.keep_file_descriptors?
|
19
19
|
Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
|
@@ -25,17 +25,12 @@ module Bundler
|
|
25
25
|
SharedHelpers.set_bundle_environment
|
26
26
|
if bin_path = Bundler.which(cmd)
|
27
27
|
if !Bundler.settings[:disable_exec_load] && ruby_shebang?(bin_path)
|
28
|
-
return kernel_load(bin_path, *args)
|
29
|
-
end
|
30
|
-
# First, try to exec directly to something in PATH
|
31
|
-
if Bundler.current_ruby.jruby_18?
|
32
|
-
kernel_exec(bin_path, *args)
|
33
|
-
else
|
34
|
-
kernel_exec([bin_path, cmd], *args)
|
28
|
+
return with_verbose_rubygems { kernel_load(bin_path, *args) }
|
35
29
|
end
|
30
|
+
with_verbose_rubygems { kernel_exec(bin_path, *args) }
|
36
31
|
else
|
37
32
|
# exec using the given command
|
38
|
-
kernel_exec(cmd, *args)
|
33
|
+
with_verbose_rubygems { kernel_exec(cmd, *args) }
|
39
34
|
end
|
40
35
|
end
|
41
36
|
|
@@ -48,15 +43,11 @@ module Bundler
|
|
48
43
|
end
|
49
44
|
|
50
45
|
def kernel_exec(*args)
|
51
|
-
ui = Bundler.ui
|
52
|
-
Bundler.ui = nil
|
53
46
|
Kernel.exec(*args)
|
54
47
|
rescue Errno::EACCES, Errno::ENOEXEC
|
55
|
-
Bundler.ui = ui
|
56
48
|
Bundler.ui.error "bundler: not executable: #{cmd}"
|
57
49
|
exit 126
|
58
50
|
rescue Errno::ENOENT
|
59
|
-
Bundler.ui = ui
|
60
51
|
Bundler.ui.error "bundler: command not found: #{cmd}"
|
61
52
|
Bundler.ui.warn "Install missing gem executables with `bundle install`"
|
62
53
|
exit 127
|
@@ -67,15 +58,12 @@ module Bundler
|
|
67
58
|
ARGV.replace(args)
|
68
59
|
$0 = file
|
69
60
|
Process.setproctitle(process_title(file, args)) if Process.respond_to?(:setproctitle)
|
70
|
-
|
71
|
-
Bundler.ui = nil
|
72
|
-
require "bundler/setup"
|
61
|
+
require_relative "../setup"
|
73
62
|
TRAPPED_SIGNALS.each {|s| trap(s, "DEFAULT") }
|
74
63
|
Kernel.load(file)
|
75
64
|
rescue SystemExit, SignalException
|
76
65
|
raise
|
77
66
|
rescue Exception => e # rubocop:disable Lint/RescueException
|
78
|
-
Bundler.ui = ui
|
79
67
|
Bundler.ui.error "bundler: failed to load command: #{cmd} (#{file})"
|
80
68
|
backtrace = e.backtrace ? e.backtrace.take_while {|bt| !bt.start_with?(__FILE__) } : []
|
81
69
|
abort "#{e.class}: #{e.message}\n #{backtrace.join("\n ")}"
|
@@ -101,5 +89,14 @@ module Bundler
|
|
101
89
|
first_line = File.open(file, "rb") {|f| f.read(possibilities.map(&:size).max) }
|
102
90
|
possibilities.any? {|shebang| first_line.start_with?(shebang) }
|
103
91
|
end
|
92
|
+
|
93
|
+
def with_verbose_rubygems
|
94
|
+
old_ui = Gem::DefaultUserInteraction.ui
|
95
|
+
Gem::DefaultUserInteraction.ui = nil
|
96
|
+
|
97
|
+
yield
|
98
|
+
ensure
|
99
|
+
Gem::DefaultUserInteraction.ui = old_ui
|
100
|
+
end
|
104
101
|
end
|
105
102
|
end
|
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.0"
|
14
|
+
"minitest" => "5.0",
|
15
15
|
}.freeze
|
16
16
|
|
17
17
|
attr_reader :options, :gem_name, :thor, :name, :target
|
@@ -57,7 +57,7 @@ module Bundler
|
|
57
57
|
:ext => options[:ext],
|
58
58
|
:exe => options[:exe],
|
59
59
|
:bundler_version => bundler_dependency_version,
|
60
|
-
:github_username => github_username.empty? ? "[USERNAME]" : github_username
|
60
|
+
:github_username => github_username.empty? ? "[USERNAME]" : github_username,
|
61
61
|
}
|
62
62
|
ensure_safe_gem_name(name, constant_array)
|
63
63
|
|
@@ -69,7 +69,7 @@ module Bundler
|
|
69
69
|
"Rakefile.tt" => "Rakefile",
|
70
70
|
"README.md.tt" => "README.md",
|
71
71
|
"bin/console.tt" => "bin/console",
|
72
|
-
"bin/setup.tt" => "bin/setup"
|
72
|
+
"bin/setup.tt" => "bin/setup",
|
73
73
|
}
|
74
74
|
|
75
75
|
executables = %w[
|
@@ -148,7 +148,7 @@ module Bundler
|
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
151
|
-
if Bundler.git_present?
|
151
|
+
if Bundler.git_present? && options[:git]
|
152
152
|
Bundler.ui.info "Initializing git repo in #{target}"
|
153
153
|
Dir.chdir(target) do
|
154
154
|
`git init`
|
@@ -190,7 +190,7 @@ module Bundler
|
|
190
190
|
Bundler.ui.error "You have specified a gem name which does not conform to the \n" \
|
191
191
|
"naming guidelines for C extensions. For more information, \n" \
|
192
192
|
"see the 'Extension Naming' section at the following URL:\n" \
|
193
|
-
"
|
193
|
+
"https://guides.rubygems.org/gems-with-extensions/\n"
|
194
194
|
exit 1
|
195
195
|
end
|
196
196
|
|
data/lib/bundler/cli/info.rb
CHANGED
@@ -9,18 +9,24 @@ module Bundler
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run
|
12
|
+
Bundler.ui.silence do
|
13
|
+
Bundler.definition.validate_runtime!
|
14
|
+
Bundler.load.lock
|
15
|
+
end
|
16
|
+
|
12
17
|
spec = spec_for_gem(gem_name)
|
13
18
|
|
14
|
-
|
15
|
-
|
16
|
-
|
19
|
+
if spec
|
20
|
+
return print_gem_path(spec) if @options[:path]
|
21
|
+
print_gem_info(spec)
|
22
|
+
end
|
17
23
|
end
|
18
24
|
|
19
25
|
private
|
20
26
|
|
21
27
|
def spec_for_gem(gem_name)
|
22
28
|
spec = Bundler.definition.specs.find {|s| s.name == gem_name }
|
23
|
-
spec || default_gem_spec(gem_name)
|
29
|
+
spec || default_gem_spec(gem_name) || Bundler::CLI::Common.select_spec(gem_name, :regex_match)
|
24
30
|
end
|
25
31
|
|
26
32
|
def default_gem_spec(gem_name)
|
@@ -34,7 +40,13 @@ module Bundler
|
|
34
40
|
end
|
35
41
|
|
36
42
|
def print_gem_path(spec)
|
37
|
-
|
43
|
+
path = if spec.name == "bundler"
|
44
|
+
File.expand_path("../../../..", __FILE__)
|
45
|
+
else
|
46
|
+
spec.full_gem_path
|
47
|
+
end
|
48
|
+
|
49
|
+
Bundler.ui.info path
|
38
50
|
end
|
39
51
|
|
40
52
|
def print_gem_info(spec)
|
data/lib/bundler/cli/init.rb
CHANGED
data/lib/bundler/cli/install.rb
CHANGED
@@ -66,7 +66,7 @@ module Bundler
|
|
66
66
|
Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
|
67
67
|
|
68
68
|
Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
|
69
|
-
Bundler::CLI::Common.output_without_groups_message
|
69
|
+
Bundler::CLI::Common.output_without_groups_message(:install)
|
70
70
|
|
71
71
|
if Bundler.use_system_gems?
|
72
72
|
Bundler.ui.confirm "Use `bundle info [gemname]` to see where a bundled gem is installed."
|
@@ -80,7 +80,7 @@ module Bundler
|
|
80
80
|
warn_ambiguous_gems
|
81
81
|
|
82
82
|
if CLI::Common.clean_after_install?
|
83
|
-
|
83
|
+
require_relative "clean"
|
84
84
|
Bundler::CLI::Clean.new(options).run
|
85
85
|
end
|
86
86
|
rescue GemNotFound, VersionConflict => e
|
@@ -202,15 +202,16 @@ module Bundler
|
|
202
202
|
end
|
203
203
|
|
204
204
|
def warn_ambiguous_gems
|
205
|
+
# TODO: remove this when we drop Bundler 1.x support
|
205
206
|
Installer.ambiguous_gems.to_a.each do |name, installed_from_uri, *also_found_in_uris|
|
206
|
-
Bundler.ui.
|
207
|
-
Bundler.ui.
|
208
|
-
Bundler.ui.
|
209
|
-
also_found_in_uris.each {|uri| Bundler.ui.
|
210
|
-
Bundler.ui.
|
211
|
-
Bundler.ui.
|
212
|
-
Bundler.ui.
|
213
|
-
Bundler.ui.
|
207
|
+
Bundler.ui.warn "Warning: the gem '#{name}' was found in multiple sources."
|
208
|
+
Bundler.ui.warn "Installed from: #{installed_from_uri}"
|
209
|
+
Bundler.ui.warn "Also found in:"
|
210
|
+
also_found_in_uris.each {|uri| Bundler.ui.warn " * #{uri}" }
|
211
|
+
Bundler.ui.warn "You should add a source requirement to restrict this gem to your preferred source."
|
212
|
+
Bundler.ui.warn "For example:"
|
213
|
+
Bundler.ui.warn " gem '#{name}', :source => '#{installed_from_uri}'"
|
214
|
+
Bundler.ui.warn "Then uninstall the gem '#{name}' (or delete all bundled gems) and then install again."
|
214
215
|
end
|
215
216
|
end
|
216
217
|
end
|
data/lib/bundler/cli/issue.rb
CHANGED
@@ -13,10 +13,10 @@ module Bundler
|
|
13
13
|
https://github.com/bundler/bundler/blob/master/doc/TROUBLESHOOTING.md
|
14
14
|
|
15
15
|
2. Instructions for common Bundler uses can be found on the documentation
|
16
|
-
site:
|
16
|
+
site: https://bundler.io/
|
17
17
|
|
18
18
|
3. Information about each Bundler command can be found in the Bundler
|
19
|
-
man pages:
|
19
|
+
man pages: https://bundler.io/man/bundle.1.html
|
20
20
|
|
21
21
|
Hopefully the troubleshooting steps above resolved your problem! If things
|
22
22
|
still aren't working the way you expect them to, please let us know so
|
@@ -33,7 +33,7 @@ module Bundler
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def doctor
|
36
|
-
|
36
|
+
require_relative "doctor"
|
37
37
|
Bundler::CLI::Doctor.new({}).run
|
38
38
|
end
|
39
39
|
end
|
data/lib/bundler/cli/open.rb
CHANGED
@@ -14,12 +14,16 @@ module Bundler
|
|
14
14
|
editor = [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }
|
15
15
|
return Bundler.ui.info("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR") unless editor
|
16
16
|
return unless spec = Bundler::CLI::Common.select_spec(name, :regex_match)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
if spec.default_gem?
|
18
|
+
Bundler.ui.info "Unable to open #{name} because it's a default gem, so the directory it would normally be installed to does not exist."
|
19
|
+
else
|
20
|
+
path = spec.full_gem_path
|
21
|
+
Dir.chdir(path) do
|
22
|
+
command = Shellwords.split(editor) + [path]
|
23
|
+
Bundler.with_original_env do
|
24
|
+
system(*command)
|
25
|
+
end || Bundler.ui.info("Could not run '#{command.join(" ")}'")
|
26
|
+
end
|
23
27
|
end
|
24
28
|
end
|
25
29
|
end
|
data/lib/bundler/cli/outdated.rb
CHANGED
@@ -2,17 +2,32 @@
|
|
2
2
|
|
3
3
|
module Bundler
|
4
4
|
class CLI::Outdated
|
5
|
-
attr_reader :options, :gems
|
5
|
+
attr_reader :options, :gems, :options_include_groups, :filter_options_patch, :sources, :strict
|
6
|
+
attr_accessor :outdated_gems_by_groups, :outdated_gems_list
|
6
7
|
|
7
8
|
def initialize(options, gems)
|
8
9
|
@options = options
|
9
10
|
@gems = gems
|
11
|
+
@sources = Array(options[:source])
|
12
|
+
|
13
|
+
@filter_options_patch = options.keys &
|
14
|
+
%w[filter-major filter-minor filter-patch]
|
15
|
+
|
16
|
+
@outdated_gems_by_groups = {}
|
17
|
+
@outdated_gems_list = []
|
18
|
+
|
19
|
+
@options_include_groups = [:group, :groups].any? do |v|
|
20
|
+
options.keys.include?(v.to_s)
|
21
|
+
end
|
22
|
+
|
23
|
+
# the patch level options imply strict is also true. It wouldn't make
|
24
|
+
# sense otherwise.
|
25
|
+
@strict = options["filter-strict"] ||
|
26
|
+
Bundler::CLI::Common.patch_level_options(options).any?
|
10
27
|
end
|
11
28
|
|
12
29
|
def run
|
13
|
-
check_for_deployment_mode
|
14
|
-
|
15
|
-
sources = Array(options[:source])
|
30
|
+
check_for_deployment_mode!
|
16
31
|
|
17
32
|
gems.each do |gem_name|
|
18
33
|
Bundler::CLI::Common.select_spec(gem_name)
|
@@ -20,11 +35,9 @@ module Bundler
|
|
20
35
|
|
21
36
|
Bundler.definition.validate_runtime!
|
22
37
|
current_specs = Bundler.ui.silence { Bundler.definition.resolve }
|
23
|
-
|
24
|
-
Bundler.ui.silence do
|
25
|
-
Bundler.load.dependencies.
|
26
|
-
current_dependencies[dep.name] = dep
|
27
|
-
end
|
38
|
+
|
39
|
+
current_dependencies = Bundler.ui.silence do
|
40
|
+
Bundler.load.dependencies.map {|dep| [dep.name, dep] }.to_h
|
28
41
|
end
|
29
42
|
|
30
43
|
definition = if gems.empty? && sources.empty?
|
@@ -39,14 +52,6 @@ module Bundler
|
|
39
52
|
options
|
40
53
|
)
|
41
54
|
|
42
|
-
# the patch level options imply strict is also true. It wouldn't make
|
43
|
-
# sense otherwise.
|
44
|
-
strict = options[:strict] ||
|
45
|
-
Bundler::CLI::Common.patch_level_options(options).any?
|
46
|
-
|
47
|
-
filter_options_patch = options.keys &
|
48
|
-
%w[filter-major filter-minor filter-patch]
|
49
|
-
|
50
55
|
definition_resolution = proc do
|
51
56
|
options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely!
|
52
57
|
end
|
@@ -58,8 +63,6 @@ module Bundler
|
|
58
63
|
end
|
59
64
|
|
60
65
|
Bundler.ui.info ""
|
61
|
-
outdated_gems_by_groups = {}
|
62
|
-
outdated_gems_list = []
|
63
66
|
|
64
67
|
# Loop through the current specs
|
65
68
|
gemfile_specs, dependency_specs = current_specs.partition do |spec|
|
@@ -76,13 +79,11 @@ module Bundler
|
|
76
79
|
next if !gems.empty? && !gems.include?(current_spec.name)
|
77
80
|
|
78
81
|
dependency = current_dependencies[current_spec.name]
|
79
|
-
active_spec = retrieve_active_spec(
|
82
|
+
active_spec = retrieve_active_spec(definition, current_spec)
|
80
83
|
|
81
84
|
next if active_spec.nil?
|
82
|
-
if filter_options_patch.any?
|
83
|
-
|
84
|
-
next unless update_present
|
85
|
-
end
|
85
|
+
next if filter_options_patch.any? &&
|
86
|
+
!update_present_via_semver_portions(current_spec, active_spec, options)
|
86
87
|
|
87
88
|
gem_outdated = Gem::Version.new(active_spec.version) > Gem::Version.new(current_spec.version)
|
88
89
|
next unless gem_outdated || (current_spec.git_version != active_spec.git_version)
|
@@ -97,34 +98,22 @@ module Bundler
|
|
97
98
|
:groups => groups }
|
98
99
|
|
99
100
|
outdated_gems_by_groups[groups] ||= []
|
100
|
-
outdated_gems_by_groups[groups] <<
|
101
|
-
:current_spec => current_spec,
|
102
|
-
:dependency => dependency,
|
103
|
-
:groups => groups }
|
101
|
+
outdated_gems_by_groups[groups] << outdated_gems_list[-1]
|
104
102
|
end
|
105
103
|
|
106
104
|
if outdated_gems_list.empty?
|
107
|
-
display_nothing_outdated_message
|
105
|
+
display_nothing_outdated_message
|
108
106
|
else
|
109
107
|
unless options[:parseable]
|
110
|
-
|
111
|
-
Bundler.ui.info "Outdated gems included in the bundle (including " \
|
112
|
-
"pre-releases):"
|
113
|
-
else
|
114
|
-
Bundler.ui.info "Outdated gems included in the bundle:"
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
options_include_groups = [:group, :groups].select do |v|
|
119
|
-
options.keys.include?(v.to_s)
|
108
|
+
Bundler.ui.info(header_outdated_message)
|
120
109
|
end
|
121
110
|
|
122
|
-
if options_include_groups
|
111
|
+
if options_include_groups
|
123
112
|
ordered_groups = outdated_gems_by_groups.keys.compact.sort
|
124
|
-
|
113
|
+
ordered_groups.insert(0, nil).each do |groups|
|
125
114
|
gems = outdated_gems_by_groups[groups]
|
126
115
|
contains_group = if groups
|
127
|
-
groups.split(",").include?(options[:group])
|
116
|
+
groups.split(", ").include?(options[:group])
|
128
117
|
else
|
129
118
|
options[:group] == "group"
|
130
119
|
end
|
@@ -132,33 +121,13 @@ module Bundler
|
|
132
121
|
next if (!options[:groups] && !contains_group) || gems.nil?
|
133
122
|
|
134
123
|
unless options[:parseable]
|
135
|
-
|
136
|
-
Bundler.ui.info "===== Group #{groups} ====="
|
137
|
-
else
|
138
|
-
Bundler.ui.info "===== Without group ====="
|
139
|
-
end
|
124
|
+
Bundler.ui.info(header_group_message(groups))
|
140
125
|
end
|
141
126
|
|
142
|
-
gems
|
143
|
-
print_gem(
|
144
|
-
gem[:current_spec],
|
145
|
-
gem[:active_spec],
|
146
|
-
gem[:dependency],
|
147
|
-
groups,
|
148
|
-
options_include_groups.any?
|
149
|
-
)
|
150
|
-
end
|
127
|
+
print_gems(gems)
|
151
128
|
end
|
152
129
|
else
|
153
|
-
outdated_gems_list
|
154
|
-
print_gem(
|
155
|
-
gem[:current_spec],
|
156
|
-
gem[:active_spec],
|
157
|
-
gem[:dependency],
|
158
|
-
gem[:groups],
|
159
|
-
options_include_groups.any?
|
160
|
-
)
|
161
|
-
end
|
130
|
+
print_gems(outdated_gems_list)
|
162
131
|
end
|
163
132
|
|
164
133
|
exit 1
|
@@ -167,7 +136,39 @@ module Bundler
|
|
167
136
|
|
168
137
|
private
|
169
138
|
|
170
|
-
def
|
139
|
+
def groups_text(group_text, groups)
|
140
|
+
"#{group_text}#{groups.split(",").size > 1 ? "s" : ""} \"#{groups}\""
|
141
|
+
end
|
142
|
+
|
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
|
+
def nothing_outdated_message
|
160
|
+
if filter_options_patch.any?
|
161
|
+
display = filter_options_patch.map do |o|
|
162
|
+
o.sub("filter-", "")
|
163
|
+
end.join(" or ")
|
164
|
+
|
165
|
+
"No #{display} updates to display.\n"
|
166
|
+
else
|
167
|
+
"Bundle up to date!\n"
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
def retrieve_active_spec(definition, current_spec)
|
171
172
|
if strict
|
172
173
|
active_spec = definition.find_resolved_spec(current_spec)
|
173
174
|
else
|
@@ -181,21 +182,24 @@ module Bundler
|
|
181
182
|
active_spec
|
182
183
|
end
|
183
184
|
|
184
|
-
def display_nothing_outdated_message
|
185
|
+
def display_nothing_outdated_message
|
185
186
|
unless options[:parseable]
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
end.join(" or ")
|
187
|
+
Bundler.ui.info(nothing_outdated_message)
|
188
|
+
end
|
189
|
+
end
|
190
190
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
191
|
+
def print_gems(gems_list)
|
192
|
+
gems_list.each do |gem|
|
193
|
+
print_gem(
|
194
|
+
gem[:current_spec],
|
195
|
+
gem[:active_spec],
|
196
|
+
gem[:dependency],
|
197
|
+
gem[:groups],
|
198
|
+
)
|
195
199
|
end
|
196
200
|
end
|
197
201
|
|
198
|
-
def print_gem(current_spec, active_spec, dependency, groups
|
202
|
+
def print_gem(current_spec, active_spec, dependency, groups)
|
199
203
|
spec_version = "#{active_spec.version}#{active_spec.git_version}"
|
200
204
|
spec_version += " (from #{active_spec.loaded_from})" if Bundler.ui.debug? && active_spec.loaded_from
|
201
205
|
current_version = "#{current_spec.version}#{current_spec.git_version}"
|
@@ -212,18 +216,18 @@ module Bundler
|
|
212
216
|
elsif options_include_groups || !groups
|
213
217
|
" * #{spec_outdated_info}"
|
214
218
|
else
|
215
|
-
" * #{spec_outdated_info} in
|
219
|
+
" * #{spec_outdated_info} in #{groups_text("group", groups)}"
|
216
220
|
end
|
217
221
|
|
218
222
|
Bundler.ui.info output_message.rstrip
|
219
223
|
end
|
220
224
|
|
221
|
-
def check_for_deployment_mode
|
225
|
+
def check_for_deployment_mode!
|
222
226
|
return unless Bundler.frozen_bundle?
|
223
227
|
suggested_command = if Bundler.settings.locations("frozen")[:global]
|
224
|
-
"bundle config
|
228
|
+
"bundle config unset frozen"
|
225
229
|
elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
|
226
|
-
"bundle config
|
230
|
+
"bundle config unset deployment"
|
227
231
|
else
|
228
232
|
"bundle install --no-deployment"
|
229
233
|
end
|
@@ -260,7 +264,7 @@ module Bundler
|
|
260
264
|
|
261
265
|
def get_version_semver_portion_value(spec, version_portion_index)
|
262
266
|
version_section = spec.version.segments[version_portion_index, 1]
|
263
|
-
version_section.
|
267
|
+
version_section.to_a[0].to_i
|
264
268
|
end
|
265
269
|
end
|
266
270
|
end
|