diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-18 00:41:36 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-18 00:41:36 +0000 |
commit | 05ca2faba2e0851f2b8c659974b1742458e2cf8e (patch) | |
tree | ec5846bc6f75d4e83a9a9fe89ec3782ba195d6cd /lib/rubygems/request_set/gem_dependency_api.rb | |
parent | 4fa08bbaf8f2c029f6df7f7ab85293cd31874b15 (diff) | |
download | ruby-05ca2faba2e0851f2b8c659974b1742458e2cf8e.tar.gz |
* lib/rubygems: Update to RubyGems master cee6788. Changes:
Fix test failure on vc10-x64 Server on rubyci.org due to attempting
to File.chmod where it is not supported.
Continuing work on improved gem dependencies file (Gemfile) support.
* test: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/request_set/gem_dependency_api.rb')
-rw-r--r-- | lib/rubygems/request_set/gem_dependency_api.rb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/rubygems/request_set/gem_dependency_api.rb b/lib/rubygems/request_set/gem_dependency_api.rb index 435e157861..40dccb6433 100644 --- a/lib/rubygems/request_set/gem_dependency_api.rb +++ b/lib/rubygems/request_set/gem_dependency_api.rb @@ -9,6 +9,11 @@ class Gem::RequestSet::GemDependencyAPI attr_reader :dependency_groups ## + # A set of gems that are loaded via the +:path+ option to #gem + + attr_reader :vendor_set # :nodoc: + + ## # Creates a new GemDependencyAPI that will add dependencies to the # Gem::RequestSet +set+ based on the dependency API description in +path+. @@ -18,6 +23,7 @@ class Gem::RequestSet::GemDependencyAPI @current_groups = nil @dependency_groups = Hash.new { |h, group| h[group] = [] } + @vendor_set = @set.vendor_set end ## @@ -41,13 +47,20 @@ class Gem::RequestSet::GemDependencyAPI options = requirements.pop if requirements.last.kind_of?(Hash) options ||= {} - groups = - (group = options.delete(:group) and Array(group)) || - options.delete(:groups) || - @current_groups + if directory = options.delete(:path) then + @vendor_set.add_vendor_gem name, directory + end + + group = options.delete :group + all_groups = group ? Array(group) : [] + + groups = options.delete :groups + all_groups |= groups if groups + + all_groups |= @current_groups if @current_groups - if groups then - groups.each do |group| + unless all_groups.empty? then + all_groups.each do |group| gem_arguments = [name, *requirements] gem_arguments << options unless options.empty? @dependency_groups[group] << gem_arguments |