Class: Orange::Middleware::Debugger
- Inherits:
-
Base
- Object
- Base
- Orange::Middleware::Debugger
- Defined in:
- lib/orange-more/debugger/middleware/debugger.rb
Instance Method Summary collapse
- #init(opts = {}) ⇒ Object
-
#packet_call(packet) ⇒ Object
Passes packet then parses the return.
Instance Method Details
#init(opts = {}) ⇒ Object
5 6 7 8 |
# File 'lib/orange-more/debugger/middleware/debugger.rb', line 5 def init(opts = {}) orange.add_pulp Orange::Pulp::DebuggerHelpers if orange.[:development_mode] orange.mixin Orange::Mixins::DebuggerMixin if orange.[:development_mode] end |
#packet_call(packet) ⇒ Object
Passes packet then parses the return
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/orange-more/debugger/middleware/debugger.rb', line 11 def packet_call(packet) if orange.[:development_mode] packet.flash['redirect_to'] = packet.request.path packet.add_css('debug_bar.css', :module => '_debugger_') end pass packet if orange.[:development_mode] = orange[:parser].haml('debug_bar.haml', packet) packet[:content] = packet[:content].gsub('</body>', + '</body>') end packet.finish end |