bundler 2.0.2 → 2.1.0.pre.1
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 +687 -574
- data/LICENSE.md +18 -19
- data/README.md +8 -7
- data/bundler.gemspec +5 -23
- data/exe/bundle +19 -3
- data/lib/bundler.rb +121 -68
- data/lib/bundler/build_metadata.rb +3 -3
- data/lib/bundler/capistrano.rb +5 -5
- data/lib/bundler/cli.rb +130 -124
- data/lib/bundler/cli/add.rb +27 -16
- data/lib/bundler/cli/common.rb +10 -11
- data/lib/bundler/cli/config.rb +161 -86
- data/lib/bundler/cli/console.rb +2 -2
- data/lib/bundler/cli/doctor.rb +4 -4
- data/lib/bundler/cli/exec.rb +4 -9
- 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 +3 -3
- data/lib/bundler/cli/issue.rb +1 -1
- data/lib/bundler/cli/open.rb +10 -6
- data/lib/bundler/cli/outdated.rb +85 -81
- data/lib/bundler/cli/package.rb +8 -9
- 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 +8 -7
- data/lib/bundler/definition.rb +33 -26
- data/lib/bundler/dependency.rb +16 -4
- data/lib/bundler/deployment.rb +2 -2
- data/lib/bundler/dsl.rb +18 -42
- data/lib/bundler/env.rb +6 -5
- data/lib/bundler/environment_preserver.rb +0 -1
- data/lib/bundler/feature_flag.rb +0 -12
- data/lib/bundler/fetcher.rb +14 -11
- data/lib/bundler/fetcher/compact_index.rb +26 -12
- data/lib/bundler/fetcher/dependency.rb +1 -1
- data/lib/bundler/fetcher/downloader.rb +3 -0
- data/lib/bundler/fetcher/index.rb +4 -2
- data/lib/bundler/friendly_errors.rb +4 -5
- data/lib/bundler/gem_helper.rb +8 -8
- 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 +3 -1
- data/lib/bundler/inline.rb +19 -18
- data/lib/bundler/installer.rb +7 -14
- data/lib/bundler/installer/gem_installer.rb +5 -1
- data/lib/bundler/installer/parallel_installer.rb +4 -4
- data/lib/bundler/installer/standalone.rb +1 -2
- data/lib/bundler/lazy_specification.rb +2 -2
- data/lib/bundler/lockfile_parser.rb +13 -21
- data/lib/bundler/match_platform.rb +1 -1
- data/lib/bundler/plugin.rb +29 -18
- data/lib/bundler/plugin/api.rb +1 -1
- data/lib/bundler/plugin/api/source.rb +2 -2
- data/lib/bundler/plugin/index.rb +10 -2
- data/lib/bundler/plugin/installer.rb +28 -15
- data/lib/bundler/psyched_yaml.rb +1 -1
- data/lib/bundler/resolver.rb +72 -24
- data/lib/bundler/resolver/spec_group.rb +2 -2
- data/lib/bundler/retry.rb +2 -2
- data/lib/bundler/ruby_version.rb +4 -19
- data/lib/bundler/rubygems_ext.rb +10 -65
- data/lib/bundler/rubygems_gem_installer.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +135 -403
- data/lib/bundler/runtime.rb +2 -9
- data/lib/bundler/settings.rb +15 -48
- data/lib/bundler/setup.rb +6 -5
- data/lib/bundler/shared_helpers.rb +53 -68
- data/lib/bundler/similarity_detector.rb +2 -2
- data/lib/bundler/source.rb +5 -5
- data/lib/bundler/source/git.rb +19 -12
- data/lib/bundler/source/git/git_proxy.rb +35 -39
- data/lib/bundler/source/metadata.rb +7 -2
- data/lib/bundler/source/path.rb +13 -8
- data/lib/bundler/source/rubygems.rb +11 -5
- data/lib/bundler/source/rubygems/remote.rb +1 -2
- data/lib/bundler/source_list.rb +9 -12
- data/lib/bundler/spec_set.rb +1 -6
- data/lib/bundler/stub_specification.rb +18 -30
- data/lib/bundler/templates/Executable.bundler +22 -13
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +3 -3
- data/lib/bundler/templates/newgem/Gemfile.tt +8 -0
- data/lib/bundler/templates/newgem/README.md.tt +4 -3
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -18
- data/lib/bundler/templates/newgem/test/test_helper.rb.tt +0 -4
- 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/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 +1 -1
- 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 +248 -279
- 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 +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions.rb +7 -7
- 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 +1 -1
- data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/base.rb +13 -13
- data/lib/bundler/vendor/thor/lib/thor/group.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +2 -2
- data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/runner.rb +4 -4
- data/lib/bundler/vendor/thor/lib/thor/shell.rb +3 -3
- data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +1 -1
- data/lib/bundler/vendor/thor/lib/thor/util.rb +1 -1
- 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/version.rb +1 -20
- data/lib/bundler/version_ranges.rb +51 -5
- data/lib/bundler/vlad.rb +3 -3
- 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-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 +35 -35
- data/man/bundle-config.1.txt +65 -66
- data/man/bundle-config.ronn +41 -39
- data/man/bundle-doctor.1 +1 -1
- data/man/bundle-doctor.1.txt +1 -1
- data/man/bundle-exec.1 +1 -1
- data/man/bundle-exec.1.txt +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 +1 -1
- data/man/bundle-init.1.txt +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-package.1 +1 -1
- data/man/bundle-package.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 +2 -2
- data/man/bundle.1.txt +7 -7
- data/man/bundle.ronn +1 -1
- data/man/gemfile.5 +12 -15
- data/man/gemfile.5.ronn +9 -13
- data/man/gemfile.5.txt +103 -107
- metadata +11 -112
- data/exe/bundle_ruby +0 -60
- data/lib/bundler/cli/cache.rb +0 -36
- data/lib/bundler/compatibility_guard.rb +0 -13
- 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/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
@@ -53,7 +53,7 @@ module Bundler
|
|
53
53
|
Bundler::Fetcher.disable_endpoint = options["full-index"]
|
54
54
|
|
55
55
|
if options["binstubs"]
|
56
|
-
Bundler::SharedHelpers.major_deprecation
|
56
|
+
Bundler::SharedHelpers.major_deprecation 2,
|
57
57
|
"The --binstubs option will be removed in favor of `bundle binstubs`"
|
58
58
|
end
|
59
59
|
|
@@ -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
|
data/lib/bundler/cli/issue.rb
CHANGED
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
|
data/lib/bundler/cli/package.rb
CHANGED
@@ -11,7 +11,6 @@ module Bundler
|
|
11
11
|
def run
|
12
12
|
Bundler.ui.level = "error" if options[:quiet]
|
13
13
|
Bundler.settings.set_command_option_if_given :path, options[:path]
|
14
|
-
Bundler.settings.set_command_option_if_given :cache_all_platforms, options["all-platforms"]
|
15
14
|
Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
|
16
15
|
|
17
16
|
setup_cache_all
|
@@ -19,30 +18,30 @@ module Bundler
|
|
19
18
|
|
20
19
|
# TODO: move cache contents here now that all bundles are locked
|
21
20
|
custom_path = Bundler.settings[:path] if options[:path]
|
22
|
-
|
21
|
+
|
22
|
+
Bundler.settings.temporary(:cache_all_platforms => options["all-platforms"]) do
|
23
|
+
Bundler.load.cache(custom_path)
|
24
|
+
end
|
23
25
|
end
|
24
26
|
|
25
27
|
private
|
26
28
|
|
27
29
|
def install
|
28
|
-
|
30
|
+
require_relative "install"
|
29
31
|
options = self.options.dup
|
30
|
-
if Bundler.settings[:cache_all_platforms]
|
31
|
-
options["local"] = false
|
32
|
-
options["update"] = true
|
33
|
-
end
|
32
|
+
options["local"] = false if Bundler.settings[:cache_all_platforms]
|
34
33
|
Bundler::CLI::Install.new(options).run
|
35
34
|
end
|
36
35
|
|
37
36
|
def setup_cache_all
|
38
|
-
all = options.fetch(:all, Bundler.feature_flag.
|
37
|
+
all = options.fetch(:all, Bundler.feature_flag.cache_all? || nil)
|
39
38
|
|
40
39
|
Bundler.settings.set_command_option_if_given :cache_all, all
|
41
40
|
|
42
41
|
if Bundler.definition.has_local_dependencies? && !Bundler.feature_flag.cache_all?
|
43
42
|
Bundler.ui.warn "Your Gemfile contains path and git dependencies. If you want " \
|
44
43
|
"to package them as well, please pass the --all flag. This will be the default " \
|
45
|
-
"on Bundler
|
44
|
+
"on Bundler 3.0."
|
46
45
|
end
|
47
46
|
end
|
48
47
|
end
|