bundler 2.2.22 → 2.2.26

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.

Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +65 -0
  3. data/lib/bundler.rb +4 -9
  4. data/lib/bundler/build_metadata.rb +2 -2
  5. data/lib/bundler/cli.rb +12 -9
  6. data/lib/bundler/cli/cache.rb +1 -1
  7. data/lib/bundler/cli/check.rb +1 -1
  8. data/lib/bundler/cli/doctor.rb +1 -1
  9. data/lib/bundler/cli/exec.rb +1 -6
  10. data/lib/bundler/cli/gem.rb +3 -2
  11. data/lib/bundler/cli/install.rb +4 -17
  12. data/lib/bundler/cli/list.rb +7 -1
  13. data/lib/bundler/cli/open.rb +1 -2
  14. data/lib/bundler/cli/update.rb +1 -1
  15. data/lib/bundler/definition.rb +38 -53
  16. data/lib/bundler/dsl.rb +22 -12
  17. data/lib/bundler/errors.rb +1 -1
  18. data/lib/bundler/index.rb +1 -5
  19. data/lib/bundler/installer/gem_installer.rb +3 -16
  20. data/lib/bundler/installer/standalone.rb +14 -9
  21. data/lib/bundler/lockfile_parser.rb +1 -0
  22. data/lib/bundler/plugin.rb +2 -0
  23. data/lib/bundler/plugin/index.rb +4 -1
  24. data/lib/bundler/plugin/installer.rb +1 -1
  25. data/lib/bundler/resolver.rb +10 -17
  26. data/lib/bundler/rubygems_ext.rb +22 -6
  27. data/lib/bundler/rubygems_gem_installer.rb +5 -1
  28. data/lib/bundler/runtime.rb +16 -9
  29. data/lib/bundler/settings.rb +6 -6
  30. data/lib/bundler/setup.rb +2 -2
  31. data/lib/bundler/shared_helpers.rb +0 -7
  32. data/lib/bundler/source.rb +4 -2
  33. data/lib/bundler/source/git/git_proxy.rb +1 -2
  34. data/lib/bundler/source/rubygems.rb +21 -7
  35. data/lib/bundler/source/rubygems_aggregate.rb +4 -0
  36. data/lib/bundler/source_list.rb +16 -7
  37. data/lib/bundler/spec_set.rb +14 -37
  38. data/lib/bundler/templates/Executable.bundler +6 -6
  39. data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +12 -2
  40. data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -1
  41. data/lib/bundler/version.rb +1 -1
  42. data/lib/bundler/worker.rb +17 -2
  43. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd506f45451a29ba6416b7b97ee93f67f40e71b8ef9c9db79484ff6f840d6189
4
- data.tar.gz: bb18e91f6cfbd8c62febba280ebcb91de345e9fdc5599a7a44245ff47364a141
3
+ metadata.gz: 0f6b49cdd4d65c0b945ba09e5a1f49de540a778e19e0157ed2a376a6daf9511c
4
+ data.tar.gz: 52ade727aa83b8390bb5eeaceda718c1d194d00251ea535013c9da8e58b79094
5
5
  SHA512:
6
- metadata.gz: 1d9dc3b77ecff1849b900a3164578eb40371afeb49f2f1c557485b9647f71292fbf43dd61501416afdfdd9cd50d6da581606aec5c349550a1ea97153e3f94b98
7
- data.tar.gz: ae00d5fa66bd664d65915cf15df9431512dc6a77b35f4b60f7faf649962fbd06d56f0b7b7a0659b7ef9ff2c23860c862d8b5b888d43714c714a6af6fbd5b524a
6
+ metadata.gz: 2e9f6084d7c8059af49ed11ccc1b0748babe41d40d6a363b7dad9091762c979091ad5388cc913545eb2853867ebe9ee7088c3ffb331e667eb57d04345799ab87
7
+ data.tar.gz: dab0d503f64a592ec7dcc8e91ff509f149cc65e20b83db73857ea3e750f10bec57301042db96639f3d77707db78fea0a1f29338a4a3c5721dad3b8db906fd71b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,68 @@
1
+ # 2.2.26 (August 17, 2021)
2
+
3
+ ## Enhancements:
4
+
5
+ - Remove `RUBYGEMS_GEMDEPS` warning [#4827](https://github.com/rubygems/rubygems/pull/4827)
6
+ - Better defaults for GitHub Actions template generated by `bundle gem` [#4619](https://github.com/rubygems/rubygems/pull/4619)
7
+ - Make `bundle exec` keep file descriptors by default [#4812](https://github.com/rubygems/rubygems/pull/4812)
8
+ - Exclude gemspec file itself from file list of gems generated by `bundle gem` [#4650](https://github.com/rubygems/rubygems/pull/4650)
9
+ - Fix a couple small typos in deprecation / error messages [#4806](https://github.com/rubygems/rubygems/pull/4806)
10
+ - Make script generated by `bundle install --standalone` resilient to moving the application to a differently nested folder when `path` sources are used [#4792](https://github.com/rubygems/rubygems/pull/4792)
11
+ - Exclude CI files and issue templates from file list of gems generated by `bundle gem` [#4033](https://github.com/rubygems/rubygems/pull/4033)
12
+
13
+ ## Bug fixes:
14
+
15
+ - Respect `BUNDLE_USER_HOME` env when choosing config location [#4828](https://github.com/rubygems/rubygems/pull/4828)
16
+ - Fix `bundle gem` on path with spaces [#4816](https://github.com/rubygems/rubygems/pull/4816)
17
+ - Fix bundler hitting the network in some cases where not allowed [#4805](https://github.com/rubygems/rubygems/pull/4805)
18
+
19
+ # 2.2.25 (July 30, 2021)
20
+
21
+ ## Deprecations:
22
+
23
+ - Deprecate Gemfile without an explicit global source [#4779](https://github.com/rubygems/rubygems/pull/4779)
24
+ - Deprecate `bundle cache --path` [#4496](https://github.com/rubygems/rubygems/pull/4496)
25
+
26
+ ## Enhancements:
27
+
28
+ - Give better errors when materialization fails [#4788](https://github.com/rubygems/rubygems/pull/4788)
29
+ - Lazily load `shellwords` library [#4786](https://github.com/rubygems/rubygems/pull/4786)
30
+ - Show original error and backtrace directly on `bundle install` errors instead of a more brittle `gem install` hint [#4778](https://github.com/rubygems/rubygems/pull/4778)
31
+ - Remove LoadError message in regards to requiring a relative file [#4772](https://github.com/rubygems/rubygems/pull/4772)
32
+
33
+ ## Bug fixes:
34
+
35
+ - Fix `BUNDLE_USER_CONFIG` no longer respected as config location [#4797](https://github.com/rubygems/rubygems/pull/4797)
36
+ - Fix `--standalone` installation of default gems [#4782](https://github.com/rubygems/rubygems/pull/4782)
37
+ - Fix `--quiet` flag not printing warnings [#4781](https://github.com/rubygems/rubygems/pull/4781)
38
+ - Fix bundler binstub version selection [#4775](https://github.com/rubygems/rubygems/pull/4775)
39
+ - Fix interrupt handling in Bundler workers [#4767](https://github.com/rubygems/rubygems/pull/4767)
40
+
41
+ # 2.2.24 (July 15, 2021)
42
+
43
+ ## Bug fixes:
44
+
45
+ - Fix development gem unintentionally removed on an edge case [#4751](https://github.com/rubygems/rubygems/pull/4751)
46
+ - Fix dangling empty plugin hooks [#4755](https://github.com/rubygems/rubygems/pull/4755)
47
+ - Fix `bundle plugin install --help` showing `bundle install`'s help [#4756](https://github.com/rubygems/rubygems/pull/4756)
48
+ - Make sure `bundle check` shows uniq missing gems [#4749](https://github.com/rubygems/rubygems/pull/4749)
49
+
50
+ ## Performance:
51
+
52
+ - Slightly speed up `bundler/setup` [#4750](https://github.com/rubygems/rubygems/pull/4750)
53
+
54
+ # 2.2.23 (July 9, 2021)
55
+
56
+ ## Enhancements:
57
+
58
+ - Fix `bundle install` on truffleruby selecting incorrect variant for `sorbet-static` gem [#4625](https://github.com/rubygems/rubygems/pull/4625)
59
+ - Spare meaningless warning on read-only bundle invocations [#4724](https://github.com/rubygems/rubygems/pull/4724)
60
+
61
+ ## Bug fixes:
62
+
63
+ - Fix incorrect warning about duplicated gems in the Gemfile [#4732](https://github.com/rubygems/rubygems/pull/4732)
64
+ - Fix `bundle plugin install foo` crashing [#4734](https://github.com/rubygems/rubygems/pull/4734)
65
+
1
66
  # 2.2.22 (July 6, 2021)
2
67
 
3
68
  ## Enhancements:
data/lib/bundler.rb CHANGED
@@ -236,8 +236,9 @@ module Bundler
236
236
  end
237
237
 
238
238
  if warning
239
- user_home = tmp_home_path(warning)
240
- Bundler.ui.warn "#{warning}\nBundler will use `#{user_home}' as your home directory temporarily.\n"
239
+ Bundler.ui.warn "#{warning}\n"
240
+ user_home = tmp_home_path
241
+ Bundler.ui.warn "Bundler will use `#{user_home}' as your home directory temporarily.\n"
241
242
  user_home
242
243
  else
243
244
  Pathname.new(home)
@@ -652,10 +653,6 @@ EOF
652
653
  rescue ScriptError, StandardError => e
653
654
  msg = "There was an error while loading `#{path.basename}`: #{e.message}"
654
655
 
655
- if e.is_a?(LoadError)
656
- msg += "\nDoes it try to require a relative path? That's been removed in Ruby 1.9"
657
- end
658
-
659
656
  raise GemspecError, Dsl::DSLError.new(msg, path, e.backtrace, contents)
660
657
  end
661
658
 
@@ -684,15 +681,13 @@ EOF
684
681
  Bundler.rubygems.clear_paths
685
682
  end
686
683
 
687
- def tmp_home_path(warning)
684
+ def tmp_home_path
688
685
  Kernel.send(:require, "tmpdir")
689
686
  SharedHelpers.filesystem_access(Dir.tmpdir) do
690
687
  path = Bundler.tmp
691
688
  at_exit { Bundler.rm_rf(path) }
692
689
  path
693
690
  end
694
- rescue RuntimeError => e
695
- raise e.exception("#{warning}\nBundler also failed to create a temporary home directory':\n#{e}")
696
691
  end
697
692
 
698
693
  # @param env [Hash]
@@ -4,8 +4,8 @@ module Bundler
4
4
  # Represents metadata from when the Bundler gem was built.
5
5
  module BuildMetadata
6
6
  # begin ivars
7
- @built_at = "2021-07-06".freeze
8
- @git_commit_sha = "0bdd3e8e71".freeze
7
+ @built_at = "2021-08-17".freeze
8
+ @git_commit_sha = "21fd333002".freeze
9
9
  @release = true
10
10
  # end ivars
11
11
 
data/lib/bundler/cli.rb CHANGED
@@ -14,6 +14,7 @@ module Bundler
14
14
  COMMAND_ALIASES = {
15
15
  "check" => "c",
16
16
  "install" => "i",
17
+ "plugin" => "",
17
18
  "list" => "ls",
18
19
  "exec" => ["e", "ex", "exe"],
19
20
  "cache" => ["package", "pack"],
@@ -72,14 +73,6 @@ module Bundler
72
73
  Bundler.ui = UI::Shell.new(options)
73
74
  Bundler.ui.level = "debug" if options["verbose"]
74
75
  unprinted_warnings.each {|w| Bundler.ui.warn(w) }
75
-
76
- if ENV["RUBYGEMS_GEMDEPS"] && !ENV["RUBYGEMS_GEMDEPS"].empty?
77
- Bundler.ui.warn(
78
- "The RUBYGEMS_GEMDEPS environment variable is set. This enables RubyGems' " \
79
- "experimental Gemfile mode, which may conflict with Bundler and cause unexpected errors. " \
80
- "To remove this warning, unset RUBYGEMS_GEMDEPS.", :wrap => true
81
- )
82
- end
83
76
  end
84
77
 
85
78
  check_unknown_options!(:except => [:config, :exec])
@@ -455,6 +448,12 @@ module Bundler
455
448
  "do in future versions. Instead please use `bundle config set cache_all true`, " \
456
449
  "and stop using this flag" if ARGV.include?("--all")
457
450
 
451
+ SharedHelpers.major_deprecation 2,
452
+ "The `--path` flag is deprecated because its semantics are unclear. " \
453
+ "Use `bundle config cache_path` to configure the path of your cache of gems, " \
454
+ "and `bundle config path` to configure the path where your gems are installed, " \
455
+ "and stop using this flag" if ARGV.include?("--path")
456
+
458
457
  require_relative "cli/cache"
459
458
  Cache.new(options).run
460
459
  end
@@ -462,7 +461,7 @@ module Bundler
462
461
  map aliases_for("cache")
463
462
 
464
463
  desc "exec [OPTIONS]", "Run the command in context of the bundle"
465
- method_option :keep_file_descriptors, :type => :boolean, :default => false
464
+ method_option :keep_file_descriptors, :type => :boolean, :default => true
466
465
  method_option :gemfile, :type => :string, :required => false
467
466
  long_desc <<-D
468
467
  Exec runs a command, providing it access to the gems in the bundle. While using
@@ -470,6 +469,10 @@ module Bundler
470
469
  into the system wide RubyGems repository.
471
470
  D
472
471
  def exec(*args)
472
+ if ARGV.include?("--no-keep-file-descriptors")
473
+ SharedHelpers.major_deprecation(2, "The `--no-keep-file-descriptors` has been deprecated. `bundle exec` no longer mess with your file descriptors. Close them in the exec'd script if you need to")
474
+ end
475
+
473
476
  require_relative "cli/exec"
474
477
  Exec.new(options, args).run
475
478
  end
@@ -9,7 +9,7 @@ module Bundler
9
9
  end
10
10
 
11
11
  def run
12
- Bundler.ui.level = "error" if options[:quiet]
12
+ Bundler.ui.level = "warn" if options[:quiet]
13
13
  Bundler.settings.set_command_option_if_given :path, options[:path]
14
14
  Bundler.settings.set_command_option_if_given :cache_path, options["cache-path"]
15
15
 
@@ -15,7 +15,7 @@ module Bundler
15
15
  definition.validate_runtime!
16
16
 
17
17
  begin
18
- definition.resolve_only_locally!
18
+ definition.resolve_with_cache!
19
19
  not_installed = definition.missing_specs
20
20
  rescue GemNotFound, VersionConflict
21
21
  Bundler.ui.error "Bundler can't satisfy your Gemfile's dependencies."
@@ -61,7 +61,7 @@ module Bundler
61
61
  end
62
62
 
63
63
  def run
64
- Bundler.ui.level = "error" if options[:quiet]
64
+ Bundler.ui.level = "warn" if options[:quiet]
65
65
  Bundler.settings.validate!
66
66
  check!
67
67
 
@@ -12,12 +12,7 @@ module Bundler
12
12
  @options = options
13
13
  @cmd = args.shift
14
14
  @args = args
15
-
16
- if !Bundler.current_ruby.jruby?
17
- @args << { :close_others => !options.keep_file_descriptors? }
18
- elsif options.keep_file_descriptors?
19
- Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec."
20
- end
15
+ @args << { :close_others => !options.keep_file_descriptors? } unless Bundler.current_ruby.jruby?
21
16
  end
22
17
 
23
18
  def run
@@ -184,14 +184,15 @@ module Bundler
184
184
  )
185
185
  end
186
186
 
187
- if File.exist?(target) && !File.directory?(target)
187
+ if target.exist? && !target.directory?
188
188
  Bundler.ui.error "Couldn't create a new gem named `#{gem_name}` because there's an existing file named `#{gem_name}`."
189
189
  exit Bundler::BundlerError.all_errors[Bundler::GenericSystemCallError]
190
190
  end
191
191
 
192
192
  if use_git
193
193
  Bundler.ui.info "Initializing git repo in #{target}"
194
- `git init #{target}`
194
+ require "shellwords"
195
+ `git init #{target.to_s.shellescape}`
195
196
 
196
197
  config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp
197
198
  end
@@ -8,7 +8,7 @@ module Bundler
8
8
  end
9
9
 
10
10
  def run
11
- Bundler.ui.level = "error" if options[:quiet]
11
+ Bundler.ui.level = "warn" if options[:quiet]
12
12
 
13
13
  warn_if_root
14
14
 
@@ -60,7 +60,7 @@ module Bundler
60
60
  installer = Installer.install(Bundler.root, definition, options)
61
61
 
62
62
  Bundler.settings.temporary(:cache_all_platforms => options[:local] ? false : Bundler.settings[:cache_all_platforms]) do
63
- Bundler.load.cache if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
63
+ Bundler.load.cache(nil, options[:local]) if Bundler.app_cache.exist? && !options["no-cache"] && !Bundler.frozen_bundle?
64
64
  end
65
65
 
66
66
  Bundler.ui.confirm "Bundle complete! #{dependencies_count_for(definition)}, #{gems_installed_for(definition)}."
@@ -83,22 +83,9 @@ module Bundler
83
83
  end
84
84
 
85
85
  Bundler::CLI::Common.output_fund_metadata_summary
86
- rescue GemNotFound, VersionConflict => e
87
- if options[:local] && Bundler.app_cache.exist?
88
- Bundler.ui.warn "Some gems seem to be missing from your #{Bundler.settings.app_cache_path} directory."
89
- end
90
-
91
- unless Bundler.definition.has_rubygems_remotes?
92
- Bundler.ui.warn <<-WARN, :wrap => true
93
- Your Gemfile has no gem server sources. If you need gems that are \
94
- not already on your machine, add a line like this to your Gemfile:
95
- source 'https://rubygems.org'
96
- WARN
97
- end
98
- raise e
99
- rescue Gem::InvalidSpecificationException => e
86
+ rescue Gem::InvalidSpecificationException
100
87
  Bundler.ui.warn "You have one or more invalid gemspecs that need to be fixed."
101
- raise e
88
+ raise
102
89
  end
103
90
 
104
91
  private
@@ -16,7 +16,13 @@ module Bundler
16
16
  specs = if @only_group.any? || @without_group.any?
17
17
  filtered_specs_by_groups
18
18
  else
19
- Bundler.load.specs
19
+ begin
20
+ Bundler.load.specs
21
+ rescue GemNotFound => e
22
+ Bundler.ui.error e.message
23
+ Bundler.ui.warn "Install missing gems with `bundle install`."
24
+ exit 1
25
+ end
20
26
  end.reject {|s| s.name == "bundler" }.sort_by(&:name)
21
27
 
22
28
  return Bundler.ui.info "No gems in the Gemfile" if specs.empty?
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shellwords"
4
-
5
3
  module Bundler
6
4
  class CLI::Open
7
5
  attr_reader :options, :name
@@ -19,6 +17,7 @@ module Bundler
19
17
  else
20
18
  path = spec.full_gem_path
21
19
  Dir.chdir(path) do
20
+ require "shellwords"
22
21
  command = Shellwords.split(editor) + [path]
23
22
  Bundler.with_original_env do
24
23
  system(*command)
@@ -9,7 +9,7 @@ module Bundler
9
9
  end
10
10
 
11
11
  def run
12
- Bundler.ui.level = "error" if options[:quiet]
12
+ Bundler.ui.level = "warn" if options[:quiet]
13
13
 
14
14
  Plugin.gemfile_install(Bundler.default_gemfile) if Bundler.feature_flag.plugins?
15
15
 
@@ -133,7 +133,7 @@ module Bundler
133
133
  @unlock[:gems] ||= @dependencies.map(&:name)
134
134
  else
135
135
  eager_unlock = expand_dependencies(@unlock[:gems] || [], true)
136
- @unlock[:gems] = @locked_specs.for(eager_unlock, [], false, false, false).map(&:name)
136
+ @unlock[:gems] = @locked_specs.for(eager_unlock, false, false).map(&:name)
137
137
  end
138
138
 
139
139
  @dependency_changes = converge_dependencies
@@ -161,12 +161,6 @@ module Bundler
161
161
  @multisource_allowed
162
162
  end
163
163
 
164
- def resolve_only_locally!
165
- @remote = false
166
- sources.local_only!
167
- resolve
168
- end
169
-
170
164
  def resolve_with_cache!
171
165
  sources.cached!
172
166
  resolve
@@ -185,25 +179,7 @@ module Bundler
185
179
  #
186
180
  # @return [Bundler::SpecSet]
187
181
  def specs
188
- @specs ||= begin
189
- begin
190
- specs = resolve.materialize(requested_dependencies)
191
- rescue GemNotFound => e # Handle yanked gem
192
- gem_name, gem_version = extract_gem_info(e)
193
- locked_gem = @locked_specs[gem_name].last
194
- raise if locked_gem.nil? || locked_gem.version.to_s != gem_version || !@remote
195
- raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
196
- "no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
197
- "You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
198
- "removed in order to install."
199
- end
200
- unless specs["bundler"].any?
201
- bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
202
- specs["bundler"] = bundler
203
- end
204
-
205
- specs
206
- end
182
+ @specs ||= materialize(requested_dependencies)
207
183
  end
208
184
 
209
185
  def new_specs
@@ -215,9 +191,7 @@ module Bundler
215
191
  end
216
192
 
217
193
  def missing_specs
218
- missing = []
219
- resolve.materialize(requested_dependencies, missing)
220
- missing
194
+ resolve.materialize(requested_dependencies).missing_specs
221
195
  end
222
196
 
223
197
  def missing_specs?
@@ -235,17 +209,11 @@ module Bundler
235
209
  end
236
210
 
237
211
  def requested_specs
238
- @requested_specs ||= begin
239
- groups = requested_groups
240
- groups.map!(&:to_sym)
241
- specs_for(groups)
242
- end
212
+ specs_for(requested_groups)
243
213
  end
244
214
 
245
215
  def requested_dependencies
246
- groups = requested_groups
247
- groups.map!(&:to_sym)
248
- dependencies_for(groups)
216
+ dependencies_for(requested_groups)
249
217
  end
250
218
 
251
219
  def current_dependencies
@@ -255,11 +223,13 @@ module Bundler
255
223
  end
256
224
 
257
225
  def specs_for(groups)
226
+ groups = requested_groups if groups.empty?
258
227
  deps = dependencies_for(groups)
259
- SpecSet.new(specs.for(expand_dependencies(deps)))
228
+ materialize(expand_dependencies(deps))
260
229
  end
261
230
 
262
231
  def dependencies_for(groups)
232
+ groups.map!(&:to_sym)
263
233
  current_dependencies.reject do |d|
264
234
  (d.groups & groups).empty?
265
235
  end
@@ -288,10 +258,6 @@ module Bundler
288
258
  end
289
259
  end
290
260
 
291
- def has_rubygems_remotes?
292
- sources.rubygems_sources.any? {|s| s.remotes.any? }
293
- end
294
-
295
261
  def spec_git_paths
296
262
  sources.git_sources.map {|s| File.realpath(s.path) if File.exist?(s.path) }.compact
297
263
  end
@@ -507,8 +473,33 @@ module Bundler
507
473
 
508
474
  private
509
475
 
476
+ def materialize(dependencies)
477
+ specs = resolve.materialize(dependencies)
478
+ missing_specs = specs.missing_specs
479
+
480
+ if missing_specs.any?
481
+ missing_specs.each do |s|
482
+ locked_gem = @locked_specs[s.name].last
483
+ next if locked_gem.nil? || locked_gem.version != s.version || !@remote
484
+ raise GemNotFound, "Your bundle is locked to #{locked_gem} from #{locked_gem.source}, but that version can " \
485
+ "no longer be found in that source. That means the author of #{locked_gem} has removed it. " \
486
+ "You'll need to update your bundle to a version other than #{locked_gem} that hasn't been " \
487
+ "removed in order to install."
488
+ end
489
+
490
+ raise GemNotFound, "Could not find #{missing_specs.map(&:full_name).join(", ")} in any of the sources"
491
+ end
492
+
493
+ unless specs["bundler"].any?
494
+ bundler = sources.metadata_source.specs.search(Gem::Dependency.new("bundler", VERSION)).last
495
+ specs["bundler"] = bundler
496
+ end
497
+
498
+ specs
499
+ end
500
+
510
501
  def precompute_source_requirements_for_indirect_dependencies?
511
- sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
502
+ @remote && sources.non_global_rubygems_sources.all?(&:dependency_api_available?) && !sources.aggregate_global_source?
512
503
  end
513
504
 
514
505
  def current_ruby_platform_locked?
@@ -717,7 +708,7 @@ module Bundler
717
708
  @locked_specs.each do |s|
718
709
  # Replace the locked dependency's source with the equivalent source from the Gemfile
719
710
  dep = @dependencies.find {|d| s.satisfies?(d) }
720
- s.source = (dep && dep.source) || sources.get(s.source)
711
+ s.source = (dep && dep.source) || sources.get(s.source) unless multisource_allowed?
721
712
 
722
713
  # Don't add a spec to the list if its source is expired. For example,
723
714
  # if you change a Git gem to RubyGems.
@@ -735,7 +726,7 @@ module Bundler
735
726
  # if we won't need the source (according to the lockfile),
736
727
  # don't error if the path/git source isn't available
737
728
  next if @locked_specs.
738
- for(requested_dependencies, [], false, true, false).
729
+ for(requested_dependencies, false, true).
739
730
  none? {|locked_spec| locked_spec.source == s.source }
740
731
 
741
732
  raise
@@ -754,8 +745,8 @@ module Bundler
754
745
  end
755
746
 
756
747
  resolve = SpecSet.new(converged)
757
- @locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(requested_dependencies & deps), @unlock[:gems], true, true)
758
- resolve = SpecSet.new(resolve.for(expand_dependencies(deps, true), [], false, false, false).reject{|s| @unlock[:gems].include?(s.name) })
748
+ @locked_specs_incomplete_for_platform = !resolve.for(expand_dependencies(requested_dependencies & deps), true, true)
749
+ resolve = SpecSet.new(resolve.for(expand_dependencies(deps, true), false, false).reject{|s| @unlock[:gems].include?(s.name) })
759
750
  diff = nil
760
751
 
761
752
  # Now, we unlock any sources that do not have anymore gems pinned to it
@@ -859,12 +850,6 @@ module Bundler
859
850
  current == proposed
860
851
  end
861
852
 
862
- def extract_gem_info(error)
863
- # This method will extract the error message like "Could not find foo-1.2.3 in any of the sources"
864
- # to an array. The first element will be the gem name (e.g. foo), the second will be the version number.
865
- error.message.scan(/Could not find (\w+)-(\d+(?:\.\d+)+)/).flatten
866
- end
867
-
868
853
  def compute_requires
869
854
  dependencies.reduce({}) do |requires, dep|
870
855
  next requires unless dep.should_include?