puma/puma — pull request #446 by sudara (2014-01-27 12:19:46+00:00)
Title: Assure worker index is always within 0...@options[:workers]

This addresses the minor issue I brought up in #440.

` next_worker_index` will now always be a number between 0 and the number of workers configured.

I also added an integration test (t3.rb) that boots multiple workers and utilizes on_worker_boot. Perhaps it's testing too many things at once (multiple workers, on_worker_boot hook, index) — but it felt nice to have that code path tested.

Feel free to pull or just use as inspiration :)