Permalink
Browse files

Port options for preview

  • Loading branch information...
1 parent 88eea4c commit e8ac5f80305fa9f375264552c4b944d06b6d6ca4 @wagenet wagenet committed Sep 28, 2011
Showing with 5 additions and 1 deletion.
  1. +1 −0 lib/guides/cli.rb
  2. +4 −1 lib/guides/preview.rb
View
@@ -48,6 +48,7 @@ def version
desc "preview", "preview the guides as you work"
method_option "production", :type => :boolean, :banner => "use production mode", :aliases => "-p"
+ method_option "port", :type => :string, :default => "9292"
def preview
Preview.start(options)
end
View
@@ -56,7 +56,10 @@ def call(env)
class Preview < Rack::Server
def self.start(options = {})
- super options.merge(:host => '0.0.0.0', :Port => 9292, :server => "thin")
+ options = options.dup
+ options[:Port] = options.delete(:port) || '9292'
+ options.merge!(:host => '0.0.0.0', :server => "thin")
+ super options
end
def initialize(options = {})

0 comments on commit e8ac5f8

Please sign in to comment.