lib/spinebox/routes.rb in spinebox-0.0.10 vs lib/spinebox/routes.rb in spinebox-0.0.11
- old
+ new
@@ -6,11 +6,21 @@
@@app = nil
end
reset!
# Draw the routes into a rack builder app
- def self.draw(&block)
- @@app = Rack::Builder.new(&block).to_app
+ def self.draw(&block)
+ @@app = Rack::Builder.app do
+
+ # Reload on every request?
+ if Spinebox.config.reload
+ use Spinebox::Reloader
+ use Rack::Reloader, 0
+ end
+
+ # Mapping from routes.rb
+ instance_eval(&block)
+ end
end
# The rack app
def self.app
@@app
\ No newline at end of file