Class: Litterbox::Habitat::Package
- Inherits:
-
Object
- Object
- Litterbox::Habitat::Package
- Defined in:
- lib/litterbox/habitat/package.rb
Overview
Habitat package operations
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #demote(pkg_ident, channel, auth = ENV['HAB_AUTH_TOKEN']) ⇒ Object
- #exec(command) ⇒ Object
-
#initialize(name) ⇒ Package
constructor
A new instance of Package.
- #install(name = @name) ⇒ Object
- #promote(pkg_ident, channel, auth = ENV['HAB_AUTH_TOKEN']) ⇒ Object
- #upload(pkg, auth) ⇒ Object
Constructor Details
#initialize(name) ⇒ Package
Returns a new instance of Package.
7 8 9 |
# File 'lib/litterbox/habitat/package.rb', line 7 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/litterbox/habitat/package.rb', line 5 def name @name end |
Instance Method Details
#demote(pkg_ident, channel, auth = ENV['HAB_AUTH_TOKEN']) ⇒ Object
32 33 34 |
# File 'lib/litterbox/habitat/package.rb', line 32 def demote(pkg_ident, channel, auth = ENV['HAB_AUTH_TOKEN']) exec_cmd "hab pkg demote #{pkg_ident} #{channel} -z #{auth}" end |
#exec(command) ⇒ Object
15 16 17 18 |
# File 'lib/litterbox/habitat/package.rb', line 15 def exec(command) install exec_cmd "hab pkg exec #{@name} #{command}" end |
#install(name = @name) ⇒ Object
11 12 13 |
# File 'lib/litterbox/habitat/package.rb', line 11 def install(name = @name) exec_cmd "hab pkg install #{name}" end |