kubo39/bossan — pull request #11 by rnakano (2013-07-27 15:08:07+00:00)
Title: Cannot rackup with -p option

Cannot rackup with port option.

Logs:

[nakano@iMac :~/prog/bossan/examples]$ rackup -s webrick -p 8000 -o localhost config.ru
[2013-07-27 23:52:26] INFO WEBrick 1.3.1
[2013-07-27 23:52:26] INFO ruby 1.9.3 (2012-04-20) [x86_64-darwin12.2.0]
[2013-07-27 23:52:26] INFO WEBrick::HTTPServer#start: pid=7398 port=8000
^C[2013-07-27 23:52:29] INFO going to shutdown ...
[2013-07-27 23:52:29] INFO WEBrick::HTTPServer#start done.
[nakano@iMac :~/prog/bossan/examples]$ rackup -s bossan -p 8000 -o localhost config.ru
* Listening on tcp://localhost:8000
/Users/nakano/Documents/program/bossan/lib/rack/handler/bossan.rb:18:in `listen': can't convert String into Integer (TypeError)
from /Users/nakano/Documents/program/bossan/lib/rack/handler/bossan.rb:18:in `run'
from /Users/nakano/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
from /Users/nakano/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
from /Users/nakano/.rvm/gems/ruby-1.9.3-p194/gems/rack-1.5.2/bin/rackup:4:in `'
from /Users/nakano/.rvm/gems/ruby-1.9.3-p194/bin/rackup:23:in `load'
from /Users/nakano/.rvm/gems/ruby-1.9.3-p194/bin/rackup:23:in `

'
from /Users/nakano/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/nakano/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `

'
[nakano@iMac :~/prog/bossan/examples]$

This error occurs at Rack::Handler::Bossan, so this handler expects :Port option is Numeric, but String.
This patch fix it, and add test for Rack::Handler::Bossan.

After this patch apply, Logs:

[nakano@iMac :~/prog/bossan/examples]$ rackup -s bossan -p 8000 -o localhost config.ru
* Listening on tcp://localhost:8000
^CBye.
[nakano@iMac :~/prog/bossan/examples]$