lib/ruby_app/request.rb in RubyApp-0.2.0 vs lib/ruby_app/request.rb in RubyApp-0.2.1

- old
+ new

@@ -36,9 +36,24 @@ def self.destroy! Thread.current[:_request] = nil end + def self.create_context! + RubyApp::Request.create! + RubyApp::Response.create! + RubyApp::Language.load! + RubyApp::Session.load! + begin + yield + ensure + RubyApp::Session.unload! + RubyApp::Language.unload! + RubyApp::Response.destroy! + RubyApp::Request.destroy! + end + end + private def initialize(environment) super(environment) end