2016-02-01 07:43:26 -05:00
|
|
|
# frozen_string_literal: true
|
2013-11-18 19:34:13 -05:00
|
|
|
##
|
|
|
|
# Represents an installed gem. This is used for dependency resolution.
|
|
|
|
|
2013-07-09 19:21:36 -04:00
|
|
|
class Gem::Source::Installed < Gem::Source
|
|
|
|
|
2013-11-18 19:34:13 -05:00
|
|
|
def initialize # :nodoc:
|
2013-10-18 17:56:18 -04:00
|
|
|
@uri = nil
|
2013-07-09 19:21:36 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
##
|
|
|
|
# Installed sources sort before all other sources
|
|
|
|
|
|
|
|
def <=> other
|
|
|
|
case other
|
2014-09-13 23:30:02 -04:00
|
|
|
when Gem::Source::Git,
|
|
|
|
Gem::Source::Lock,
|
2013-11-30 18:27:52 -05:00
|
|
|
Gem::Source::Vendor then
|
2013-11-18 19:34:13 -05:00
|
|
|
-1
|
2013-07-09 19:21:36 -04:00
|
|
|
when Gem::Source::Installed then
|
|
|
|
0
|
|
|
|
when Gem::Source then
|
|
|
|
1
|
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
##
|
|
|
|
# We don't need to download an installed gem
|
|
|
|
|
|
|
|
def download spec, path
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
2014-09-13 23:30:02 -04:00
|
|
|
def pretty_print q # :nodoc:
|
|
|
|
q.text '[Installed]'
|
|
|
|
end
|
|
|
|
|
2013-07-09 19:21:36 -04:00
|
|
|
end
|
|
|
|
|