fountain 0.0.19 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +8 -0
- data/lib/fountain/api/applicants.rb +3 -3
- data/lib/fountain/api/request_helper.rb +1 -1
- data/lib/fountain/gem_version.rb +1 -1
- data/lib/fountain.rb +25 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2caecf747b171c9f0aa3452a4a90605bc996d5c6796b82401d88c6143f59b4c
|
4
|
+
data.tar.gz: 4cec155ecc58f2c9afafb246ddbb1178897402331fa0f9a293f7fe3b2986c671
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df42f04e5f94ac3cb071a5433e32c360b7322f847dcf770267a11f335ba8c385429c9a1cbe96d912ca265cb096cdc6ef128a2869d6d8f63b8cc0f1fe7748cb1f
|
7
|
+
data.tar.gz: d7ba85809490b746b4913b2a92e287b76a2c817613bb9dbe601acebe982545ae8d2600df4c7216d1aae298a5b61691f5e1ce6fa0fd45e92fb41b4767c68df03e
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
## Unreleased
|
4
4
|
- None
|
5
5
|
|
6
|
+
## [0.0.21](releases/tag/v0.0.21) - 2024-08-02
|
7
|
+
### Added
|
8
|
+
- [#12] Add Fountain::UnexpectedHTTPError to provide more error context ([@abrom][])
|
9
|
+
|
10
|
+
## [0.0.20](releases/tag/v0.0.20) - 2024-04-30
|
11
|
+
### Added
|
12
|
+
- [#11] Fix query parameter bug in Applicants#advance_applicants ([@abrom][])
|
13
|
+
|
6
14
|
## [0.0.19](releases/tag/v0.0.19) - 2024-04-30
|
7
15
|
### Added
|
8
16
|
- [#10] Add `funnel_id` to Applicants#advance_applicant ([@abrom][])
|
@@ -145,12 +145,12 @@ module Fountain
|
|
145
145
|
# skip_automated_actions - `true` if you want to skip automated
|
146
146
|
# actions when advancing the applicant
|
147
147
|
# funnel_id - Used for bulk advancing applicants to a workflow-based funnel
|
148
|
-
def self.advance_applicants(applicant_ids, stage_id,
|
148
|
+
def self.advance_applicants(applicant_ids, stage_id, advanced_options = {})
|
149
149
|
response = request(
|
150
|
-
"/v2/applicants/advance
|
150
|
+
"/v2/applicants/advance?stage_id=#{stage_id}",
|
151
151
|
method: :post,
|
152
152
|
body: Util.slice_hash(
|
153
|
-
|
153
|
+
advanced_options,
|
154
154
|
:skip_automated_actions, :funnel_id
|
155
155
|
).merge(ids: applicant_ids)
|
156
156
|
)
|
@@ -43,7 +43,7 @@ module Fountain
|
|
43
43
|
when *[expected_response].flatten then nil
|
44
44
|
when Net::HTTPUnauthorized then raise Fountain::AuthenticationError
|
45
45
|
when Net::HTTPNotFound then raise Fountain::NotFoundError
|
46
|
-
else raise
|
46
|
+
else raise Fountain::UnexpectedHTTPError, response
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
data/lib/fountain/gem_version.rb
CHANGED
data/lib/fountain.rb
CHANGED
@@ -19,6 +19,31 @@ module Fountain
|
|
19
19
|
|
20
20
|
class InvalidMethodError < HTTPError; end
|
21
21
|
|
22
|
+
#
|
23
|
+
# Unexpected HTTP Error
|
24
|
+
#
|
25
|
+
class UnexpectedHTTPError < HTTPError
|
26
|
+
def initialize(response)
|
27
|
+
@response = response
|
28
|
+
super("Unexpected http response code: #{response.code}")
|
29
|
+
end
|
30
|
+
|
31
|
+
def response_code
|
32
|
+
@response.code
|
33
|
+
end
|
34
|
+
|
35
|
+
def parsed_body
|
36
|
+
JSON.parse(@response.body)
|
37
|
+
rescue JSON::ParserError
|
38
|
+
@response.body
|
39
|
+
end
|
40
|
+
|
41
|
+
def response_message
|
42
|
+
body = parsed_body
|
43
|
+
body['message'] if body.is_a? Hash
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
22
47
|
class JsonParseError < Error; end
|
23
48
|
|
24
49
|
class MissingApiKeyError < Error; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fountain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- abrom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Fountain REST API v2 wrapper for Ruby
|
14
14
|
email:
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
81
|
+
rubygems_version: 3.4.19
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Fountain REST API v2 wrapper for Ruby
|