Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/librarian/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ def ==(other)
to_gem_requirement == other.to_gem_requirement
end

alias :eql? :==

def hash
self.to_s.hash
end

def to_s
to_gem_requirement.to_s
end
Expand Down
6 changes: 6 additions & 0 deletions lib/librarian/mock/source/mock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def ==(other)
self.name == other.name
end

alias :eql? :==

def hash
self.to_s.hash
end

def to_spec_args
[name, {}]
end
Expand Down
6 changes: 6 additions & 0 deletions lib/librarian/source/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ def ==(other)
(self.sha.nil? || other.sha.nil? || self.sha == other.sha)
end

alias :eql? :==

def hash
self.to_s.hash
end

def to_spec_args
options = {}
options.merge!(:ref => ref) if ref != DEFAULTS[:ref]
Expand Down
6 changes: 6 additions & 0 deletions lib/librarian/source/path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def ==(other)
self.path == other.path
end

alias :eql? :==

def hash
self.to_s.hash
end

def to_spec_args
[path.to_s, {}]
end
Expand Down