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