lib/gillbus.rb in gillbus-0.16.4 vs lib/gillbus.rb in gillbus-0.16.5

- old
+ new

@@ -23,16 +23,19 @@ define_method method_name do |*args| request_class = klass::Request response_class = klass::Response request = request_class.new(*args) headers = {'Cookie' => "JSESSIONID=#{session_id}"} if session_id + request_time_start = Time.now http_response = driver.public_send( request.method, request.path, request.params, headers ) + request_time_end = Time.now result = response_class.parse_string(http_response.body.force_encoding('utf-8')) if cookie_string = http_response.headers["Set-Cookie"] returned_session_id = CGI::Cookie.parse(cookie_string)['JSESSIONID'].first self.session_id = returned_session_id end result.session_id = session_id + result.request_time = request_time_end - request_time_start result end end require 'monetize'