first check key starts with "#!", then check key matchs /^\w.*|.*\w$/
Signed-off-by: Wei Jihui weijihuiall@163.com --- lib/job.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/job.rb b/lib/job.rb index 35e0ceee..8346db87 100755 --- a/lib/job.rb +++ b/lib/job.rb @@ -288,7 +288,6 @@ class Job def multi_args(hash) jobs_array = [] hash.each { |key, value| - next unless key =~ /^\w.*|.*\w$/ next unless key.is_a?(String)
if key.start_with?('#! ') @@ -296,6 +295,8 @@ class Job next end
+ next unless key =~ /^\w.*|.*\w$/ + key_array = key.split('|').map(&:strip) [value].flatten.each do |v| next unless v =~ /^\w.*|.*\w$/