summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-11-26 21:53:48 +0000
committerBundlerbot <bot@bundler.io>2019-11-26 21:53:48 +0000
commit87449d535a731b818411523e34468f1f548adca9 (patch)
treeabb5f3d2459305b0cd0b6f5bc25f13ae4ecdf531
parent3e54fbc7b1e28e25eaac465a825cdd16facfe999 (diff)
parent5c93791cf06e324e87875b6b25ee1baf0705dcf9 (diff)
downloadbundler-87449d535a731b818411523e34468f1f548adca9.tar.gz
Merge #7419
7419: Add :glob to git source uniqueness r=deivid-rodriguez a=fatkodima Closes #7346 Co-authored-by: fatkodima <fatkodima123@gmail.com>
-rw-r--r--lib/bundler/source/git.rb7
-rw-r--r--spec/install/git_spec.rb20
2 files changed, 24 insertions, 3 deletions
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index ab997ec47c..5ddfef873e 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -8,7 +8,7 @@ module Bundler
class Git < Path
autoload :GitProxy, File.expand_path("git/git_proxy", __dir__)
- attr_reader :uri, :ref, :branch, :options, :submodules
+ attr_reader :uri, :ref, :branch, :options, :glob, :submodules
def initialize(options)
@options = options
@@ -48,13 +48,14 @@ module Bundler
end
def hash
- [self.class, uri, ref, branch, name, version, submodules].hash
+ [self.class, uri, ref, branch, name, version, glob, submodules].hash
end
def eql?(other)
other.is_a?(Git) && uri == other.uri && ref == other.ref &&
branch == other.branch && name == other.name &&
- version == other.version && submodules == other.submodules
+ version == other.version && glob == other.glob &&
+ submodules == other.submodules
end
alias_method :==, :eql?
diff --git a/spec/install/git_spec.rb b/spec/install/git_spec.rb
index c16285241f..cc8bf70b03 100644
--- a/spec/install/git_spec.rb
+++ b/spec/install/git_spec.rb
@@ -61,5 +61,25 @@ RSpec.describe "bundle install" do
expect(out).to include("Bundle complete!")
end
+
+ it "allows multiple gems from the same git source" do
+ build_repo2 do
+ build_lib "foo", "1.0", :path => lib_path("gems/foo")
+ build_lib "zebra", "2.0", :path => lib_path("gems/zebra")
+ build_git "gems", :path => lib_path("gems"), :gemspec => false
+ end
+
+ install_gemfile <<-G
+ source "#{file_uri_for(gem_repo2)}"
+ gem "foo", :git => "#{lib_path("gems")}", :glob => "foo/*.gemspec"
+ gem "zebra", :git => "#{lib_path("gems")}", :glob => "zebra/*.gemspec"
+ G
+
+ bundle "info foo"
+ expect(out).to include("* foo (1.0 #{revision_for(lib_path("gems"))[0..6]})")
+
+ bundle "info zebra"
+ expect(out).to include("* zebra (2.0 #{revision_for(lib_path("gems"))[0..6]})")
+ end
end
end