fountain 0.0.12 → 0.0.15

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: 3868db66d0394dff234e43bd0846028a6ce3e42ccb3b13e66079993abc0445ea
4
+ data.tar.gz: 3418f45e396fe4759bef2100c23116dea473528a5a218ba1e1c2d426720ba05d
5
5
  SHA512:
6
- metadata.gz: 8f4a092974c4fbc79d573d7b989feb2082246ae5f9c334b2d1056c2f39415a1eddde341d34d5b57c7d4f0c828b1ecfef38f81d0f822da769eb53299fe6d7d6b8
7
- data.tar.gz: d02cc7baaec15fd06a801b0c3fb7917b0a1a07ef3b4dbc9f4c2d91e9927edf5b3a44485df52cdba1f5c47a5a93e641baff5c8d6a3cf2f52000bfb06c1a43b41d
6
+ metadata.gz: abfae0d0e4a8cf1e9d72284c0c2ae23470bc0b4a1aa42984ccc2aa5537258b3f0b2785d6fa54ffc2d71992d71d43ecb7d2e31fcbf048839c750f686cfbf69ea4
7
+ data.tar.gz: 68c8b87074ddbba9f7a52cdbb69151f3772790b1adf5411791fd9286736585725ff98c002eb0f793f77edc6c59e2503ab5a3d0ad41a0874b6eb08fd23347fea3
@@ -0,0 +1,34 @@
1
+ name: Test Fountain Ruby gem
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ['2.6', '2.7', '3.0', '3.1']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{ matrix.ruby-version }}
23
+ bundler-cache: true
24
+
25
+ - name: Lint code - Rubocop
26
+ run: bundle exec rubocop
27
+
28
+ - name: Run tests
29
+ run: bundle exec rspec
30
+
31
+ - name: Test & publish code coverage
32
+ uses: paambaati/codeclimate-action@v3.0.0
33
+ env:
34
+ CC_TEST_REPORTER_ID: ced551cb55b574bb553181cb1c7abae8452a4f7f6e92df83633984a03693e284
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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  ## Unreleased
4
4
  - None
5
5
 
6
+ ## [0.0.15](releases/tag/v0.0.15) - 2022-06-15
7
+ ### Added
8
+ - [#6] Additional accessor methods to the Applicant class ([@noahkconley][])
9
+
10
+ ## [0.0.14](releases/tag/v0.0.14) - 2022-06-12
11
+ ### Added
12
+ - [#5] Get funnel and get stage to API ([@noahkconley][])
13
+
14
+ ## [0.0.13](releases/tag/v0.0.13) - 2021-09-24
15
+ ### Fixed
16
+ - [#3] Update applicants and notes APIs to use *new* expected return statuses from create actions
17
+
6
18
  ## [0.0.12](releases/tag/v0.0.12) - 2020-03-01
7
19
  ### Fixed
8
20
  - Address CVE-2020-8130 - `rake` OS command injection vulnerability
@@ -55,3 +67,5 @@
55
67
  ## [0.0.2](releases/tag/v0.0.2) - 2018-03-19
56
68
  ### Added
57
69
  - Support for applicant list and update
70
+
71
+ [@noahkconley]: https://github.com/noahkconley
data/fountain.gemspec CHANGED
@@ -15,15 +15,18 @@ 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.2.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']
23
+ spec.metadata['rubygems_mfa_required'] = 'true'
22
24
 
23
- spec.add_development_dependency 'bundler', '~> 1.11'
24
25
  spec.add_development_dependency 'rake', '~> 12.3', '>= 12.3.3'
25
26
  spec.add_development_dependency 'rspec', '~> 3.0'
26
- spec.add_development_dependency 'rubocop', '~> 0.53'
27
- spec.add_development_dependency 'simplecov', '~> 0.16'
27
+ spec.add_development_dependency 'rubocop', '~> 1.21'
28
+ spec.add_development_dependency 'rubocop-rake', '~> 0.6'
29
+ spec.add_development_dependency 'rubocop-rspec', '~> 2.5'
30
+ spec.add_development_dependency 'simplecov', '~> 0.16', '< 0.18'
28
31
  spec.add_development_dependency 'webmock', '~> 2.3'
29
32
  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)
@@ -18,6 +18,15 @@ module Fountain
18
18
  Fountain::Funnels.new response
19
19
  end
20
20
 
21
+ #
22
+ # Get Funnel Info
23
+ # @param [String] funnel_id ID of the Fountain funnel
24
+ # @return [Fountain::Funnel]
25
+ def self.get(funnel_id)
26
+ response = request_json("/v2/funnels/#{funnel_id}")
27
+ Fountain::Funnel.new response
28
+ end
29
+
21
30
  #
22
31
  # Update Funnel
23
32
  # @param [String] funnel_id ID of the Fountain funnel
@@ -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
 
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fountain
4
+ module Api
5
+ #
6
+ # Fountain Stage Management API
7
+ #
8
+ class Stages
9
+ extend RequestHelper
10
+
11
+ #
12
+ # Get Stage Info
13
+ # @param [String] stage_id ID of the Fountain stage
14
+ # @return [Fountain::Stage]
15
+ def self.get(stage_id)
16
+ response = request_json("/v2/stages/#{stage_id}")
17
+ Fountain::Stage.new response
18
+ end
19
+ end
20
+ end
21
+ end
@@ -25,6 +25,16 @@ module Fountain
25
25
  Time.parse raw_data['created_at']
26
26
  end
27
27
 
28
+ # Updated at
29
+ def updated_at
30
+ Time.parse raw_data['updated_at']
31
+ end
32
+
33
+ # Last transitioned at
34
+ def last_transitioned_at
35
+ Time.parse raw_data['last_transitioned_at']
36
+ end
37
+
28
38
  # Email
29
39
  def email
30
40
  raw_data['email']
@@ -40,11 +50,51 @@ module Fountain
40
50
  raw_data['phone_number']
41
51
  end
42
52
 
53
+ # Normalized phone number
54
+ def normalized_phone_number
55
+ raw_data['normalized_phone_number']
56
+ end
57
+
58
+ # Is duplicate
59
+ def duplicate?
60
+ raw_data['is_duplicate']
61
+ end
62
+
63
+ # Receive automated emails
64
+ def receive_automated_emails?
65
+ raw_data['receive_automated_emails']
66
+ end
67
+
68
+ # Can receive sms
69
+ def can_receive_sms?
70
+ raw_data['can_receive_sms']
71
+ end
72
+
73
+ # Phone platform
74
+ def phone_platform
75
+ raw_data['phone_platform']
76
+ end
77
+
78
+ # Rejection reason
79
+ def rejection_reason
80
+ raw_data['rejection_reason']
81
+ end
82
+
83
+ # On hold reason
84
+ def on_hold_reason
85
+ raw_data['on_hold_reason']
86
+ end
87
+
43
88
  # data
44
89
  def data
45
90
  raw_data['data']
46
91
  end
47
92
 
93
+ # Addresses
94
+ def addresses
95
+ raw_data['addresses']
96
+ end
97
+
48
98
  # Funnel
49
99
  def funnel
50
100
  Funnel.new raw_data['funnel']
@@ -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.15'
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
 
@@ -41,3 +48,4 @@ require 'fountain/api/available_slots'
41
48
  require 'fountain/api/funnels'
42
49
  require 'fountain/api/labels'
43
50
  require 'fountain/api/notes'
51
+ require 'fountain/api/stages'
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.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - abrom
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-01 00:00:00.000000000 Z
11
+ date: 2022-06-15 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
@@ -79,6 +93,9 @@ dependencies:
79
93
  - - "~>"
80
94
  - !ruby/object:Gem::Version
81
95
  version: '0.16'
96
+ - - "<"
97
+ - !ruby/object:Gem::Version
98
+ version: '0.18'
82
99
  type: :development
83
100
  prerelease: false
84
101
  version_requirements: !ruby/object:Gem::Requirement
@@ -86,6 +103,9 @@ dependencies:
86
103
  - - "~>"
87
104
  - !ruby/object:Gem::Version
88
105
  version: '0.16'
106
+ - - "<"
107
+ - !ruby/object:Gem::Version
108
+ version: '0.18'
89
109
  - !ruby/object:Gem::Dependency
90
110
  name: webmock
91
111
  requirement: !ruby/object:Gem::Requirement
@@ -108,9 +128,9 @@ executables:
108
128
  extensions: []
109
129
  extra_rdoc_files: []
110
130
  files:
131
+ - ".github/workflows/test.yml"
111
132
  - ".gitignore"
112
133
  - ".rubocop.yml"
113
- - ".travis.yml"
114
134
  - CHANGELOG.md
115
135
  - Gemfile
116
136
  - LICENSE
@@ -125,6 +145,7 @@ files:
125
145
  - lib/fountain/api/labels.rb
126
146
  - lib/fountain/api/notes.rb
127
147
  - lib/fountain/api/request_helper.rb
148
+ - lib/fountain/api/stages.rb
128
149
  - lib/fountain/applicant.rb
129
150
  - lib/fountain/applicants.rb
130
151
  - lib/fountain/background_check.rb
@@ -147,8 +168,9 @@ files:
147
168
  homepage: https://github.com/Studiosity/fountain-ruby
148
169
  licenses:
149
170
  - MIT
150
- metadata: {}
151
- post_install_message:
171
+ metadata:
172
+ rubygems_mfa_required: 'true'
173
+ post_install_message:
152
174
  rdoc_options: []
153
175
  require_paths:
154
176
  - lib
@@ -156,15 +178,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
178
  requirements:
157
179
  - - ">="
158
180
  - !ruby/object:Gem::Version
159
- version: '0'
181
+ version: 2.5.0
182
+ - - "<"
183
+ - !ruby/object:Gem::Version
184
+ version: 3.2.0
160
185
  required_rubygems_version: !ruby/object:Gem::Requirement
161
186
  requirements:
162
187
  - - ">="
163
188
  - !ruby/object:Gem::Version
164
189
  version: '0'
165
190
  requirements: []
166
- rubygems_version: 3.0.6
167
- signing_key:
191
+ rubygems_version: 3.0.9
192
+ signing_key:
168
193
  specification_version: 4
169
194
  summary: Fountain REST API v2 wrapper for Ruby
170
195
  test_files: []
data/.travis.yml DELETED
@@ -1,31 +0,0 @@
1
- env:
2
- global:
3
- - CC_TEST_REPORTER_ID=ced551cb55b574bb553181cb1c7abae8452a4f7f6e92df83633984a03693e284
4
-
5
- language: ruby
6
-
7
- rvm:
8
- - 2.1
9
- - 2.2
10
- - 2.3
11
- - 2.4
12
- - 2.5
13
-
14
- before_install:
15
- - gem update bundler
16
-
17
- install:
18
- - bundle install --jobs=3 --retry=3
19
- - gem install rubocop
20
-
21
- before_script:
22
- - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
23
- - chmod +x ./cc-test-reporter
24
- - ./cc-test-reporter before-build
25
-
26
- script:
27
- - rubocop
28
- - bundle exec rake
29
-
30
- after_script:
31
- - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT