Class: Gem::Checkout::RepositoryHash

Inherits:
DataFinder show all
Defined in:
lib/gem-checkout/source.rb

Constant Summary collapse

PRIORITIES =
{
  recommended: %i(source_reference),
  sufficient: %i(commit revision),
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reference) ⇒ RepositoryHash

Returns a new instance of RepositoryHash.



84
85
86
87
88
# File 'lib/gem-checkout/source.rb', line 84

def initialize(reference)
  fail Error::NoMatch unless (reference && !reference.empty?)
  @reference = reference
  Gem::Checkout.logger.debug "Found gem's commit info: #{reference}"
end

Instance Attribute Details

#referenceObject (readonly)

Returns the value of attribute reference.



82
83
84
# File 'lib/gem-checkout/source.rb', line 82

def reference
  @reference
end

Class Method Details

.detect(object) ⇒ Object



78
79
80
# File 'lib/gem-checkout/source.rb', line 78

def self.detect(object)
  DataFinder.detect(self, object, PRIORITIES)
end