sensu/sensu-community-plugins — pull request #499 by areina (2014-02-27 12:37:04+00:00)
Title: Update check-procs plugin.

- Convert `read_pid` class method to instance method and use it inside
`#run` instead of call it during the parsing of options. There was a
"stack level" too deep" with the old way if you specify an unexisting
pidfile path.

Ex:
```
ruby check-procs.rb -f unknown_file.unknown_ext
Check failed to run: stack level too deep, ["/var/lib/gems/1.9.1/gems/mixlib-cli-1.4.0/lib/mixlib/cli.rb:162"]
/var/lib/gems/1.9.1/gems/sensu-plugin-0.2.2/lib/sensu-plugin/cli.rb:63:in `block in ': undefined method `warning' for nil:NilClass (NoMethodError)
```

- Update `read_pid` method to check if file with pid exists instead of
rescue the exception directly.

Exception flow is not a good practice and the performance is very poor.
There is an example in: https://gist.github.com/areina/9233841