fountain 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10955e573502a79fef0792e0784e42223e626ed0f0b203cf06545c75f2dacf8b
4
- data.tar.gz: ee896766bc863df8d400b1285b8d0674e492ee46ea2c3c3d3b92dc2ff7d9b53e
3
+ metadata.gz: 5d78d33209aa2c3222155ea3643333a0df696466b1589d503adcaa28ded7aeea
4
+ data.tar.gz: 4a6ff22d217ee2cae43e6093fa218c450ea673924a71ffcec4bb2b9bd73ebc2b
5
5
  SHA512:
6
- metadata.gz: 8f4a092974c4fbc79d573d7b989feb2082246ae5f9c334b2d1056c2f39415a1eddde341d34d5b57c7d4f0c828b1ecfef38f81d0f822da769eb53299fe6d7d6b8
7
- data.tar.gz: d02cc7baaec15fd06a801b0c3fb7917b0a1a07ef3b4dbc9f4c2d91e9927edf5b3a44485df52cdba1f5c47a5a93e641baff5c8d6a3cf2f52000bfb06c1a43b41d
6
+ metadata.gz: 957fe69e2f9b464fe77bf245f4778e931d071febb8178e476de852c0beb606d2adf49aac0a7c2d1b6c8b926125fa3873f0d66f7119033994137437be0c366fee
7
+ data.tar.gz: e227563179603e1f2e571f22369616bdd3915e58cb8362f195101e53c63325002933d1cb3419eedd12cc476c1d449f639d9b8f235862509182754c5249c0e683
data/.rubocop.yml CHANGED
@@ -1,11 +1,25 @@
1
+ require:
2
+ - rubocop-rake
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ NewCops: enable
7
+ TargetRubyVersion: 2.5
8
+
9
+ Layout/LineLength:
10
+ Max: 120
11
+
1
12
  Metrics/BlockLength:
2
13
  Exclude:
3
14
  - "**/*_spec.rb"
4
15
 
5
- Metrics/LineLength:
6
- Max: 120
7
-
8
16
  Metrics/MethodLength:
9
17
  Max: 15
10
18
  Exclude:
11
19
  - "**/*_spec.rb"
20
+
21
+ RSpec/ExampleLength:
22
+ Max: 15
23
+
24
+ RSpec/MultipleExpectations:
25
+ Max: 5
data/.travis.yml CHANGED
@@ -5,11 +5,10 @@ env:
5
5
  language: ruby
6
6
 
7
7
  rvm:
8
- - 2.1
9
- - 2.2
10
- - 2.3
11
- - 2.4
12
8
  - 2.5
9
+ - 2.6
10
+ - 2.7
11
+ - 3.0
13
12
 
14
13
  before_install:
15
14
  - gem update bundler
@@ -24,7 +23,7 @@ before_script:
24
23
  - ./cc-test-reporter before-build
25
24
 
26
25
  script:
27
- - rubocop
26
+ - bundle exec rubocop
28
27
  - bundle exec rake
29
28
 
30
29
  after_script:
data/fountain.gemspec CHANGED
@@ -15,15 +15,17 @@ 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 = ['>= 2.5.0', '< 3.1.0']
18
19
 
19
20
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec|docs)/}) }
20
21
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
22
  spec.require_paths = ['lib']
22
23
 
23
- spec.add_development_dependency 'bundler', '~> 1.11'
24
24
  spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
25
25
  spec.add_development_dependency 'rspec', '~> 3.0'
26
- spec.add_development_dependency 'rubocop', '~> 0.53'
26
+ spec.add_development_dependency 'rubocop', '~> 1.21'
27
+ spec.add_development_dependency 'rubocop-rake', '~> 0.6'
28
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.5'
27
29
  spec.add_development_dependency 'simplecov', '~> 0.16'
28
30
  spec.add_development_dependency 'webmock', '~> 2.3'
29
31
  end
@@ -50,7 +50,7 @@ module Fountain
50
50
  response = request_json(
51
51
  '/v2/applicants',
52
52
  method: :post,
53
- expected_response: Net::HTTPCreated,
53
+ expected_response: [Net::HTTPCreated, Net::HTTPOK],
54
54
  body: {
55
55
  name: name, email: email, phone_number: phone_number
56
56
  }.merge(filtered_params)
@@ -26,7 +26,7 @@ module Fountain
26
26
  response = request_json(
27
27
  "/v2/applicants/#{applicant_id}/notes",
28
28
  method: :post,
29
- expected_response: Net::HTTPCreated,
29
+ expected_response: [Net::HTTPCreated, Net::HTTPOK],
30
30
  body: { content: content }
31
31
  )
32
32
  Fountain::Note.new response
@@ -40,7 +40,7 @@ module Fountain
40
40
  def check_response(response, expected_response = nil)
41
41
  expected_response ||= Net::HTTPOK
42
42
  case response
43
- when expected_response then nil
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
46
  else raise HTTPError, "Invalid http response code: #{response.code}"
@@ -95,7 +95,7 @@ module Fountain
95
95
  end
96
96
 
97
97
  def create_get_request(path, headers, body)
98
- path += '?' + body.map { |k, v| "#{k}=#{v}" }.join('&') if body
98
+ path += "?#{body.map { |k, v| "#{k}=#{v}" }.join('&')}" if body
99
99
  Net::HTTP::Get.new(path, headers)
100
100
  end
101
101
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fountain
4
- VERSION = '0.0.12'
4
+ VERSION = '0.0.13'
5
5
  end
data/lib/fountain.rb CHANGED
@@ -9,12 +9,19 @@ require 'fountain/util'
9
9
 
10
10
  module Fountain
11
11
  class Error < StandardError; end
12
+
12
13
  class HTTPError < Error; end
14
+
13
15
  class NotFoundError < HTTPError; end
16
+
14
17
  class AuthenticationError < HTTPError; end
18
+
15
19
  class InvalidMethodError < HTTPError; end
20
+
16
21
  class JsonParseError < Error; end
22
+
17
23
  class MissingApiKeyError < Error; end
24
+
18
25
  class StatusError < Error; end
19
26
  end
20
27
 
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fountain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - abrom
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-01 00:00:00.000000000 Z
11
+ date: 2021-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.11'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.11'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rake
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -64,14 +50,42 @@ dependencies:
64
50
  requirements:
65
51
  - - "~>"
66
52
  - !ruby/object:Gem::Version
67
- version: '0.53'
53
+ version: '1.21'
68
54
  type: :development
69
55
  prerelease: false
70
56
  version_requirements: !ruby/object:Gem::Requirement
71
57
  requirements:
72
58
  - - "~>"
73
59
  - !ruby/object:Gem::Version
74
- version: '0.53'
60
+ version: '1.21'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rubocop-rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '0.6'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.6'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rubocop-rspec
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '2.5'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '2.5'
75
89
  - !ruby/object:Gem::Dependency
76
90
  name: simplecov
77
91
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +170,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
170
  requirements:
157
171
  - - ">="
158
172
  - !ruby/object:Gem::Version
159
- version: '0'
173
+ version: 2.5.0
174
+ - - "<"
175
+ - !ruby/object:Gem::Version
176
+ version: 3.1.0
160
177
  required_rubygems_version: !ruby/object:Gem::Requirement
161
178
  requirements:
162
179
  - - ">="