Class: Rage::Reloader
- Inherits:
-
Object
- Object
- Rage::Reloader
- Defined in:
- lib/rage/middleware/reloader.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Reloader
constructor
A new instance of Reloader.
Constructor Details
#initialize(app) ⇒ Reloader
Returns a new instance of Reloader.
4 5 6 |
# File 'lib/rage/middleware/reloader.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/rage/middleware/reloader.rb', line 8 def call(env) Rage.code_loader.reload @app.call(env) rescue Exception => e exception_str = "#{e.class} (#{e.}):\n#{e.backtrace.join("\n")}" puts(exception_str) [500, {}, [exception_str]] end |