gatling_gun 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/gatling_gun.rb +2 -2
- data/lib/gatling_gun/api_call.rb +3 -1
- metadata +2 -2
data/lib/gatling_gun.rb
CHANGED
@@ -8,7 +8,7 @@ require "gatling_gun/api_call"
|
|
8
8
|
require "gatling_gun/response"
|
9
9
|
|
10
10
|
class GatlingGun
|
11
|
-
VERSION = "0.0.
|
11
|
+
VERSION = "0.0.3"
|
12
12
|
|
13
13
|
def initialize(api_user, api_key)
|
14
14
|
@api_user = api_user
|
@@ -40,7 +40,7 @@ class GatlingGun
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def get_newsletter(newsletter)
|
43
|
-
make_api_call("
|
43
|
+
make_api_call("get", name: newsletter)
|
44
44
|
end
|
45
45
|
|
46
46
|
def list_newsletters(newsletter = nil)
|
data/lib/gatling_gun/api_call.rb
CHANGED
@@ -18,7 +18,9 @@ class GatlingGun
|
|
18
18
|
post = Net::HTTP::Post.new(url.path)
|
19
19
|
post.set_form_data(@parameters)
|
20
20
|
Response.new(http.start { |session| session.request(post) })
|
21
|
-
rescue
|
21
|
+
rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET,
|
22
|
+
EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
|
23
|
+
Net::ProtocolError => error
|
22
24
|
Response.new("error" => error.message)
|
23
25
|
end
|
24
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gatling_gun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-
|
12
|
+
date: 2011-10-11 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: A library for working with SendGrid's Newsletter API. The code is intended
|
15
15
|
for managing and sending newletters.
|