Class: Dr::Server
- Inherits:
-
Object
- Object
- Dr::Server
- Defined in:
- lib/dr/server.rb
Instance Method Summary collapse
-
#initialize(port, root_route, address, archive_path) ⇒ Server
constructor
A new instance of Server.
- #start ⇒ Object
Constructor Details
#initialize(port, root_route, address, archive_path) ⇒ Server
Returns a new instance of Server.
8 9 10 11 12 13 14 15 16 |
# File 'lib/dr/server.rb', line 8 def initialize(port, root_route, address, archive_path) @port = port @host = address @dir_server = Rack::Builder.new do map root_route do run Rack::Directory.new(archive_path) end end end |
Instance Method Details
#start ⇒ Object
18 19 20 |
# File 'lib/dr/server.rb', line 18 def start Rack::Handler::Thin.run(@dir_server, :Port => @port, :Host => @host) end |