Class: Docwu::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/docwu/server.rb

Class Method Summary collapse

Class Method Details

.process(options = {}, &block) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/docwu/server.rb', line 17

def self.process(options={}, &block)
  options['destination'] ||= ::Docwu.config.deploy_path
  destination = options['destination']
  FileUtils.mkdir_p(destination)

  staticMe = Rack::Builder.new do
    run Rack::Directory.new(destination)
  end

  pp options

  ::Thin::Server.start(options.delete(:Host), options.delete(:Port), staticMe, options, &block)

  # Rack::Handler::Thin.run(staticMe, options)

  # Rack::Handler::WEBrick.run(staticMe, :Port => options['port'], :Host => options['host'])
  # Rack::Handler::Mongrel.run(staticMe, :Port => options['port'], :Host => options['host'])
end