Class: Dependencies::Snap
- Inherits:
-
VersionedDependency
- Object
- Dependency
- VersionedDependency
- Dependencies::Snap
- Defined in:
- lib/dependencies/snap.rb
Constant Summary
Constants inherited from VersionedDependency
VersionedDependency::VERSION_SEPARATOR
Constants inherited from Dependency
Dependency::DESCRIPTION_TYPE_WIDTH
Instance Attribute Summary
Attributes inherited from Dependency
Instance Method Summary collapse
Methods inherited from VersionedDependency
#dep_name, #dep_version, #versioned?
Methods inherited from Dependency
#always_act?, #exit_code, #failure?, #initialize, #output, #success?, #type
Constructor Details
This class inherits a constructor from Dependency
Instance Method Details
#meet ⇒ Object
9 10 11 |
# File 'lib/dependencies/snap.rb', line 9 def meet execute("#{sudo_string}snap install #{name}") end |
#met? ⇒ Boolean
5 6 7 |
# File 'lib/dependencies/snap.rb', line 5 def met? system("snap list | grep -q \"^name \"") end |
#should_meet? ⇒ Boolean
18 19 20 21 22 23 24 |
# File 'lib/dependencies/snap.rb', line 18 def should_meet? return false unless Options.get("snap.install") return false unless `uname`.chomp == "Linux" return false unless system("which snap", out: File::NULL, err: File::NULL) true end |
#unmeet ⇒ Object
13 14 15 16 |
# File 'lib/dependencies/snap.rb', line 13 def unmeet # do nothing; we don't want to uninstall packages and reinstall them every time true end |