gadabout 0.5.2 → 0.5.3

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: 3433d85458be69a5045945c72f5d3a1f2fbe395f
4
- data.tar.gz: 717147224ac5ae33439fb3063e1da92cf832b31d
3
+ metadata.gz: 7b12ea4b1c28e0fdc2cde0cd028fcf388abfc62d
4
+ data.tar.gz: 973046ed58a5b550cc69b6aca76593a280b0b16b
5
5
  SHA512:
6
- metadata.gz: 1acdd88aa33bdd4a4ba20df4f0e26669d23615b77ccddb9047181ea2bf10ff776bb92227c4c94edc8358bb05355a1cf2a9c6b7df0281ce3b0448b02ac82af5a2
7
- data.tar.gz: 7c5738f5ae318098760cd33297868aebd3c6414a419ae729f3094a9d6a3c08535ce5280a2bfc364496c40fd2af1e90bfac2de717f973afd52f1ddd2ca1fd4da2
6
+ metadata.gz: 86cba8a2a484721e196901b4dbab37d1e65717280a616227373d0069a9f228660c0b623f0714a10699c84f46bc179c9c8345c50661db97363a0fecf1d5adeca5
7
+ data.tar.gz: 7eb62d47b6871fbe088bdbbd815bc7fdc94f2eddd674370a5705fafba22b9a4fdd2c1044da0cab5a0fd3ebf479af303180d70a0e6fc05b84f904da33b596726a
@@ -9,6 +9,7 @@ module Gadabout
9
9
  @constraints = []
10
10
  @all_at_once = false
11
11
  @meta = {}
12
+ @id = nil
12
13
  @periodic = nil
13
14
  @priority = 50
14
15
  @region = "global"
@@ -63,6 +64,10 @@ module Gadabout
63
64
  @type = type
64
65
  end
65
66
 
67
+ def id(id)
68
+ @id = id
69
+ end
70
+
66
71
  def priority(priority)
67
72
  @priority = priority
68
73
  end
@@ -51,7 +51,7 @@ module Gadabout
51
51
 
52
52
  #PUT/POST /v1/job
53
53
  def register_job(spec)
54
- path = "/job"
54
+ path = "/job/"
55
55
  return put(path, nil, spec)
56
56
  end
57
57
 
@@ -189,17 +189,20 @@ module Gadabout
189
189
  begin
190
190
  resp = @rest[path].get(:params => params)
191
191
  rescue StandardError => e
192
- raise "Error whilst making HTTP GET request to the Nomad Agent at #{path}: #{e.response}"
192
+ raise "Error whilst making HTTP GET request to the Nomad Agent at #{path}: #{e} #{e.response}"
193
193
  end
194
194
 
195
195
  return JSON.parse(resp)
196
196
  end
197
197
 
198
- def put(path, params = {}, body = '')
198
+ def put(path, params, body)
199
+ body ||= ''
200
+ params ||= {}
201
+
199
202
  begin
200
- resp = @rest[path].put(body, :params => params)
203
+ resp = @rest[path].post(body, :params => params)
201
204
  rescue StandardError => e
202
- raise "Error whilst making HTTP PUT request to the Nomad Agent at #{path}: #{e.response}"
205
+ raise "Error whilst making HTTP PUT request to the Nomad Agent at #{path}: #{e} #{e.response.body}"
203
206
  end
204
207
 
205
208
  return JSON.parse(resp)
@@ -209,7 +212,7 @@ module Gadabout
209
212
  begin
210
213
  resp = @rest[path].delete(:params => params)
211
214
  rescue StandardError => e
212
- raise "Error whilst making HTTP DELETE request to the Nomad Agent at #{path}: #{e.response}"
215
+ raise "Error whilst making HTTP DELETE request to the Nomad Agent at #{path}: #{e} #{e.response}"
213
216
  end
214
217
 
215
218
  return JSON.parse(resp)
@@ -1,3 +1,3 @@
1
1
  module Gadabout
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gadabout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh McGhee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-01 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake