Class: CmdExecutable::Runner
- Inherits:
-
Thor
- Object
- Thor
- CmdExecutable::Runner
show all
- Includes:
- CmdExecutable
- Defined in:
- lib/cmd_executable/runner.rb
Overview
CLI Runner
Usage on CLI:
$ cmd_executable ls
> OK
Constant Summary
VERSION
Class Method Summary
collapse
Instance Method Summary
collapse
#executable?, executable?
Class Method Details
.exit_on_failure? ⇒ Boolean
37
38
39
|
# File 'lib/cmd_executable/runner.rb', line 37
def self.exit_on_failure?
true
end
|
Instance Method Details
#check(command = '') ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/cmd_executable/runner.rb', line 44
def check(command = '')
if executable?(command)
puts 'OK'
exit 0
else
puts 'NOT FOUND'
exit 1
end
rescue CmdExecutable::ParserError => e
warn "Invalid command: `#{e.message}'"
exit 16
end
|