Class: Decko::Commands::Command

Inherits:
Object
  • Object
show all
Defined in:
decko/lib/decko/commands/command.rb

Direct Known Subclasses

CucumberCommand, RakeCommand, RspecCommand

Instance Method Summary collapse

Instance Method Details

#exit_with_child_status(command) ⇒ Object



11
12
13
14
# File 'decko/lib/decko/commands/command.rb', line 11

def exit_with_child_status command
  command += " 2>&1"
  exit $CHILD_STATUS.exitstatus unless system command
end

#runObject



6
7
8
9
# File 'decko/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 'decko/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