puma/puma — pull request #151 by nickbarth (2012-09-29 18:51:39+00:00)
Title: fixed jruby_restart.rb for use with bundler

When Puma is run in JRuby in without RBENV or RVM the ARGV is set differently then when using a Ruby version manager. This causes Puma to load the wrong file when issued a restart command and crash.

For example running:

```bash
jruby -S bundle exec puma -S tmp/status.txt
```

And issuing a restart `kill -s USR2 pid` will call `Puma::JRubyRestart.chdir_exec` setting `argv` to `["/etc/jruby/bin/jruby", "/etc/jruby/bin/puma", …]`.

This is an issue because `argv` is prepended with `cmd` `/etc/jruby/bin/jruby` causing Puma to reload `/etc/jruby/bin/jruby` instead of the `/etc/jruby/bin/puma` script.

I added a condition to prevent this.