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/definition.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "bundler/lockfile_parser"
|
3
|
-
require "digest/sha1"
|
4
4
|
require "set"
|
5
5
|
|
6
6
|
module Bundler
|
@@ -9,12 +9,13 @@ module Bundler
|
|
9
9
|
|
10
10
|
attr_reader(
|
11
11
|
:dependencies,
|
12
|
-
:gem_version_promoter,
|
13
12
|
:locked_deps,
|
14
13
|
:locked_gems,
|
15
14
|
:platforms,
|
16
15
|
:requires,
|
17
|
-
:ruby_version
|
16
|
+
:ruby_version,
|
17
|
+
:lockfile,
|
18
|
+
:gemfiles
|
18
19
|
)
|
19
20
|
|
20
21
|
# Given a gemfile and lockfile creates a Bundler definition
|
@@ -51,8 +52,16 @@ module Bundler
|
|
51
52
|
# to be updated or true if all gems should be updated
|
52
53
|
# @param ruby_version [Bundler::RubyVersion, nil] Requested Ruby Version
|
53
54
|
# @param optional_groups [Array(String)] A list of optional groups
|
54
|
-
def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [])
|
55
|
-
|
55
|
+
def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [], gemfiles = [])
|
56
|
+
if [true, false].include?(unlock)
|
57
|
+
@unlocking_bundler = false
|
58
|
+
@unlocking = unlock
|
59
|
+
else
|
60
|
+
unlock = unlock.dup
|
61
|
+
@unlocking_bundler = unlock.delete(:bundler)
|
62
|
+
unlock.delete_if {|_k, v| Array(v).empty? }
|
63
|
+
@unlocking = !unlock.empty?
|
64
|
+
end
|
56
65
|
|
57
66
|
@dependencies = dependencies
|
58
67
|
@sources = sources
|
@@ -61,11 +70,13 @@ module Bundler
|
|
61
70
|
@remote = false
|
62
71
|
@specs = nil
|
63
72
|
@ruby_version = ruby_version
|
73
|
+
@gemfiles = gemfiles
|
64
74
|
|
65
75
|
@lockfile = lockfile
|
66
76
|
@lockfile_contents = String.new
|
67
77
|
@locked_bundler_version = nil
|
68
78
|
@locked_ruby_version = nil
|
79
|
+
@locked_specs_incomplete_for_platform = false
|
69
80
|
|
70
81
|
if lockfile && File.exist?(lockfile)
|
71
82
|
@lockfile_contents = Bundler.read_file(lockfile)
|
@@ -102,36 +113,36 @@ module Bundler
|
|
102
113
|
end
|
103
114
|
@unlocking ||= @unlock[:ruby] ||= (!@locked_ruby_version ^ !@ruby_version)
|
104
115
|
|
105
|
-
add_current_platform unless Bundler.
|
116
|
+
add_current_platform unless Bundler.frozen_bundle?
|
106
117
|
|
107
118
|
converge_path_sources_to_gemspec_sources
|
108
119
|
@path_changes = converge_paths
|
109
120
|
@source_changes = converge_sources
|
110
121
|
|
111
122
|
unless @unlock[:lock_shared_dependencies]
|
112
|
-
eager_unlock = expand_dependencies(@unlock[:gems])
|
113
|
-
@unlock[:gems] = @locked_specs.for(eager_unlock).map(&:name)
|
123
|
+
eager_unlock = expand_dependencies(@unlock[:gems], true)
|
124
|
+
@unlock[:gems] = @locked_specs.for(eager_unlock, [], false, false, false).map(&:name)
|
114
125
|
end
|
115
126
|
|
116
|
-
@gem_version_promoter = create_gem_version_promoter
|
117
|
-
|
118
127
|
@dependency_changes = converge_dependencies
|
119
128
|
@local_changes = converge_locals
|
120
129
|
|
121
130
|
@requires = compute_requires
|
122
131
|
end
|
123
132
|
|
124
|
-
def
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
133
|
+
def gem_version_promoter
|
134
|
+
@gem_version_promoter ||= begin
|
135
|
+
locked_specs =
|
136
|
+
if unlocking? && @locked_specs.empty? && !@lockfile_contents.empty?
|
137
|
+
# Definition uses an empty set of locked_specs to indicate all gems
|
138
|
+
# are unlocked, but GemVersionPromoter needs the locked_specs
|
139
|
+
# for conservative comparison.
|
140
|
+
Bundler::SpecSet.new(@locked_gems.specs)
|
141
|
+
else
|
142
|
+
@locked_specs
|
143
|
+
end
|
144
|
+
GemVersionPromoter.new(locked_specs, @unlock[:gems])
|
145
|
+
end
|
135
146
|
end
|
136
147
|
|
137
148
|
def resolve_with_cache!
|
@@ -164,12 +175,11 @@ module Bundler
|
|
164
175
|
raise GemNotFound, "Your bundle is locked to #{locked_gem}, but that version could not " \
|
165
176
|
"be found in any of the sources listed in your Gemfile. If you haven't changed sources, " \
|
166
177
|
"that means the author of #{locked_gem} has removed it. You'll need to update your bundle " \
|
167
|
-
"to a
|
178
|
+
"to a version other than #{locked_gem} that hasn't been removed in order to install."
|
168
179
|
end
|
169
180
|
unless specs["bundler"].any?
|
170
|
-
|
171
|
-
bundler =
|
172
|
-
specs["bundler"] = bundler if bundler
|
181
|
+
bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
|
182
|
+
specs["bundler"] = bundler
|
173
183
|
end
|
174
184
|
|
175
185
|
specs
|
@@ -194,10 +204,19 @@ module Bundler
|
|
194
204
|
missing
|
195
205
|
end
|
196
206
|
|
197
|
-
def
|
198
|
-
missing =
|
199
|
-
|
200
|
-
missing
|
207
|
+
def missing_specs?
|
208
|
+
missing = missing_specs
|
209
|
+
return false if missing.empty?
|
210
|
+
Bundler.ui.debug "The definition is missing #{missing.map(&:full_name)}"
|
211
|
+
true
|
212
|
+
rescue BundlerError => e
|
213
|
+
@index = nil
|
214
|
+
@resolve = nil
|
215
|
+
@specs = nil
|
216
|
+
@gem_version_promoter = nil
|
217
|
+
|
218
|
+
Bundler.ui.debug "The definition is missing dependencies, failed to resolve & materialize locally (#{e})"
|
219
|
+
true
|
201
220
|
end
|
202
221
|
|
203
222
|
def requested_specs
|
@@ -226,14 +245,22 @@ module Bundler
|
|
226
245
|
def resolve
|
227
246
|
@resolve ||= begin
|
228
247
|
last_resolve = converge_locked_specs
|
229
|
-
|
230
|
-
Bundler.
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
248
|
+
resolve =
|
249
|
+
if Bundler.frozen_bundle?
|
250
|
+
Bundler.ui.debug "Frozen, using resolution from the lockfile"
|
251
|
+
last_resolve
|
252
|
+
elsif !unlocking? && nothing_changed?
|
253
|
+
Bundler.ui.debug("Found no changes, using resolution from the lockfile")
|
254
|
+
last_resolve
|
255
|
+
else
|
256
|
+
# Run a resolve against the locally available gems
|
257
|
+
Bundler.ui.debug("Found changes from the lockfile, re-resolving dependencies because #{change_reason}")
|
258
|
+
last_resolve.merge Resolver.resolve(expanded_dependencies, index, source_requirements, last_resolve, gem_version_promoter, additional_base_requirements_for_resolve, platforms)
|
259
|
+
end
|
260
|
+
|
261
|
+
# filter out gems that _can_ be installed on multiple platforms, but don't need
|
262
|
+
# to be
|
263
|
+
resolve.for(expand_dependencies(dependencies, true), [], false, false, false)
|
237
264
|
end
|
238
265
|
end
|
239
266
|
|
@@ -242,25 +269,44 @@ module Bundler
|
|
242
269
|
dependency_names = @dependencies.map(&:name)
|
243
270
|
|
244
271
|
sources.all_sources.each do |source|
|
245
|
-
source.dependency_names = dependency_names
|
272
|
+
source.dependency_names = dependency_names - pinned_spec_names(source)
|
246
273
|
idx.add_source source.specs
|
247
|
-
dependency_names -= pinned_spec_names(source.specs)
|
248
274
|
dependency_names.concat(source.unmet_deps).uniq!
|
249
275
|
end
|
250
|
-
idx << Gem::Specification.new("ruby\0", RubyVersion.system.to_gem_version_with_patchlevel)
|
251
|
-
idx << Gem::Specification.new("rubygems\0", Gem::VERSION)
|
252
|
-
end
|
253
|
-
end
|
254
276
|
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
277
|
+
double_check_for_index(idx, dependency_names)
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
# Suppose the gem Foo depends on the gem Bar. Foo exists in Source A. Bar has some versions that exist in both
|
282
|
+
# sources A and B. At this point, the API request will have found all the versions of Bar in source A,
|
283
|
+
# but will not have found any versions of Bar from source B, which is a problem if the requested version
|
284
|
+
# of Foo specifically depends on a version of Bar that is only found in source B. This ensures that for
|
285
|
+
# each spec we found, we add all possible versions from all sources to the index.
|
286
|
+
def double_check_for_index(idx, dependency_names)
|
287
|
+
pinned_names = pinned_spec_names
|
288
|
+
loop do
|
289
|
+
idxcount = idx.size
|
290
|
+
|
291
|
+
names = :names # do this so we only have to traverse to get dependency_names from the index once
|
292
|
+
unmet_dependency_names = lambda do
|
293
|
+
return names unless names == :names
|
294
|
+
new_names = sources.all_sources.map(&:dependency_names_to_double_check)
|
295
|
+
return names = nil if new_names.compact!
|
296
|
+
names = new_names.flatten(1).concat(dependency_names)
|
297
|
+
names.uniq!
|
298
|
+
names -= pinned_names
|
299
|
+
names
|
300
|
+
end
|
301
|
+
|
302
|
+
sources.all_sources.each do |source|
|
303
|
+
source.double_check_for(unmet_dependency_names)
|
261
304
|
end
|
305
|
+
|
306
|
+
break if idxcount == idx.size
|
262
307
|
end
|
263
308
|
end
|
309
|
+
private :double_check_for_index
|
264
310
|
|
265
311
|
def has_rubygems_remotes?
|
266
312
|
sources.rubygems_sources.any? {|s| s.remotes.any? }
|
@@ -295,10 +341,11 @@ module Bundler
|
|
295
341
|
end
|
296
342
|
end
|
297
343
|
|
298
|
-
preserve_unknown_sections ||= !updating_major && (Bundler.
|
299
|
-
|
344
|
+
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
|
345
|
+
|
346
|
+
return if file && File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
|
300
347
|
|
301
|
-
if Bundler.
|
348
|
+
if Bundler.frozen_bundle?
|
302
349
|
Bundler.ui.error "Cannot write a changed lockfile while frozen."
|
303
350
|
return
|
304
351
|
end
|
@@ -338,51 +385,8 @@ module Bundler
|
|
338
385
|
end
|
339
386
|
|
340
387
|
def to_lock
|
341
|
-
|
342
|
-
|
343
|
-
sources.lock_sources.each do |source|
|
344
|
-
# Add the source header
|
345
|
-
out << source.to_lock
|
346
|
-
# Find all specs for this source
|
347
|
-
resolve.
|
348
|
-
select {|s| source.can_lock?(s) }.
|
349
|
-
# This needs to be sorted by full name so that
|
350
|
-
# gems with the same name, but different platform
|
351
|
-
# are ordered consistently
|
352
|
-
sort_by(&:full_name).
|
353
|
-
each do |spec|
|
354
|
-
next if spec.name == "bundler"
|
355
|
-
out << spec.to_lock
|
356
|
-
end
|
357
|
-
out << "\n"
|
358
|
-
end
|
359
|
-
|
360
|
-
out << "PLATFORMS\n"
|
361
|
-
|
362
|
-
platforms.map(&:to_s).sort.each do |p|
|
363
|
-
out << " #{p}\n"
|
364
|
-
end
|
365
|
-
|
366
|
-
out << "\n"
|
367
|
-
out << "DEPENDENCIES\n"
|
368
|
-
|
369
|
-
handled = []
|
370
|
-
dependencies.sort_by(&:to_s).each do |dep|
|
371
|
-
next if handled.include?(dep.name)
|
372
|
-
out << dep.to_lock
|
373
|
-
handled << dep.name
|
374
|
-
end
|
375
|
-
|
376
|
-
if locked_ruby_version
|
377
|
-
out << "\nRUBY VERSION\n"
|
378
|
-
out << " #{locked_ruby_version}\n"
|
379
|
-
end
|
380
|
-
|
381
|
-
# Record the version of Bundler that was used to create the lockfile
|
382
|
-
out << "\nBUNDLED WITH\n"
|
383
|
-
out << " #{locked_bundler_version}\n"
|
384
|
-
|
385
|
-
out
|
388
|
+
require "bundler/lockfile_generator"
|
389
|
+
LockfileGenerator.generate(self)
|
386
390
|
end
|
387
391
|
|
388
392
|
def ensure_equivalent_gemfile_and_lockfile(explicit_flag = false)
|
@@ -392,8 +396,13 @@ module Bundler
|
|
392
396
|
"updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
|
393
397
|
|
394
398
|
unless explicit_flag
|
395
|
-
|
396
|
-
|
399
|
+
suggested_command = if Bundler.settings.locations("frozen")[:global]
|
400
|
+
"bundle config --delete frozen"
|
401
|
+
elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any?
|
402
|
+
"bundle config --delete deployment"
|
403
|
+
else
|
404
|
+
"bundle install --no-deployment"
|
405
|
+
end
|
397
406
|
msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
|
398
407
|
"freeze \nby running `#{suggested_command}`."
|
399
408
|
end
|
@@ -417,8 +426,8 @@ module Bundler
|
|
417
426
|
|
418
427
|
# Check if it is possible that the source is only changed thing
|
419
428
|
if (new_deps.empty? && deleted_deps.empty?) && (!new_sources.empty? && !deleted_sources.empty?)
|
420
|
-
new_sources.reject! {|source| source.
|
421
|
-
deleted_sources.reject! {|source| source.
|
429
|
+
new_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
|
430
|
+
deleted_sources.reject! {|source| (source.path? && source.path.exist?) || equivalent_rubygems_remotes?(source) }
|
422
431
|
end
|
423
432
|
|
424
433
|
if @locked_sources != gemfile_sources
|
@@ -511,7 +520,7 @@ module Bundler
|
|
511
520
|
|
512
521
|
def add_current_platform
|
513
522
|
current_platform = Bundler.local_platform
|
514
|
-
add_platform(current_platform) if Bundler.
|
523
|
+
add_platform(current_platform) if Bundler.feature_flag.specific_platform?
|
515
524
|
add_platform(generic(current_platform))
|
516
525
|
end
|
517
526
|
|
@@ -527,7 +536,7 @@ module Bundler
|
|
527
536
|
private :sources
|
528
537
|
|
529
538
|
def nothing_changed?
|
530
|
-
!@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes
|
539
|
+
!@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@locked_specs_incomplete_for_platform
|
531
540
|
end
|
532
541
|
|
533
542
|
def unlocking?
|
@@ -554,14 +563,12 @@ module Bundler
|
|
554
563
|
[@new_platform, "you added a new platform to your gemfile"],
|
555
564
|
[@path_changes, "the gemspecs for path gems changed"],
|
556
565
|
[@local_changes, "the gemspecs for git local gems changed"],
|
566
|
+
[@locked_specs_incomplete_for_platform, "the lockfile does not have all gems needed for the current platform"],
|
557
567
|
].select(&:first).map(&:last).join(", ")
|
558
568
|
end
|
559
569
|
|
560
570
|
def pretty_dep(dep, source = false)
|
561
|
-
|
562
|
-
msg << " (#{dep.requirement})" unless dep.requirement == Gem::Requirement.default
|
563
|
-
msg << " from the `#{dep.source}` source" if source && dep.source
|
564
|
-
msg
|
571
|
+
SharedHelpers.pretty_dependency(dep, source)
|
565
572
|
end
|
566
573
|
|
567
574
|
# Check if the specs of the given source changed
|
@@ -585,6 +592,9 @@ module Bundler
|
|
585
592
|
|
586
593
|
# order here matters, since Index#== is checking source.specs.include?(locked_index)
|
587
594
|
locked_index != source.specs
|
595
|
+
rescue PathError, GitError => e
|
596
|
+
Bundler.ui.debug "Assuming that #{source} has not changed since fetching its specs errored (#{e})"
|
597
|
+
false
|
588
598
|
end
|
589
599
|
|
590
600
|
# Get all locals and override their matching sources.
|
@@ -632,22 +642,32 @@ module Bundler
|
|
632
642
|
end
|
633
643
|
end
|
634
644
|
|
635
|
-
def
|
645
|
+
def converge_rubygems_sources
|
646
|
+
return false if Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
|
647
|
+
|
636
648
|
changes = false
|
637
649
|
|
638
|
-
# Get the
|
650
|
+
# Get the RubyGems sources from the Gemfile.lock
|
639
651
|
locked_gem_sources = @locked_sources.select {|s| s.is_a?(Source::Rubygems) }
|
640
|
-
# Get the
|
652
|
+
# Get the RubyGems remotes from the Gemfile
|
641
653
|
actual_remotes = sources.rubygems_remotes
|
642
654
|
|
643
|
-
# If there is a
|
655
|
+
# If there is a RubyGems source in both
|
644
656
|
if !locked_gem_sources.empty? && !actual_remotes.empty?
|
645
657
|
locked_gem_sources.each do |locked_gem|
|
646
658
|
# Merge the remotes from the Gemfile into the Gemfile.lock
|
647
|
-
changes |= locked_gem.replace_remotes(actual_remotes)
|
659
|
+
changes |= locked_gem.replace_remotes(actual_remotes, Bundler.settings[:allow_deployment_source_credential_changes])
|
648
660
|
end
|
649
661
|
end
|
650
662
|
|
663
|
+
changes
|
664
|
+
end
|
665
|
+
|
666
|
+
def converge_sources
|
667
|
+
changes = false
|
668
|
+
|
669
|
+
changes |= converge_rubygems_sources
|
670
|
+
|
651
671
|
# Replace the sources from the Gemfile with the sources from the Gemfile.lock,
|
652
672
|
# if they exist in the Gemfile.lock and are `==`. If you can't find an equivalent
|
653
673
|
# source in the Gemfile.lock, use the one from the Gemfile.
|
@@ -669,7 +689,7 @@ module Bundler
|
|
669
689
|
end
|
670
690
|
|
671
691
|
def converge_dependencies
|
672
|
-
frozen = Bundler.
|
692
|
+
frozen = Bundler.frozen_bundle?
|
673
693
|
(@dependencies + @locked_deps.values).each do |dep|
|
674
694
|
locked_source = @locked_deps[dep.name]
|
675
695
|
# This is to make sure that if bundler is installing in deployment mode and
|
@@ -739,6 +759,8 @@ module Bundler
|
|
739
759
|
end
|
740
760
|
end
|
741
761
|
|
762
|
+
unlock_source_unlocks_spec = Bundler.feature_flag.unlock_source_unlocks_spec?
|
763
|
+
|
742
764
|
converged = []
|
743
765
|
@locked_specs.each do |s|
|
744
766
|
# Replace the locked dependency's source with the equivalent source from the Gemfile
|
@@ -746,21 +768,33 @@ module Bundler
|
|
746
768
|
s.source = (dep && dep.source) || sources.get(s.source)
|
747
769
|
|
748
770
|
# Don't add a spec to the list if its source is expired. For example,
|
749
|
-
# if you change a Git gem to
|
771
|
+
# if you change a Git gem to RubyGems.
|
750
772
|
next if s.source.nil?
|
751
773
|
next if @unlock[:sources].include?(s.source.name)
|
752
774
|
|
753
775
|
# XXX This is a backwards-compatibility fix to preserve the ability to
|
754
776
|
# unlock a single gem by passing its name via `--source`. See issue #3759
|
755
777
|
# TODO: delete in Bundler 2
|
756
|
-
next if @unlock[:sources].include?(s.name)
|
778
|
+
next if unlock_source_unlocks_spec && @unlock[:sources].include?(s.name)
|
757
779
|
|
758
780
|
# If the spec is from a path source and it doesn't exist anymore
|
759
781
|
# then we unlock it.
|
760
782
|
|
761
783
|
# Path sources have special logic
|
762
784
|
if s.source.instance_of?(Source::Path) || s.source.instance_of?(Source::Gemspec)
|
763
|
-
|
785
|
+
other_sources_specs = begin
|
786
|
+
s.source.specs
|
787
|
+
rescue PathError, GitError
|
788
|
+
# if we won't need the source (according to the lockfile),
|
789
|
+
# don't error if the path/git source isn't available
|
790
|
+
next if @locked_specs.
|
791
|
+
for(requested_dependencies, [], false, true, false).
|
792
|
+
none? {|locked_spec| locked_spec.source == s.source }
|
793
|
+
|
794
|
+
raise
|
795
|
+
end
|
796
|
+
|
797
|
+
other = other_sources_specs[s].first
|
764
798
|
|
765
799
|
# If the spec is no longer in the path source, unlock it. This
|
766
800
|
# commonly happens if the version changed in the gemspec
|
@@ -776,7 +810,9 @@ module Bundler
|
|
776
810
|
end
|
777
811
|
|
778
812
|
resolve = SpecSet.new(converged)
|
779
|
-
|
813
|
+
expanded_deps = expand_dependencies(deps, true)
|
814
|
+
@locked_specs_incomplete_for_platform = !resolve.for(expanded_deps, @unlock[:gems], true, true)
|
815
|
+
resolve = resolve.for(expanded_deps, @unlock[:gems], false, false, false)
|
780
816
|
diff = nil
|
781
817
|
|
782
818
|
# Now, we unlock any sources that do not have anymore gems pinned to it
|
@@ -807,17 +843,21 @@ module Bundler
|
|
807
843
|
# the metadata dependencies here
|
808
844
|
def expanded_dependencies
|
809
845
|
@expanded_dependencies ||= begin
|
846
|
+
expand_dependencies(dependencies + metadata_dependencies, @remote)
|
847
|
+
end
|
848
|
+
end
|
849
|
+
|
850
|
+
def metadata_dependencies
|
851
|
+
@metadata_dependencies ||= begin
|
810
852
|
ruby_versions = concat_ruby_version_requirements(@ruby_version)
|
811
853
|
if ruby_versions.empty? || !@ruby_version.exact?
|
812
854
|
concat_ruby_version_requirements(RubyVersion.system)
|
813
855
|
concat_ruby_version_requirements(locked_ruby_version_object) unless @unlock[:ruby]
|
814
856
|
end
|
815
|
-
|
816
|
-
metadata_dependencies = [
|
857
|
+
[
|
817
858
|
Dependency.new("ruby\0", ruby_versions),
|
818
859
|
Dependency.new("rubygems\0", Gem::VERSION),
|
819
860
|
]
|
820
|
-
expand_dependencies(dependencies + metadata_dependencies, @remote)
|
821
861
|
end
|
822
862
|
end
|
823
863
|
|
@@ -838,12 +878,13 @@ module Bundler
|
|
838
878
|
end
|
839
879
|
|
840
880
|
def expand_dependencies(dependencies, remote = false)
|
881
|
+
sorted_platforms = Resolver.sort_platforms(@platforms)
|
841
882
|
deps = []
|
842
883
|
dependencies.each do |dep|
|
843
884
|
dep = Dependency.new(dep, ">= 0") unless dep.respond_to?(:name)
|
844
885
|
next if !remote && !dep.current_platform?
|
845
|
-
platforms = dep.gem_platforms(
|
846
|
-
if platforms.empty?
|
886
|
+
platforms = dep.gem_platforms(sorted_platforms)
|
887
|
+
if platforms.empty? && !Bundler.settings[:disable_platform_warnings]
|
847
888
|
mapped_platforms = dep.platforms.map {|p| Dependency::PLATFORM_MAP[p] }
|
848
889
|
Bundler.ui.warn \
|
849
890
|
"The dependency #{dep} will be unused by any of the platforms Bundler is installing for. " \
|
@@ -872,30 +913,33 @@ module Bundler
|
|
872
913
|
# Record the specs available in each gem's source, so that those
|
873
914
|
# specs will be available later when the resolver knows where to
|
874
915
|
# look for that gemspec (or its dependencies)
|
875
|
-
|
916
|
+
default = sources.default_source
|
917
|
+
source_requirements = { :default => default }
|
918
|
+
default = nil unless Bundler.feature_flag.lockfile_uses_separate_rubygems_sources?
|
876
919
|
dependencies.each do |dep|
|
877
|
-
next unless dep.source
|
878
|
-
source_requirements[dep.name] =
|
920
|
+
next unless source = dep.source || default
|
921
|
+
source_requirements[dep.name] = source
|
922
|
+
end
|
923
|
+
metadata_dependencies.each do |dep|
|
924
|
+
source_requirements[dep.name] = sources.metadata_source
|
879
925
|
end
|
926
|
+
source_requirements["bundler"] = sources.metadata_source # needs to come last to override
|
880
927
|
source_requirements
|
881
928
|
end
|
882
929
|
|
883
|
-
def pinned_spec_names(
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
names << s.name
|
891
|
-
end
|
930
|
+
def pinned_spec_names(skip = nil)
|
931
|
+
pinned_names = []
|
932
|
+
default = Bundler.feature_flag.lockfile_uses_separate_rubygems_sources? && sources.default_source
|
933
|
+
@dependencies.each do |dep|
|
934
|
+
next unless dep_source = dep.source || default
|
935
|
+
next if dep_source == skip
|
936
|
+
pinned_names << dep.name
|
892
937
|
end
|
893
|
-
|
894
|
-
names
|
938
|
+
pinned_names
|
895
939
|
end
|
896
940
|
|
897
941
|
def requested_groups
|
898
|
-
groups - Bundler.settings
|
942
|
+
groups - Bundler.settings[:without] - @optional_groups + Bundler.settings[:with]
|
899
943
|
end
|
900
944
|
|
901
945
|
def lockfiles_equal?(current, proposed, preserve_unknown_sections)
|
@@ -930,11 +974,20 @@ module Bundler
|
|
930
974
|
|
931
975
|
def additional_base_requirements_for_resolve
|
932
976
|
return [] unless @locked_gems && Bundler.feature_flag.only_update_to_newer_versions?
|
977
|
+
dependencies_by_name = dependencies.inject({}) {|memo, dep| memo.update(dep.name => dep) }
|
933
978
|
@locked_gems.specs.reduce({}) do |requirements, locked_spec|
|
934
|
-
|
935
|
-
requirements[
|
979
|
+
name = locked_spec.name
|
980
|
+
next requirements if @locked_gems.dependencies[name] != dependencies_by_name[name]
|
981
|
+
dep = Gem::Dependency.new(name, ">= #{locked_spec.version}")
|
982
|
+
requirements[name] = DepProxy.new(dep, locked_spec.platform)
|
936
983
|
requirements
|
937
984
|
end.values
|
938
985
|
end
|
986
|
+
|
987
|
+
def equivalent_rubygems_remotes?(source)
|
988
|
+
return false unless source.is_a?(Source::Rubygems)
|
989
|
+
|
990
|
+
Bundler.settings[:allow_deployment_source_credential_changes] && source.equivalent_remotes?(sources.rubygems_remotes)
|
991
|
+
end
|
939
992
|
end
|
940
993
|
end
|
data/lib/bundler/dep_proxy.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module Bundler
|
3
4
|
class DepProxy
|
4
5
|
attr_reader :__platform, :dep
|
@@ -9,10 +10,11 @@ module Bundler
|
|
9
10
|
end
|
10
11
|
|
11
12
|
def hash
|
12
|
-
@hash ||= dep.hash
|
13
|
+
@hash ||= [dep, __platform].hash
|
13
14
|
end
|
14
15
|
|
15
16
|
def ==(other)
|
17
|
+
return false if other.class != self.class
|
16
18
|
dep == other.dep && __platform == other.__platform
|
17
19
|
end
|
18
20
|
|
data/lib/bundler/dependency.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require "rubygems/dependency"
|
3
4
|
require "bundler/shared_helpers"
|
4
5
|
require "bundler/rubygems_ext"
|
@@ -6,8 +7,7 @@ require "bundler/rubygems_ext"
|
|
6
7
|
module Bundler
|
7
8
|
class Dependency < Gem::Dependency
|
8
9
|
attr_reader :autorequire
|
9
|
-
attr_reader :groups
|
10
|
-
attr_reader :platforms
|
10
|
+
attr_reader :groups, :platforms, :gemfile
|
11
11
|
|
12
12
|
PLATFORM_MAP = {
|
13
13
|
:ruby => Gem::Platform::RUBY,
|
@@ -29,6 +29,7 @@ module Bundler
|
|
29
29
|
:mri_24 => Gem::Platform::RUBY,
|
30
30
|
:mri_25 => Gem::Platform::RUBY,
|
31
31
|
:rbx => Gem::Platform::RUBY,
|
32
|
+
:truffleruby => Gem::Platform::RUBY,
|
32
33
|
:jruby => Gem::Platform::JAVA,
|
33
34
|
:jruby_18 => Gem::Platform::JAVA,
|
34
35
|
:jruby_19 => Gem::Platform::JAVA,
|
@@ -86,20 +87,19 @@ module Bundler
|
|
86
87
|
@platforms = Array(options["platforms"])
|
87
88
|
@env = options["env"]
|
88
89
|
@should_include = options.fetch("should_include", true)
|
90
|
+
@gemfile = options["gemfile"]
|
89
91
|
|
90
92
|
@autorequire = Array(options["require"] || []) if options.key?("require")
|
91
93
|
end
|
92
94
|
|
95
|
+
# Returns the platforms this dependency is valid for, in the same order as
|
96
|
+
# passed in the `valid_platforms` parameter
|
93
97
|
def gem_platforms(valid_platforms)
|
94
98
|
return valid_platforms if @platforms.empty?
|
95
99
|
|
96
|
-
platforms
|
97
|
-
|
98
|
-
|
99
|
-
next unless valid_platforms.include?(platform)
|
100
|
-
platforms |= [platform]
|
101
|
-
end
|
102
|
-
platforms
|
100
|
+
@gem_platforms ||= @platforms.map {|pl| PLATFORM_MAP[pl] }.compact.uniq
|
101
|
+
|
102
|
+
valid_platforms & @gem_platforms
|
103
103
|
end
|
104
104
|
|
105
105
|
def should_include?
|
data/lib/bundler/deployment.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "bundler/shared_helpers"
|
4
|
-
Bundler::SharedHelpers.major_deprecation "Bundler no longer integrates with " \
|
4
|
+
Bundler::SharedHelpers.major_deprecation 2, "Bundler no longer integrates with " \
|
5
5
|
"Capistrano, but Capistrano provides its own integration with " \
|
6
6
|
"Bundler via the capistrano-bundler gem. Use it instead."
|
7
7
|
|