kubo39 / bossan

high performance asynchronous rack web server
Other
28 stars 5 forks source link

Cannot rackup with -p option #11

Closed rnakano closed 11 years ago

rnakano commented 11 years ago

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 `<top (required)>'
    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 `<main>'
    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 `<main>'
[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]$