[why] submit "os os_arch os_version"="1 2 3" this submit will split this arg to: os, os_arch, os_version=1, 2, 3
[how] change space to '|', like: submit "os|os_arch|os_version"="1|2|3" ...
Signed-off-by: Wei Jihui weijihuiall@163.com --- lib/job.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/job.rb b/lib/job.rb index f9e244a9..2869dcb3 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -288,13 +288,13 @@ class Job def multi_args(hash) jobs_array = [] hash.each { |key, value| - next unless key =~ /^\w.*\s+.*\w$/ + next unless key =~ /^\w.*|.*\w$/
- next unless value.class == Array + key_array = key.split('|') + [value].flatten.each do |v| + next unless v =~ /^\w.*|.*\w$/
- key_array = key.split - value.each do |v| - v_array = v.split + v_array = v.split('|') next unless key_array.size == v_array.size
hash_job = hash.clone