Class: Litterbox::Habitat::Promote
- Inherits:
-
Object
- Object
- Litterbox::Habitat::Promote
- Defined in:
- lib/litterbox/habitat/promote.rb
Overview
Habitat upload
Instance Method Summary collapse
-
#initialize(pkg_ident, channel, auth) ⇒ Promote
constructor
A new instance of Promote.
- #promote(pkg_ident = @pkg_ident, channel = @channel, auth = @auth) ⇒ Object
Constructor Details
#initialize(pkg_ident, channel, auth) ⇒ Promote
Returns a new instance of Promote.
7 8 9 10 11 |
# File 'lib/litterbox/habitat/promote.rb', line 7 def initialize(pkg_ident, channel, auth) @pkg_ident = pkg_ident @channel = channel @auth = auth end |
Instance Method Details
#promote(pkg_ident = @pkg_ident, channel = @channel, auth = @auth) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/litterbox/habitat/promote.rb', line 13 def promote(pkg_ident = @pkg_ident, channel = @channel, auth = @auth) command = "hab pkg promote #{pkg_ident} #{channel} -z #{auth}" Open3.popen3(command) do |_, out, _, thr| while (line = out.gets) puts(line) end return thr.value end end |