Class: Decko::Commands::Command
- Inherits:
-
Object
- Object
- Decko::Commands::Command
show all
- Defined in:
- lib/decko/commands/command.rb
Instance Method Summary
collapse
Instance Method Details
#exit_with_child_status(command) ⇒ Object
11
12
13
14
|
# File 'lib/decko/commands/command.rb', line 11
def exit_with_child_status command
command += " 2>&1"
exit $CHILD_STATUS.exitstatus unless system command
end
|
#run ⇒ Object
6
7
8
9
|
# File 'lib/decko/commands/command.rb', line 6
def run
puts command
exit_with_child_status command
end
|
#split_args(args) ⇒ Object
split special decko args and original command args separated by ‘–’
17
18
19
20
21
22
23
24
25
|
# File 'lib/decko/commands/command.rb', line 17
def split_args args
before_split = true
decko_args, command_args =
args.partition do |a|
before_split = (a == "--" ? false : before_split)
end
command_args.shift
[decko_args, command_args]
end
|