Class: Pipefitter::Compiler

Inherits:
Object
  • Object
show all
Defined in:
lib/pipefitter/compiler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_path, options = {}) ⇒ Compiler

Returns a new instance of Compiler.



5
6
7
8
# File 'lib/pipefitter/compiler.rb', line 5

def initialize(base_path, options = {})
  @options = options
  @base_path = base_path
end

Instance Attribute Details

#base_pathObject (readonly)

Returns the value of attribute base_path.



3
4
5
# File 'lib/pipefitter/compiler.rb', line 3

def base_path
  @base_path
end

Instance Method Details

#compileObject



10
11
12
13
14
15
16
# File 'lib/pipefitter/compiler.rb', line 10

def compile
  logger.info "Running `#{compile_command}`..."
  result = `cd #{base_path} && #{compile_command} 2>&1`.chomp
  status = $?.to_i == 0
  log_result(result, status)
  status
end