Sha256: 14c70f11b98ac3f0fedfc2e02265389a9239863ec1baf54aa426b513cc718313

Contents?: true

Size: 828 Bytes

Versions: 9

Compression:

Stored size: 828 Bytes

Contents

module Roger
  class Cli::Serve < Cli::Command


    desc "Serve the current project"

    class_options :port => :string, # Defaults to 9000
                   :handler => :string, # The handler to use (defaults to mongrel)
                   :validate => :boolean # Run validation?

    def serve
      
      server_options = {} 
      options.each{|k,v| server_options[k.to_sym] = v }
      server_options[:server] = {}
      [:port, :handler, :validate].each do |k|
        server_options[:server][k] = server_options.delete(k) if server_options.has_key?(k)
      end
      
      server = @project.server
      server.set_options(server_options[:server])
      
      puts "Running Roger with #{server.handler.inspect} on port #{server.port}"
      puts project_banner(@project) 
      
      server.run!
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
roger-0.13.0 lib/roger/cli/serve.rb
roger-0.12.5 lib/roger/cli/serve.rb
roger-0.12.4 lib/roger/cli/serve.rb
roger-0.12.3 lib/roger/cli/serve.rb
roger-0.12.2 lib/roger/cli/serve.rb
roger-0.12.1 lib/roger/cli/serve.rb
roger-0.12.0 lib/roger/cli/serve.rb
roger-0.11.0 lib/roger/cli/serve.rb
roger-0.10.0 lib/roger/cli/serve.rb