From ddb449c2e924e3fc8c4421ae895a469a0e34e399 Mon Sep 17 00:00:00 2001 From: winton Date: Mon, 10 Oct 2011 22:58:37 -0700 Subject: [PATCH] Separator defaults --- lib/execache.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/execache.rb b/lib/execache.rb index 046cb7d..4dc8431 100644 --- a/lib/execache.rb +++ b/lib/execache.rb @@ -65,7 +65,9 @@ def initialize(yaml) hash[cmd_type] = [] if cmd_options['cmd'] - separators = options[cmd_type]['separators'] + separators = options[cmd_type]['separators'] || {} + separators['group'] ||= "[END]" + separators['result'] ||= "\n" output = `#{cmd_options['cmd']}` output = output.split(separators['group'] + separators['result']) output = output.collect { |r| r.split(separators['result']) }