zephyr 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/zephyr.rb +12 -4
- data/zephyr.gemspec +2 -2
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
data/lib/zephyr.rb
CHANGED
@@ -263,10 +263,14 @@ class Zephyr
|
|
263
263
|
end
|
264
264
|
|
265
265
|
# request has class methods for :delete, :get, :head, :put, and :post
|
266
|
-
|
266
|
+
http_start = Time.now.to_f
|
267
|
+
response = Typhoeus::Request.send(method, uri(path_components).to_s, params)
|
268
|
+
http_end = Time.now.to_f
|
267
269
|
|
268
270
|
if defined?(Rails)
|
269
|
-
Rails.logger.info "
|
271
|
+
Rails.logger.info "[zephyr]: \"%s %s\" %s %0.4f" % [
|
272
|
+
method.to_s.upcase, uri(path_components).to_s, response.code, (http_end - http_start)
|
273
|
+
]
|
270
274
|
end
|
271
275
|
|
272
276
|
# be consistent with what came before
|
@@ -283,8 +287,12 @@ class Zephyr
|
|
283
287
|
end
|
284
288
|
result
|
285
289
|
else
|
286
|
-
response_body
|
287
|
-
|
290
|
+
response_body = response.timed_out? || response.code == 0 ? "Exceeded #{timeout}ms" : response.body
|
291
|
+
failed_request = FailedRequest.new(method, expect, response.code, response_headers.to_hash, response_body, response.timed_out?)
|
292
|
+
if defined?(Rails)
|
293
|
+
Rails.logger.error "[zephyr]: #{ failed_request }"
|
294
|
+
end
|
295
|
+
raise failed_request
|
288
296
|
end
|
289
297
|
end
|
290
298
|
|
data/zephyr.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{zephyr}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Knopp"]
|
12
|
-
s.date = %q{2011-10-
|
12
|
+
s.date = %q{2011-10-06}
|
13
13
|
s.description = %q{Simple HTTP client using Typheous, derived from the Riak client}
|
14
14
|
s.email = %q{matt.knopp@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zephyr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Knopp
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-10-
|
18
|
+
date: 2011-10-06 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|