spear-cb-api 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spear/plugins/model/application.rb +2 -2
- data/lib/spear/plugins/model/resume.rb +1 -1
- data/lib/spear/plugins/save_apis.rb +2 -2
- data/lib/spear/request.rb +10 -2
- data/lib/spear/resource/application.rb +3 -2
- data/lib/spear/version.rb +1 -1
- data/spec/spear_spec.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: b2e311f249fe16103030dcf87ff977efe49d5df5
|
4
|
+
data.tar.gz: 54b0b6702312257e9a96096d85425ac71a6fa620
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eb9c25713ddc44f31ca0ea5cb8a8a584ecd8ea474fe9dc4e4f0adce64a56cf3991c045077a5f78260cd0332145826bf092a48990c52d064c72518618f5bd31a
|
7
|
+
data.tar.gz: 2d2f1948757026942b8e5a52bde0849aa88fdb5f23a51bd939bdf95f4b0a2d5a0d1b161bc90c97b59b886f9c97d64527dd47e01ddbbc29dda5631105fd6143ed
|
@@ -25,8 +25,8 @@ module Spear
|
|
25
25
|
Structure::Application::Blank.new(response)
|
26
26
|
end
|
27
27
|
|
28
|
-
def application_submit(job_did, questions=[])
|
29
|
-
response = super(job_did, questions)
|
28
|
+
def application_submit(job_did, questions=[], test=false)
|
29
|
+
response = super(job_did, questions, test)
|
30
30
|
Structure::Application::Submit.new(response)
|
31
31
|
end
|
32
32
|
end
|
@@ -29,9 +29,9 @@ module Spear
|
|
29
29
|
params[:request] = self.api_response.request.options[:body] || self.api_response.request.options[:query]
|
30
30
|
if params[:request].kind_of?(String)
|
31
31
|
# parse file api
|
32
|
-
params[:request].gsub!(/<FileBytes>(
|
32
|
+
params[:request].gsub!(/<FileBytes>(.|\n)*<\/FileBytes>/m, '<FileBytes>...</FileBytes>')
|
33
33
|
# apply job api
|
34
|
-
params[:request].gsub!(/<ResumeData>(
|
34
|
+
params[:request].gsub!(/<ResumeData>(.|\n)*<\/ResumeData>/m, '<ResumeData>...</ResumeData>')
|
35
35
|
elsif params[:request].kind_of?(Hash)
|
36
36
|
# upload file api
|
37
37
|
params[:request][:FileBytes] = '...'
|
data/lib/spear/request.rb
CHANGED
@@ -62,7 +62,11 @@ module Spear
|
|
62
62
|
# splice request body
|
63
63
|
def splice_body
|
64
64
|
@body[:DeveloperKey] = Spear.dev_key
|
65
|
-
|
65
|
+
|
66
|
+
if need_test_element?
|
67
|
+
@body[:Test] = @api_options[:test_element].nil? ? Spear.use_test? : @api_options[:test_element]
|
68
|
+
end
|
69
|
+
|
66
70
|
to_xml(@body)
|
67
71
|
end
|
68
72
|
|
@@ -75,7 +79,11 @@ module Spear
|
|
75
79
|
# splice query(url params) {:query => {}} with DeveloperKey and Test
|
76
80
|
def splice_query
|
77
81
|
@query[:DeveloperKey] = Spear.dev_key
|
78
|
-
|
82
|
+
|
83
|
+
if need_test_element?
|
84
|
+
@query[:Test] = @api_options[:test_element].nil? ? Spear.use_test? : @api_options[:test_element]
|
85
|
+
end
|
86
|
+
|
79
87
|
@query
|
80
88
|
end
|
81
89
|
|
@@ -36,10 +36,11 @@ module Spear
|
|
36
36
|
Spear::Request.new(:get, Spear.uri_application_blank, {query: {JobDID: job_did}}).execute
|
37
37
|
end
|
38
38
|
|
39
|
-
def application_submit(job_did, questions=[])
|
39
|
+
def application_submit(job_did, questions=[], test=false)
|
40
40
|
raise Spear::ParametersRequired.new('JobDID') if job_did.blank?
|
41
41
|
Spear::Request.new(:post, Spear.uri_application_submit, {
|
42
|
-
api_options: {root_element: 'RequestApplication'
|
42
|
+
api_options: {root_element: 'RequestApplication', test_element: test},
|
43
|
+
body: {JobDID: job_did, Responses: questions}}).execute
|
43
44
|
end
|
44
45
|
end
|
45
46
|
end
|
data/lib/spear/version.rb
CHANGED
data/spec/spear_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spear-cb-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CBluowei
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|