Skip to content

Commit

Permalink
Rename an internal module to make a more accurate historical referenc…
Browse files Browse the repository at this point in the history
…e :)
  • Loading branch information
chrisk committed Jan 1, 2010
1 parent a6ecb58 commit 47dc237
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/samuel.rb
Expand Up @@ -2,7 +2,7 @@
require "forwardable"

require "samuel/loader"
require "samuel/recorder"
require "samuel/diary"
require "samuel/driver_patches/http_client"
require "samuel/driver_patches/net_http"
require "samuel/log_entries/base"
Expand Down
2 changes: 1 addition & 1 deletion lib/samuel/recorder.rb → lib/samuel/diary.rb
@@ -1,5 +1,5 @@
module Samuel
module Recorder
module Diary
extend self

def record_request(http, request, time_requested)
Expand Down
8 changes: 4 additions & 4 deletions lib/samuel/driver_patches/http_client.rb
Expand Up @@ -19,7 +19,7 @@ def do_get_block_with_samuel(req, proxy, conn, &block)
begin
do_get_block_without_samuel(req, proxy, conn, &block)
rescue Exception => e
Samuel::Recorder.record_response(self, req, e, Time.now)
Samuel::Diary.record_response(self, req, e, Time.now)
raise
end
end
Expand All @@ -28,7 +28,7 @@ def do_get_stream_with_samuel(req, proxy, conn)
begin
do_get_stream_without_samuel(req, proxy, conn)
rescue Exception => e
Samuel::Recorder.record_response(self, req, e, Time.now)
Samuel::Diary.record_response(self, req, e, Time.now)
raise
end
end
Expand All @@ -39,11 +39,11 @@ def initialize(http_client_instance)
end

def filter_request(request)
Samuel::Recorder.record_request(@http_client_instance, request, Time.now)
Samuel::Diary.record_request(@http_client_instance, request, Time.now)
end

def filter_response(request, response)
Samuel::Recorder.record_response(@http_client_instance, request, response, Time.now)
Samuel::Diary.record_response(@http_client_instance, request, response, Time.now)
nil # this returns command symbols like :retry, etc.
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/samuel/driver_patches/net_http.rb
Expand Up @@ -11,7 +11,7 @@ def self.included(klass)
end

def request_with_samuel(request, body = nil, &block)
Samuel::Recorder.record_request(self, request, Time.now)
Samuel::Diary.record_request(self, request, Time.now)

response, exception_raised = nil, false
begin
Expand All @@ -20,7 +20,7 @@ def request_with_samuel(request, body = nil, &block)
exception_raised = true
end

Samuel::Recorder.record_response(self, request, response, Time.now)
Samuel::Diary.record_response(self, request, response, Time.now)

raise response if exception_raised
response
Expand All @@ -32,8 +32,8 @@ def connect_with_samuel
fake_request = Object.new
def fake_request.path; ""; end
def fake_request.method; "CONNECT"; end
Samuel::Recorder.record_request(self, fake_request, Time.now)
Samuel::Recorder.record_response(self, fake_request, response, Time.now)
Samuel::Diary.record_request(self, fake_request, Time.now)
Samuel::Diary.record_response(self, fake_request, response, Time.now)
raise
end
end
Expand Down

0 comments on commit 47dc237

Please sign in to comment.