diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-12 06:15:44 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-12 06:15:44 +0000 |
commit | b74bbb20f0abeae760727704b1b0bfb149d5e8be (patch) | |
tree | 7f112577119ebda6c3dfd71cbc24f1bc559280ae /lib/bundler | |
parent | 391b35a3079325752f87635e0b16b3cdc171e8a8 (diff) | |
download | ruby-b74bbb20f0abeae760727704b1b0bfb149d5e8be.tar.gz |
Merge 1-16-stable branch of bundler.
It's rc version for bundler-1.16.1. I'm going to update it version
after official release from bundler team.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/cli/init.rb | 6 | ||||
-rw-r--r-- | lib/bundler/cli/update.rb | 4 | ||||
-rw-r--r-- | lib/bundler/definition.rb | 2 | ||||
-rw-r--r-- | lib/bundler/resolver.rb | 3 | ||||
-rw-r--r-- | lib/bundler/source/rubygems.rb | 6 | ||||
-rwxr-xr-x | lib/bundler/templates/Executable | 14 | ||||
-rw-r--r-- | lib/bundler/version.rb | 2 |
7 files changed, 21 insertions, 16 deletions
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb index 50e01f54fb..fa53e7c74b 100644 --- a/lib/bundler/cli/init.rb +++ b/lib/bundler/cli/init.rb @@ -36,11 +36,7 @@ module Bundler private def gemfile - @gemfile ||= begin - Bundler.default_gemfile - rescue GemfileNotFound - Bundler.feature_flag.init_gems_rb? ? "gems.rb" : "Gemfile" - end + @gemfile ||= Bundler.feature_flag.init_gems_rb? ? "gems.rb" : "Gemfile" end end end diff --git a/lib/bundler/cli/update.rb b/lib/bundler/cli/update.rb index 5de11e84e4..3890ea307a 100644 --- a/lib/bundler/cli/update.rb +++ b/lib/bundler/cli/update.rb @@ -68,7 +68,9 @@ module Bundler if locked_gems = Bundler.definition.locked_gems gems.each do |name| - locked_version = locked_gems.specs.find {|s| s.name == name }.version + locked_version = locked_gems.specs.find {|s| s.name == name } + locked_version &&= locked_version.version + next unless locked_version new_version = Bundler.definition.specs[name].first new_version &&= new_version.version if !new_version diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index f93ed76226..ad16389dae 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -295,7 +295,7 @@ module Bundler end sources.all_sources.each do |source| - source.double_check_for(unmet_dependency_names, :override_dupes) + source.double_check_for(unmet_dependency_names) end break if idxcount == idx.size diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb index ddc1d702e0..bfc6b91576 100644 --- a/lib/bundler/resolver.rb +++ b/lib/bundler/resolver.rb @@ -245,7 +245,8 @@ module Bundler if all <= 1 all - 1_000_000 else - search = search_for(dependency).size + search = search_for(dependency) + search = @prerelease_specified[dependency.name] ? search.count : search.count {|s| !s.version.prerelease? } search - all end end diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb index 6f4157364f..3cf22a50f1 100644 --- a/lib/bundler/source/rubygems.rb +++ b/lib/bundler/source/rubygems.rb @@ -252,10 +252,8 @@ module Bundler end end - def double_check_for(unmet_dependency_names, override_dupes = false, index = specs) + def double_check_for(unmet_dependency_names) return unless @allow_remote - raise ArgumentError, "missing index" unless index - return unless api_fetchers.any? unmet_dependency_names = unmet_dependency_names.call @@ -270,7 +268,7 @@ module Bundler Bundler.ui.debug "Double checking for #{unmet_dependency_names || "all specs (due to the size of the request)"} in #{self}" - fetch_names(api_fetchers, unmet_dependency_names, index, override_dupes) + fetch_names(api_fetchers, unmet_dependency_names, specs, false) end def dependency_names_to_double_check diff --git a/lib/bundler/templates/Executable b/lib/bundler/templates/Executable index 9289debc26..414a75898d 100755 --- a/lib/bundler/templates/Executable +++ b/lib/bundler/templates/Executable @@ -8,13 +8,21 @@ # this file is here to facilitate running it. # -bundle_binstub = File.expand_path("../bundle", __FILE__) -load(bundle_binstub) if File.file?(bundle_binstub) - require "pathname" ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../<%= relative_gemfile_path %>", Pathname.new(__FILE__).realpath) +bundle_binstub = File.expand_path("../bundle", __FILE__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 150) =~ /This file was generated by Bundler/ + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + require "rubygems" require "bundler/setup" diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb index c2355ff2c8..87cc8e3776 100644 --- a/lib/bundler/version.rb +++ b/lib/bundler/version.rb @@ -7,7 +7,7 @@ module Bundler # We're doing this because we might write tests that deal # with other versions of bundler and we are unsure how to # handle this better. - VERSION = "1.16.0" unless defined?(::Bundler::VERSION) + VERSION = "1.16.1.pre1" unless defined?(::Bundler::VERSION) def self.overwrite_loaded_gem_version begin |