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 +4 -4
- data/lib/aux_helper.rb +9 -5
- data/lib/aux_helper/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: f7bf9a743be8e0fb1da86cc5ea9d719eaa8dcd8a
|
4
|
+
data.tar.gz: 11b46b404c169583e76526917d072644613cc158
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 "
|
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[:
|
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
|
|
data/lib/aux_helper/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2018-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|