diff --git a/lib/haproxyctl/environment.rb b/lib/haproxyctl/environment.rb index aee53fd..0898298 100644 --- a/lib/haproxyctl/environment.rb +++ b/lib/haproxyctl/environment.rb @@ -39,7 +39,11 @@ def exec def nbproc @nbproc ||= begin config.match /nbproc \s*(\d*)\s*/ - Regexp.last_match[1].to_i || 1 + @x = 1 + if (Regexp.last_match) + @x = Regexp.last_match[1].to_i + end + (@x) end end