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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17df6ae7871416fcedd2e35cd2cb95b11f098e23
4
- data.tar.gz: c4af4311e1672302f81030e2cf27563a16d44bab
3
+ metadata.gz: fcba6f98e25a88907df749d5157c9b5c3c0b248d
4
+ data.tar.gz: 85de28aa04099ef2b28589dfca798da929db1568
5
5
  SHA512:
6
- metadata.gz: d9cfeda1cafdcdb06ae01301b1ead4356f660f2166dc35b578500ae4b625b44094d9d737bf10f8a765946206a684831142307478eed7c99ba99310196ae264d7
7
- data.tar.gz: 9327085005db4cf15d62a4823cdc6707ad98a78848323b7fc2c126e626c4f057c90c7b70f03995b143716f8398c2c6516e30c181799ad4a8e5ad444530249e69
6
+ metadata.gz: 284f00330111bc5264c06eed950845b20bf064201f7f19fc6f6f7a7d449a3770818318871fd03b19c7f18e13fd661c4398d2afeb3b6861a5216f31945b80ee40
7
+ data.tar.gz: 0b85ff1b26e22d5e390ff17336836b074c866b5d120067276b3d18202e2f870298159e7c63f4850c837471086e0dd5631aa5008ccc580bb48c5e643b11ad073d
@@ -20,7 +20,7 @@ module Helium
20
20
  include Helium::Client::DeviceConfigurations
21
21
 
22
22
 
23
- API_VERSION = 1
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
@@ -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 += "/v#{@api_version}" if @api_version
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.merge({
54
- 'Authorization' => api_key
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 = {})
@@ -1,3 +1,3 @@
1
1
  module Helium
2
- VERSION = "0.19.0"
2
+ VERSION = "0.20.0"
3
3
  end
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.19.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-01 00:00:00.000000000 Z
12
+ date: 2016-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: typhoeus