zoid 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zoid/agent.rb +13 -0
- data/lib/zoid/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e44e7b2b56a5c41d92a61b29b9ee083c9e36020
|
4
|
+
data.tar.gz: f287168ddde47cf69186f6440649682e84340f2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b53fd021ba3805874bdf92ced9fc1bb682d6f3f762f68f1cd563ed2d4f9fa70155d79c37ad28307e2b3c3a3005d1cdc5bfe483eb90f58ad3cdafad7c48ca285d
|
7
|
+
data.tar.gz: 0cad0782569956d1d8c89ac004b46e9ba2d50ab2c24d9f7eed599738137c30c9ed888d741ece06b5cce4b393328a8a53075984bb5fc783e2c468844c71f1d578
|
data/lib/zoid/agent.rb
CHANGED
@@ -23,10 +23,23 @@ module Zoid
|
|
23
23
|
Zoid::Response.new(response.status, response.body)
|
24
24
|
end
|
25
25
|
|
26
|
+
def post(path, params = {})
|
27
|
+
response = connection.post do |request|
|
28
|
+
request.path = path
|
29
|
+
request.headers['Content-Type'] = "application/json"
|
30
|
+
request.params = params
|
31
|
+
|
32
|
+
yield if block_given?
|
33
|
+
end
|
34
|
+
|
35
|
+
Zoid::Response.new(response.status, response.body)
|
36
|
+
end
|
37
|
+
|
26
38
|
private
|
27
39
|
|
28
40
|
def connection(&block)
|
29
41
|
@connection ||= Faraday.new(connection_options) do |builder|
|
42
|
+
builder.request :json
|
30
43
|
builder.response :json
|
31
44
|
|
32
45
|
@builder.call(builder) if @builder
|
data/lib/zoid/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Sarcevic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|