Class: MRubyPortable::Runner
- Inherits:
-
Object
- Object
- MRubyPortable::Runner
- Defined in:
- lib/mruby_portable/runner.rb
Instance Method Summary collapse
Instance Method Details
#run!(command, chdir: nil) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/mruby_portable/runner.rb', line 7 def run!(command, chdir: nil) stdout, stderr, status = Open3.capture3(*command, **(chdir: chdir)) raise CommandError.new(command, stdout, stderr) unless status.success? [stdout, stderr] end |
#success?(command, chdir: nil) ⇒ Boolean
14 15 16 |
# File 'lib/mruby_portable/runner.rb', line 14 def success?(command, chdir: nil) system(*command, **(chdir: chdir, out: File::NULL, err: File::NULL)) end |