aux_helper 0.0.22 → 0.0.23

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: c1d11d178876f4bc4bf6b3a114858b7150962de6
4
- data.tar.gz: 39a5ae488cf8fcfe12c312ef79e2c0ce1e5ae808
3
+ metadata.gz: f7bf9a743be8e0fb1da86cc5ea9d719eaa8dcd8a
4
+ data.tar.gz: 11b46b404c169583e76526917d072644613cc158
5
5
  SHA512:
6
- metadata.gz: 32fa849c0d8907d2575a454dd2a955fdadd6f0d4549cad48c7ecb27c8770f6951bcd1523ed2b6aab2f5894275e2205c457cccf4bf6cf265e0a75a7160e65ba96
7
- data.tar.gz: b913d803d94d1a1550c439360bb77615a0c239c86bb67f54387b69b831875dd3603f8a97addd0a02907a48a295aec36257ae1d1d57c103f1e1bc7406abc2e787
6
+ metadata.gz: e109fe8f7ceb4a096269e7d33b36722a89c73b9cbd0c3eed3a9a43e826fad9e63657791cab87b2ae496b1bb987056ae34ab70653c053beea9813d77ba0db6c01
7
+ data.tar.gz: 922c305181a505ab0f0d87a348e68fd894d93166bf395a1613139209e64dd7e4e4fe83687a676dcbda22a8a889afada19b405c3b35b182db6cce6a3c0a7341c2
data/lib/aux_helper.rb CHANGED
@@ -31,15 +31,15 @@ module AUXHelper
31
31
 
32
32
  def initialize(api_server, api_key=nil)
33
33
  @api_server = api_server
34
- @api_key = api_key
35
- p " Running AUXHelper version #{AUXHelper::VERSION}"
34
+ @api_key = api_key
35
+ p " Running AUXHelper version #{AUXHelper::VERSION} with server #{api_server}"
36
36
  end
37
37
 
38
38
  attr_reader :api_server
39
39
 
40
40
  # return true when all environment variables are set
41
41
  def self.validate_env_variables(env_vars)
42
- p "Enivonrment variables at runtime"
42
+ p "Environment variables at runtime"
43
43
  env_vars.all? {|env_var|
44
44
  if ENV.has_key? env_var
45
45
  p " #{env_var}=#{ENV[env_var]}"
@@ -51,6 +51,10 @@ module AUXHelper
51
51
  }
52
52
  end
53
53
 
54
+ def set_api_key(key)
55
+ @api_key = key
56
+ end
57
+
54
58
  #
55
59
  # == Description
56
60
  #
@@ -217,13 +221,13 @@ module AUXHelper
217
221
  def compute_headers(isJson=false)
218
222
  headers = Hash.new
219
223
  if @api_key != nil
220
- headers[:headers] = {"Casual-API-Key" => @api_key}
221
- headers[:headers] = {"AUX-API-Key" => @api_key}
224
+ headers[:authorization] = "Bearer #{@api_key}"
222
225
  end
223
226
  if isJson
224
227
  headers[:content_type] = :json
225
228
  headers[:accept] = :json
226
229
  end
230
+ # p headers.inspect
227
231
  return headers
228
232
  end
229
233
 
@@ -1,3 +1,3 @@
1
1
  module AUXHelper
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aux_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - thor-aux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-13 00:00:00.000000000 Z
11
+ date: 2018-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client