gorilla-io 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe2b87763f37c0a5fdc8a90b7ccb83872134293c
4
- data.tar.gz: 0df35fecf40ef70e23d91062509a297ead6057d1
3
+ metadata.gz: 111bf6e7c9e6a1413d1293da37a0bb38ec78d453
4
+ data.tar.gz: 501ce148d87955eb860c6d495cb8af9287164db4
5
5
  SHA512:
6
- metadata.gz: 71b73dee0f6550b9484ae677bad4179b19430339b659415e3e03fc492c1b8f27d9da655b53e57a0b501000904fb56fc0ec1614f79045c9b4db43d10f83abb630
7
- data.tar.gz: 1681a19780b5ea4da359f2445c497bde2105e8221505c342c70492aeb9098a231b47d9e7d4db5c1435b1ba4cd3afe6b9d562a51940abb223ee61e6cea09c63bc
6
+ metadata.gz: c1fadfc6d39cd2a47ac05e4d7e8747b31f7a3da68e56f492db17504df2993f7e6d12e647cf05dbf6906a7720f2656c1fd791212692a7d00b1e405d1c978b172b
7
+ data.tar.gz: 993fa3b3fae30da7d94ba0516211e534cc30dd6bfef34dccd341224341381ee9d2c280cecaf0b375d39461e5b3849e7fa115b925bd0b23d62e0c2c555f5acdb2
data/lib/gorilla/error.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  module Gorilla
2
2
  # Top-level error for rescuing all Gorilla Client errors
3
3
  class Error < StandardError
4
+ attr_reader :response
5
+
4
6
  def initialize(response)
5
7
  @response = Gorilla::Response.new(response)
6
8
  end
@@ -16,27 +16,30 @@ module Gorilla
16
16
  end
17
17
 
18
18
  def get(path, params={})
19
- response = connection.get(path, params)
20
- Response.new(response)
19
+ request(:get, path, params)
21
20
  end
22
21
 
23
22
  def post(path, params={})
24
- response = connection.post(path, params)
25
- Response.new(response)
23
+ request(:post, path, params)
26
24
  end
27
25
 
28
26
  def put(path, params={})
29
- response = connection.put(path, params)
30
- Response.new(response)
27
+ request(:put, path, params)
31
28
  end
32
29
 
33
30
  def delete(path, params={})
34
- response = connection.delete(path, params)
35
- Response.new(response)
31
+ request(:delete, path, params)
36
32
  end
37
33
 
38
34
  def config
39
35
  Gorilla.configuration
40
36
  end
37
+
38
+ private
39
+
40
+ def request(method, path, params={})
41
+ response = connection.send(method, path, params)
42
+ Response.new(response)
43
+ end
41
44
  end
42
45
  end
@@ -1,3 +1,3 @@
1
1
  module Gorilla
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/gorilla.rb CHANGED
@@ -41,6 +41,8 @@ module Gorilla
41
41
  stubs = Faraday::Adapter::Test::Stubs.new
42
42
  c.client_adapter = [:test, stubs]
43
43
  end
44
+
45
+ stubs
44
46
  end
45
47
 
46
48
  Faraday::Request.register_middleware \
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorilla-io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gorilla.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-19 00:00:00.000000000 Z
11
+ date: 2015-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler