greenhouse_io-gitlab 2.5.5 → 2.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/greenhouse_io/api.rb +6 -3
- data/lib/greenhouse_io/api/job_board.rb +7 -7
- data/lib/greenhouse_io/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffad7d5d1ccee961e66630d593e590a3165fb9b24cf42c67e5a3755552dc6088
|
4
|
+
data.tar.gz: 3c868a257c3842d7901a625741ead3e2a5190b28f59139866fdb3358a788bf9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaba6f630f8d0948aa4657b3810c504f2ce1eb212979f794bd771cb784764992536dbe21aacf1460ef725c39326143d2dc5a2aa8e0462e54446b03aedb3883f4
|
7
|
+
data.tar.gz: f213ef837d7abb67c4c89a0a508f0ce4e8205af71627e388cb3a52252020236b9b1e0e54a16d5ff6a2fdd049ed3b7ae29a701d516ed021b9e6917f5716775035
|
data/lib/greenhouse_io/api.rb
CHANGED
@@ -3,9 +3,12 @@ require 'rest-client'
|
|
3
3
|
module GreenhouseIo
|
4
4
|
module API
|
5
5
|
def get_response(url, options)
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
headers = {}
|
7
|
+
if self.api_token
|
8
|
+
credential = Base64.strict_encode64(self.api_token + ':')
|
9
|
+
headers = { "Authorization" => "Basic " + credential }
|
10
|
+
end
|
11
|
+
headers.merge!({ params: options }) unless options.empty?
|
9
12
|
RestClient.get(url, headers)
|
10
13
|
end
|
11
14
|
|
@@ -10,31 +10,31 @@ module GreenhouseIo
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def offices(options = {})
|
13
|
-
get_from_job_board_api("/boards/#{ query_organization(options) }/embed/offices")
|
13
|
+
get_from_job_board_api("#{BASE_URL}/boards/#{ query_organization(options) }/embed/offices")
|
14
14
|
end
|
15
15
|
|
16
16
|
def office(id, options = {})
|
17
|
-
get_from_job_board_api("/boards/#{ query_organization(options) }/embed/office",
|
17
|
+
get_from_job_board_api("#{BASE_URL}/boards/#{ query_organization(options) }/embed/office", { id: id })
|
18
18
|
end
|
19
19
|
|
20
20
|
def departments(options = {})
|
21
|
-
get_from_job_board_api("/boards/#{ query_organization(options) }/embed/departments")
|
21
|
+
get_from_job_board_api("#{BASE_URL}/boards/#{ query_organization(options) }/embed/departments")
|
22
22
|
end
|
23
23
|
|
24
24
|
def department(id, options = {})
|
25
|
-
get_from_job_board_api("/boards/#{ query_organization(options) }/embed/department",
|
25
|
+
get_from_job_board_api("#{BASE_URL}/boards/#{ query_organization(options) }/embed/department", { id: id })
|
26
26
|
end
|
27
27
|
|
28
28
|
def jobs(options = {})
|
29
|
-
get_from_job_board_api("/boards/#{ query_organization(options) }/embed/jobs",
|
29
|
+
get_from_job_board_api("#{BASE_URL}/boards/#{ query_organization(options) }/embed/jobs", { content: options[:content] })
|
30
30
|
end
|
31
31
|
|
32
32
|
def job(id, options = {})
|
33
|
-
get_from_job_board_api("/boards/#{ query_organization(options) }/embed/job",
|
33
|
+
get_from_job_board_api("#{BASE_URL}/boards/#{ query_organization(options) }/embed/job", { id: id, questions: options[:questions] })
|
34
34
|
end
|
35
35
|
|
36
36
|
def apply_to_job(job_form_hash)
|
37
|
-
post_to_job_board_api(
|
37
|
+
post_to_job_board_api("#{BASE_URL}/applications", { :body => job_form_hash, :basic_auth => basic_auth })
|
38
38
|
end
|
39
39
|
|
40
40
|
private
|