Class: GUIXPackage
- Inherits:
-
Struct
- Object
- Struct
- GUIXPackage
- Defined in:
- lib/upm/tools/guix.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#out ⇒ Object
Returns the value of attribute out.
-
#path ⇒ Object
Returns the value of attribute path.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
1 2 3 |
# File 'lib/upm/tools/guix.rb', line 1 def name @name end |
#out ⇒ Object
Returns the value of attribute out
1 2 3 |
# File 'lib/upm/tools/guix.rb', line 1 def out @out end |
#path ⇒ Object
Returns the value of attribute path
1 2 3 |
# File 'lib/upm/tools/guix.rb', line 1 def path @path end |
#version ⇒ Object
Returns the value of attribute version
1 2 3 |
# File 'lib/upm/tools/guix.rb', line 1 def version @version end |
Class Method Details
.avaialble ⇒ Object
10 11 12 |
# File 'lib/upm/tools/guix.rb', line 10 def self.avaialble @available_packages ||= IO.popen(["guix", "package", "--list-available"]) { |io| io.each_line.map { |line| GUIXPackage.from_line(line) } } end |
.from_line(line) ⇒ Object
2 3 4 |
# File 'lib/upm/tools/guix.rb', line 2 def self.from_line(line) new(*line.chomp.split) end |
.installed ⇒ Object
6 7 8 |
# File 'lib/upm/tools/guix.rb', line 6 def self.installed @installed_packages ||= IO.popen(["guix", "package", "--list-installed"]) { |io| io.each_line.map { |line| GUIXPackage.from_line(line) } } end |
Instance Method Details
#installed? ⇒ Boolean
14 15 16 |
# File 'lib/upm/tools/guix.rb', line 14 def installed? !!path[%r{^/gnu/store/}] end |