class Cliver::Dependency

Public Instance Methods

major_version() click to toggle source
# File lib/cliver/dependency_ext.rb, line 20
def major_version
  version&.split('.')&.first
end
path() click to toggle source

Memoized shortcut for detect Returns the path to the detected dependency Raises an error if the dependency was not satisfied

# File lib/cliver/dependency_ext.rb, line 8
def path
  @path ||= detect!
end
version() click to toggle source

Returns the version of the resolved dependency

# File lib/cliver/dependency_ext.rb, line 13
def version
  return @version if defined? @version

  version = installed_versions.find { |p, _v| p == path }
  @detected_version = version.nil? ? nil : version[1]
end