Skip to content

Commit

Permalink
Port options for preview
Browse files Browse the repository at this point in the history
  • Loading branch information
wagenet committed Sep 28, 2011
1 parent 88eea4c commit e8ac5f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/guides/cli.rb
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion lib/guides/preview.rb
Expand Up @@ -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 = {})
Expand Down

0 comments on commit e8ac5f8

Please sign in to comment.