class Knjappserver::ERBHandler
Public Class Methods
new()
click to toggle source
# File lib/include/class_erbhandler.rb, line 2 def initialize @connected = {} end
Public Instance Methods
erb_handler(httpsess)
click to toggle source
# File lib/include/class_erbhandler.rb, line 6 def erb_handler(httpsess) eruby = httpsess.eruby if !@connected.key?(eruby.__id__) eruby.connect("error", &self.method(:on_error)) @connected[eruby.__id__] = true end if !File.exists?(httpsess.page_path) eruby.import("#{File.dirname(__FILE__)}/../pages/error_notfound.rhtml") else eruby.import(httpsess.page_path) end httpsess.resp.status = 500 if eruby.error end
on_error(e)
click to toggle source
Handels the event when an error in the eruby-instance occurs.
# File lib/include/class_erbhandler.rb, line 24 def on_error(e) _kas.handle_error(e) end