helium-ruby 0.19.0 → 0.20.0
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.
- checksums.yaml +4 -4
- data/lib/helium/client.rb +2 -1
- data/lib/helium/client/http.rb +10 -4
- data/lib/helium/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: fcba6f98e25a88907df749d5157c9b5c3c0b248d
|
4
|
+
data.tar.gz: 85de28aa04099ef2b28589dfca798da929db1568
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 284f00330111bc5264c06eed950845b20bf064201f7f19fc6f6f7a7d449a3770818318871fd03b19c7f18e13fd661c4398d2afeb3b6861a5216f31945b80ee40
|
7
|
+
data.tar.gz: 0b85ff1b26e22d5e390ff17336836b074c866b5d120067276b3d18202e2f870298159e7c63f4850c837471086e0dd5631aa5008ccc580bb48c5e643b11ad073d
|
data/lib/helium/client.rb
CHANGED
@@ -20,7 +20,7 @@ module Helium
|
|
20
20
|
include Helium::Client::DeviceConfigurations
|
21
21
|
|
22
22
|
|
23
|
-
API_VERSION =
|
23
|
+
API_VERSION = 'v1'
|
24
24
|
HOST = 'api.helium.com'
|
25
25
|
PROTOCOL = 'https'
|
26
26
|
|
@@ -32,6 +32,7 @@ module Helium
|
|
32
32
|
@api_version = opts.fetch(:api_version, API_VERSION)
|
33
33
|
@verify_peer = opts.fetch(:verify_peer, true)
|
34
34
|
@debug = opts.fetch(:debug, false)
|
35
|
+
@headers = opts.fetch(:headers, {})
|
35
36
|
end
|
36
37
|
|
37
38
|
def inspect
|
data/lib/helium/client/http.rb
CHANGED
@@ -27,6 +27,10 @@ module Helium
|
|
27
27
|
run(path, :patch, opts)
|
28
28
|
end
|
29
29
|
|
30
|
+
def put(path, opts = {})
|
31
|
+
run(path, :put, opts)
|
32
|
+
end
|
33
|
+
|
30
34
|
def delete(path)
|
31
35
|
response = run(path, :delete)
|
32
36
|
response.code == 204
|
@@ -34,7 +38,7 @@ module Helium
|
|
34
38
|
|
35
39
|
def base_url
|
36
40
|
url = "#{PROTOCOL}://#{@api_host}"
|
37
|
-
url += "
|
41
|
+
url += "/#{@api_version}" if @api_version
|
38
42
|
url
|
39
43
|
end
|
40
44
|
|
@@ -50,9 +54,11 @@ module Helium
|
|
50
54
|
private
|
51
55
|
|
52
56
|
def http_headers
|
53
|
-
BASE_HTTP_HEADERS
|
54
|
-
|
55
|
-
|
57
|
+
BASE_HTTP_HEADERS
|
58
|
+
.merge(@headers)
|
59
|
+
.merge({
|
60
|
+
'Authorization' => api_key
|
61
|
+
})
|
56
62
|
end
|
57
63
|
|
58
64
|
def run(path, method, opts = {})
|
data/lib/helium/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helium-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Allen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-12-
|
12
|
+
date: 2016-12-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: typhoeus
|