fountain 0.0.20 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +3 -3
- data/fountain.gemspec +1 -1
- data/lib/fountain/api/request_helper.rb +1 -1
- data/lib/fountain/gem_version.rb +1 -1
- data/lib/fountain.rb +25 -0
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1086da5daee96536a4d5ddb5c07fc6ee311577cdf64894c8ff8518f645912745
|
4
|
+
data.tar.gz: 275aaf41ff961a1874d7b405567d29b0043d975e9ebee56ee2cd6189863d5ae8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26e7be13d641be07d7e897eca7b100246ed3a1fd742acee423a55622f8443741bfb4cda1bb090dca5d1876824e35acd07a473600a5fce20074bff7a55555b981
|
7
|
+
data.tar.gz: 6602bb745aff563204cfa45102983505acdfd404ac83cb6543b55ef5d821f71eb83c1cc6b18d102fc1f666819de0c074b6b20803cfea481c401f91afc40ed1ba
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
## Unreleased
|
4
4
|
- None
|
5
5
|
|
6
|
+
## [0.0.22](releases/tag/v0.0.22) - 2025-01-14
|
7
|
+
### Added
|
8
|
+
- [#13] Add Ruby support for v3.4 ([@abrom][])
|
9
|
+
|
10
|
+
## [0.0.21](releases/tag/v0.0.21) - 2024-08-02
|
11
|
+
### Added
|
12
|
+
- [#12] Add Fountain::UnexpectedHTTPError to provide more error context ([@abrom][])
|
13
|
+
|
6
14
|
## [0.0.20](releases/tag/v0.0.20) - 2024-04-30
|
7
15
|
### Added
|
8
16
|
- [#11] Fix query parameter bug in Applicants#advance_applicants ([@abrom][])
|
data/Gemfile
CHANGED
@@ -7,8 +7,8 @@ gemspec
|
|
7
7
|
|
8
8
|
gem 'rake', '~> 12.3', '>= 12.3.3'
|
9
9
|
gem 'rspec', '~> 3.0'
|
10
|
-
gem 'rubocop', '~> 1.
|
10
|
+
gem 'rubocop', '~> 1.70'
|
11
11
|
gem 'rubocop-rake', '~> 0.6'
|
12
|
-
gem 'rubocop-rspec', '~>
|
12
|
+
gem 'rubocop-rspec', '~> 3.3'
|
13
13
|
gem 'simplecov', '~> 0.16', '< 0.18'
|
14
|
-
gem 'webmock', '~>
|
14
|
+
gem 'webmock', '~> 3.24'
|
data/fountain.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.description = 'Fountain REST API v2 wrapper for Ruby'
|
16
16
|
spec.homepage = 'https://github.com/Studiosity/fountain-ruby'
|
17
17
|
spec.license = 'MIT'
|
18
|
-
spec.required_ruby_version = ['>= 3.0.0', '< 3.
|
18
|
+
spec.required_ruby_version = ['>= 3.0.0', '< 3.5.0']
|
19
19
|
|
20
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|docs)/}) }
|
21
21
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
@@ -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,13 @@
|
|
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.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- abrom
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-13 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: Fountain REST API v2 wrapper for Ruby
|
14
13
|
email:
|
@@ -60,7 +59,6 @@ licenses:
|
|
60
59
|
- MIT
|
61
60
|
metadata:
|
62
61
|
rubygems_mfa_required: 'true'
|
63
|
-
post_install_message:
|
64
62
|
rdoc_options: []
|
65
63
|
require_paths:
|
66
64
|
- lib
|
@@ -71,15 +69,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
69
|
version: 3.0.0
|
72
70
|
- - "<"
|
73
71
|
- !ruby/object:Gem::Version
|
74
|
-
version: 3.
|
72
|
+
version: 3.5.0
|
75
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
74
|
requirements:
|
77
75
|
- - ">="
|
78
76
|
- !ruby/object:Gem::Version
|
79
77
|
version: '0'
|
80
78
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
82
|
-
signing_key:
|
79
|
+
rubygems_version: 3.6.2
|
83
80
|
specification_version: 4
|
84
81
|
summary: Fountain REST API v2 wrapper for Ruby
|
85
82
|
test_files: []
|