Permalink
Browse files

raise exception if port passed to -p is not a valid integer

  • Loading branch information...
1 parent 2772cca commit a4be4eb3bb8050698751b47812f67c2fbd05c071 @rkh rkh committed Jun 17, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sinatra/main.rb
View
@@ -16,7 +16,7 @@ class Application < Base
op.on('-x') { set :lock, true }
op.on('-e env') { |val| set :environment, val.to_sym }
op.on('-s server') { |val| set :server, val }
- op.on('-p port') { |val| set :port, val.to_i }
+ op.on('-p port') { |val| set :port, Integer(val) }
op.on('-o addr') { |val| set :bind, val }
}.parse!(ARGV.dup)
end

0 comments on commit a4be4eb

Please sign in to comment.