class Cliver::Dependency
Public Instance Methods
detected_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 12 def detected_path @detected_path ||= detect! end
Also aliased as: path
major_version()
click to toggle source
# File lib/cliver/dependency_ext.rb, line 33 def major_version version.split('.').first if version end
open?()
click to toggle source
Is the detected dependency currently open?
# File lib/cliver/dependency_ext.rb, line 18 def open? ProcTable.ps.any? { |p| p.comm == path } # See https://github.com/djberg96/sys-proctable/issues/44 rescue ArgumentError false end
version()
click to toggle source
Returns the version of the resolved dependency
# File lib/cliver/dependency_ext.rb, line 26 def version return @detected_version if defined? @detected_version return if Gem.win_platform? version = installed_versions.find { |p, _v| p == path } @detected_version = version.nil? ? nil : version[1] end