aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/source
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/source')
-rw-r--r--lib/bundler/source/gemspec.rb13
-rw-r--r--lib/bundler/source/path.rb8
2 files changed, 19 insertions, 2 deletions
diff --git a/lib/bundler/source/gemspec.rb b/lib/bundler/source/gemspec.rb
new file mode 100644
index 00000000..37e9a439
--- /dev/null
+++ b/lib/bundler/source/gemspec.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+module Bundler
+ class Source
+ class Gemspec < Path
+ attr_reader :gemspec
+
+ def initialize(options)
+ super
+ @gemspec = options["gemspec"]
+ end
+ end
+ end
+end
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index 3ec1e78b..2147f2fd 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -60,8 +60,8 @@ module Bundler
end
def eql?(other)
- other.instance_of?(Path) &&
- expanded_path == expand(other.path) &&
+ return unless other.class == Path || other.class == Gemspec
+ expanded_path == expand(other.path) &&
version == other.version
end
@@ -107,6 +107,10 @@ module Bundler
name
end
+ def is_a_path?
+ instance_of?(Path)
+ end
+
private
def expanded_path