Class: Stickler::Server
- Inherits:
-
Object
- Object
- Stickler::Server
- Defined in:
- lib/stickler/server.rb
Instance Attribute Summary collapse
-
#stickler_root ⇒ Object
readonly
The directory holding all the repositories.
Instance Method Summary collapse
- #app ⇒ Object
-
#initialize(stickler_root) ⇒ Server
constructor
A new instance of Server.
Constructor Details
#initialize(stickler_root) ⇒ Server
Returns a new instance of Server.
7 8 9 10 11 |
# File 'lib/stickler/server.rb', line 7 def initialize( stickler_root ) @stickler_root = File.( stickler_root ) raise ::Stickler::Error, "Stickler root directory '#{@stickler_root}' must already exist" unless File.directory?( @stickler_root ) raise ::Stickler::Error, "Stickler root directory '#{@stickler_root}' must be writable" unless File.writable?( @stickler_root ) end |
Instance Attribute Details
#stickler_root ⇒ Object (readonly)
The directory holding all the repositories
5 6 7 |
# File 'lib/stickler/server.rb', line 5 def stickler_root @stickler_root end |
Instance Method Details
#app ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/stickler/server.rb', line 13 def app root = self.stickler_root Rack::Builder.app( Sinatra::Base.new ) do use Rack::CommonLogger use Stickler::Middleware::Server, :stickler_root => root use Stickler::Middleware::NotFound end end |