Class: ScDocs::Server
- Inherits:
-
Rack::Server
- Object
- Rack::Server
- ScDocs::Server
- Defined in:
- lib/sc_docs/server.rb
Instance Method Summary collapse
- #app ⇒ Object
-
#initialize(directory) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(directory) ⇒ Server
Returns a new instance of Server.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/sc_docs/server.rb', line 5 def initialize(directory) @directory = directory begin require 'thin' super(:server => ::Thin, :Port => 9292) rescue LoadError require 'webrick' super(:server => ::WEBrick, :Host => "localhost", :Port => 9292) end end |
Instance Method Details
#app ⇒ Object
17 18 19 |
# File 'lib/sc_docs/server.rb', line 17 def app Rack::Directory.new(@directory) end |