2016-02-01 07:43:26 -05:00
|
|
|
# frozen_string_literal: true
|
2013-10-17 21:57:00 -04:00
|
|
|
##
|
|
|
|
# This represents a vendored source that is similar to an installed gem.
|
|
|
|
|
|
|
|
class Gem::Source::Vendor < Gem::Source::Installed
|
2013-11-18 19:34:13 -05:00
|
|
|
##
|
|
|
|
# Creates a new Vendor source for a gem that was unpacked at +path+.
|
|
|
|
|
2018-11-21 05:20:47 -05:00
|
|
|
def initialize(path)
|
2013-11-18 19:34:13 -05:00
|
|
|
@uri = path
|
|
|
|
end
|
|
|
|
|
2018-11-21 05:20:47 -05:00
|
|
|
def <=>(other)
|
2013-11-18 19:34:13 -05:00
|
|
|
case other
|
2013-11-30 18:27:52 -05:00
|
|
|
when Gem::Source::Lock then
|
|
|
|
-1
|
2013-11-18 19:34:13 -05:00
|
|
|
when Gem::Source::Vendor then
|
|
|
|
0
|
|
|
|
when Gem::Source then
|
|
|
|
1
|
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
2013-11-10 12:51:40 -05:00
|
|
|
end
|
2013-10-17 21:57:00 -04:00
|
|
|
end
|