Class: LogicaCompiler::Deps::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/logica_compiler/deps/shell.rb

Instance Method Summary collapse

Instance Method Details

#capture!(*args) ⇒ Object

Raises:



23
24
25
26
27
28
# File 'lib/logica_compiler/deps/shell.rb', line 23

def capture!(*args)
  out, err, status = capture3(*args)
  raise CommandFailedError.new(err.to_s, command: args.join(" ")) unless status.success?

  out
end

#capture3(*args) ⇒ Object



19
20
21
# File 'lib/logica_compiler/deps/shell.rb', line 19

def capture3(*args)
  Open3.capture3(*args)
end

#system(*args) ⇒ Object



8
9
10
# File 'lib/logica_compiler/deps/shell.rb', line 8

def system(*args)
  Kernel.system(*args)
end

#system!(*args) ⇒ Object

Raises:



12
13
14
15
16
17
# File 'lib/logica_compiler/deps/shell.rb', line 12

def system!(*args)
  ok = system(*args)
  raise CommandFailedError.new("Command failed: #{args.join(" ")}", command: args.join(" ")) unless ok

  true
end