Class: Litterbox::Habitat::Build

Inherits:
Object
  • Object
show all
Defined in:
lib/litterbox/habitat/build.rb

Overview

Habitat build

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Build

Returns a new instance of Build.



7
8
9
# File 'lib/litterbox/habitat/build.rb', line 7

def initialize(dir)
  @dir = dir
end

Instance Method Details

#build(dir = '.') ⇒ Object



11
12
13
14
15
16
17
# File 'lib/litterbox/habitat/build.rb', line 11

def build(dir = '.')
  Open3.popen3("cd #{@dir} && hab pkg build #{dir}") do |_, stderr, _, _|
    while (line = stderr.gets)
      puts(line)
    end
  end
end