openapply 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGE_LOG.md +3 -0
- data/Gemfile.lock +6 -6
- data/lib/openapply/client.rb +11 -5
- data/lib/openapply/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f5f9e9dffcc5d31464293631392d8cfca4c89c462f588e9271b9d9975fc585d
|
4
|
+
data.tar.gz: 50b2a66cc01a5d017246799febb2cde80b905db8f18f33c223cf2531b30f07f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aeab600b2b9fb214bdc75b927f83a4ea0d8a64b070cec1193ced7bfdaf7d70538e146259c48239f40994d623a024f55042b5dec87eb586fdbb3df70afb3a1a8
|
7
|
+
data.tar.gz: c45b4d9b269d2d39ea785236f82bf2df7c964bd2c23959bcbf8061a381806238011009a496b8361bd59729569cb390c9a908d79e4758a367fbe290c0f368c997
|
data/CHANGE_LOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
openapply (0.3.
|
4
|
+
openapply (0.3.3)
|
5
5
|
httparty (~> 0.15)
|
6
6
|
json (~> 2.1)
|
7
7
|
|
@@ -16,7 +16,7 @@ GEM
|
|
16
16
|
crack (0.4.3)
|
17
17
|
safe_yaml (~> 1.0.0)
|
18
18
|
diff-lcs (1.3)
|
19
|
-
docile (1.
|
19
|
+
docile (1.3.0)
|
20
20
|
hashdiff (0.3.7)
|
21
21
|
httparty (0.16.2)
|
22
22
|
multi_xml (>= 0.5.2)
|
@@ -26,8 +26,8 @@ GEM
|
|
26
26
|
pry (0.11.3)
|
27
27
|
coderay (~> 1.1.0)
|
28
28
|
method_source (~> 0.9.0)
|
29
|
-
public_suffix (3.0.
|
30
|
-
rake (12.3.
|
29
|
+
public_suffix (3.0.2)
|
30
|
+
rake (12.3.1)
|
31
31
|
rspec (3.7.0)
|
32
32
|
rspec-core (~> 3.7.0)
|
33
33
|
rspec-expectations (~> 3.7.0)
|
@@ -42,8 +42,8 @@ GEM
|
|
42
42
|
rspec-support (~> 3.7.0)
|
43
43
|
rspec-support (3.7.1)
|
44
44
|
safe_yaml (1.0.4)
|
45
|
-
simplecov (0.
|
46
|
-
docile (~> 1.1
|
45
|
+
simplecov (0.16.1)
|
46
|
+
docile (~> 1.1)
|
47
47
|
json (>= 1.8, < 3)
|
48
48
|
simplecov-html (~> 0.10.0)
|
49
49
|
simplecov-html (0.10.2)
|
data/lib/openapply/client.rb
CHANGED
@@ -23,8 +23,14 @@ module Openapply
|
|
23
23
|
api_url = ENV['OA_BASE_URI']
|
24
24
|
api_key = ENV['OA_AUTH_TOKEN']
|
25
25
|
|
26
|
-
raise ArgumentError, '
|
27
|
-
|
26
|
+
raise ArgumentError, 'OA_TIMEOUT is missing' if api_timeout.nil? or
|
27
|
+
not api_timeout.is_a? Integer
|
28
|
+
raise ArgumentError, 'OA_API_PATH is missing' if api_path.nil? or
|
29
|
+
api_path.empty?
|
30
|
+
raise ArgumentError, 'OA_BASE_URI is missing' if api_url.nil? or
|
31
|
+
api_url.empty?
|
32
|
+
raise ArgumentError, 'OA_AUTH_TOKEN is missing' if api_key.nil? or
|
33
|
+
api_key.empty?
|
28
34
|
end
|
29
35
|
|
30
36
|
def api_url
|
@@ -71,9 +77,9 @@ module Openapply
|
|
71
77
|
# @param options - see httparty options [http://www.rubydoc.info/github/jnunemaker/httparty]
|
72
78
|
def oa_answer(url, options={})
|
73
79
|
return { error: 'no url given' } if url.nil? or url.to_s.eql? ""
|
74
|
-
return { error: 'bad url - has space' } if url
|
75
|
-
return { error: 'bad api_path' } unless url
|
76
|
-
return { error: 'bad auth_token' } unless url
|
80
|
+
return { error: 'bad url - has space' } if url&.include? " "
|
81
|
+
return { error: 'bad api_path' } unless url&.include? "#{api_path}"
|
82
|
+
return { error: 'bad auth_token' } unless url&.include? "auth_token=#{api_key}"
|
77
83
|
|
78
84
|
api_answer = oa_api_call(url, options)
|
79
85
|
|
data/lib/openapply/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapply
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bill Tihen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|