teamtailor 0.2.4 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65d5517a7804ca23cfab37e186ce9a3a8e6fd834d19142f1639bd43a713f0cad
4
- data.tar.gz: 1ce95b3c0f5734a5a75d7e735a2938396e66b1c6a66ecb636f11951e99cb16b4
3
+ metadata.gz: 21d34e982de83e86e65d3fbf16e09a7896132d1c770df881bd1ddbb057014979
4
+ data.tar.gz: 52574ee9d3ff95ac04b7871270398a3eab142fe0cfa75f8d815b8b18620feee8
5
5
  SHA512:
6
- metadata.gz: befca1d520b6e38edde324a89a5ed7e2e45df37a08037c2ea466703e558d3a88c4401878c33e3021b38408ea5567616c5d67cc5ebeaac60eeaff289b29b6954c
7
- data.tar.gz: c03ff827ea515229c96f4380a3aea14e5989060ffa1bf9c8146149135475040591179aad9444aee343bb81903a0f119dba9b5302589dde5dded132865c981654
6
+ metadata.gz: 797d6283055aa61d6691d39bd26fcd5d6d0846601eddae1d5b9a3636151a7da27925fd8e305b790e48d3ca54e4b656e8f3e21b4b4065612d77cc3acd080adfae
7
+ data.tar.gz: 8afe108bb7fe23e590580038c896abf08535494934c5ca5a96b5cf49a86a694b5574ca8cc1af0a63038378612554977ab90e0e9bfa855b387bc96fc62771f9fa
@@ -0,0 +1,33 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ main ]
13
+ pull_request:
14
+ branches: [ main ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+
21
+ steps:
22
+ - uses: actions/checkout@v2
23
+ - name: Set up Ruby
24
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
25
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
26
+ # uses: ruby/setup-ruby@v1
27
+ uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
28
+ with:
29
+ ruby-version: 2.6
30
+ - name: Install dependencies
31
+ run: bundle install
32
+ - name: Run tests
33
+ run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  ## Unreleased
2
2
 
3
+ ## v0.3.2 - 2021-02-03
4
+
5
+ - Add support for `CustomField::Select` and `CustomField::MultiSelect`
6
+
7
+ ## v0.3.1 - 2020-11-13
8
+
9
+ - Update metadata in the `teamtailor.gemspec`
10
+
11
+ ## v0.3.0 - 2020-06-30
12
+
13
+ - [BREAKING] Update `Teamtailor::Relationship` to always return multiple records
14
+ - Add `Teamtailor::Requisition` and `Client#requisitions`
15
+ - Add `Teamtailor::RequisitionStepVerdict`
16
+ - Fix accessing nested relationships on `Relationship`
17
+
18
+ ## v0.2.6 - 2020-05-18
19
+
20
+ - Add `Teamtailor::PartnerResult` and `Client#partner_results`
21
+ - Add `Teamtailor::Referral` and `Client#referrals`
22
+ - Add `Teamtailor::CustomField` and `Teamtailor::CustomFieldValue`
23
+ - Add `Client#custom_fields` and `Client#custom_field_values`
24
+
25
+ ## v0.2.5 - 2020-05-15
26
+
27
+ - Add `filters:` as an argument to `Client#jobs`
28
+
3
29
  ## v0.2.4 - 2020-04-07
4
30
 
5
31
  - Add `Teamtailor::Location` and `Client#locations`
@@ -15,7 +41,7 @@
15
41
 
16
42
  - Move serialization logic in the `Teamtailor::Record` base class (`9ec63a0`)
17
43
  - Fix serializing/deserializing loaded relationships for
18
- `Teamtailor::JobApplication` (`428e2d`)
44
+ `Teamtailor::JobApplication` (`428e2d`)
19
45
 
20
46
  ## v0.2.1 - 2020-03-31
21
47
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- teamtailor (0.2.4)
4
+ teamtailor (0.3.2)
5
5
  typhoeus (~> 1.3.1)
6
6
 
7
7
  GEM
@@ -16,7 +16,7 @@ GEM
16
16
  docile (1.3.2)
17
17
  ethon (0.12.0)
18
18
  ffi (>= 1.3.0)
19
- ffi (1.12.2)
19
+ ffi (1.13.1)
20
20
  hashdiff (1.0.1)
21
21
  jaro_winkler (1.5.4)
22
22
  parallel (1.19.1)
@@ -73,4 +73,4 @@ DEPENDENCIES
73
73
  webmock (~> 3.4, >= 3.4.2)
74
74
 
75
75
  BUNDLED WITH
76
- 2.1.2
76
+ 2.1.4
data/README.md CHANGED
@@ -117,7 +117,7 @@ git commits and tags, and push the `.gem` file to
117
117
  ## Contributing
118
118
 
119
119
  Bug reports and pull requests are welcome on GitHub at
120
- https://github.com/bzf/teamtailor-rb.
120
+ https://github.com/teamtailor/teamtailor-rb.
121
121
 
122
122
 
123
123
  ## License
@@ -36,7 +36,11 @@ module Teamtailor
36
36
  ).call
37
37
  end
38
38
 
39
- def jobs(page: 1, include: [])
39
+ def jobs(page: 1, include: [], filters: {})
40
+ filter_params = filters.keys.map do |key|
41
+ { "filter[#{key}]" => filters[key] }
42
+ end
43
+
40
44
  Teamtailor::Request.new(
41
45
  base_url: base_url,
42
46
  api_token: api_token,
@@ -45,8 +49,8 @@ module Teamtailor
45
49
  params: {
46
50
  'page[number]' => page,
47
51
  'page[size]' => 30,
48
- 'include' => include.join(',')
49
- }
52
+ 'include' => include.join(','),
53
+ }.merge(*filter_params)
50
54
  ).call
51
55
  end
52
56
 
@@ -134,6 +138,76 @@ module Teamtailor
134
138
  ).call
135
139
  end
136
140
 
141
+ def custom_fields(page: 1, include: [])
142
+ Teamtailor::Request.new(
143
+ base_url: base_url,
144
+ api_token: api_token,
145
+ api_version: api_version,
146
+ path: '/v1/custom-fields',
147
+ params: {
148
+ 'page[number]' => page,
149
+ 'page[size]' => 30,
150
+ 'include' => include.join(',')
151
+ }
152
+ ).call
153
+ end
154
+
155
+ def custom_field_values(page: 1, include: [])
156
+ Teamtailor::Request.new(
157
+ base_url: base_url,
158
+ api_token: api_token,
159
+ api_version: api_version,
160
+ path: '/v1/custom-field-values',
161
+ params: {
162
+ 'page[number]' => page,
163
+ 'page[size]' => 30,
164
+ 'include' => include.join(',')
165
+ }
166
+ ).call
167
+ end
168
+
169
+ def referrals(page: 1, include: [])
170
+ Teamtailor::Request.new(
171
+ base_url: base_url,
172
+ api_token: api_token,
173
+ api_version: api_version,
174
+ path: '/v1/referrals',
175
+ params: {
176
+ 'page[number]' => page,
177
+ 'page[size]' => 30,
178
+ 'include' => include.join(',')
179
+ }
180
+ ).call
181
+ end
182
+
183
+ def partner_results(page: 1, include: [])
184
+ Teamtailor::Request.new(
185
+ base_url: base_url,
186
+ api_token: api_token,
187
+ api_version: api_version,
188
+ path: '/v1/partner-results',
189
+ params: {
190
+ 'page[number]' => page,
191
+ 'page[size]' => 30,
192
+ 'include' => include.join(',')
193
+ }
194
+ ).call
195
+ end
196
+
197
+ def requisitions(page: 1, include: [])
198
+ Teamtailor::Request.new(
199
+ base_url: base_url,
200
+ api_token: api_token,
201
+ api_version: api_version,
202
+ path: '/v1/requisitions',
203
+ params: {
204
+ 'page[number]' => page,
205
+ 'page[size]' => 30,
206
+ 'include' => include.join(',')
207
+ }
208
+ ).call
209
+ end
210
+
137
211
  private
138
212
 
139
213
  attr_reader :base_url, :api_token, :api_version
@@ -9,6 +9,12 @@ require 'teamtailor/parser/stage'
9
9
  require 'teamtailor/parser/reject_reason'
10
10
  require 'teamtailor/parser/department'
11
11
  require 'teamtailor/parser/location'
12
+ require 'teamtailor/parser/custom_field'
13
+ require 'teamtailor/parser/custom_field_value'
14
+ require 'teamtailor/parser/referral'
15
+ require 'teamtailor/parser/partner_result'
16
+ require 'teamtailor/parser/requisition'
17
+ require 'teamtailor/parser/requisition_step_verdict'
12
18
 
13
19
  module Teamtailor
14
20
  class Parser
@@ -28,6 +34,13 @@ module Teamtailor
28
34
  when 'reject-reasons' then Teamtailor::RejectReason.new(record, included)
29
35
  when 'departments' then Teamtailor::Department.new(record, included)
30
36
  when 'locations' then Teamtailor::Location.new(record, included)
37
+ when 'custom-fields' then Teamtailor::CustomField.new(record, included)
38
+ when 'custom-field-selects' then Teamtailor::CustomField.new(record, included)
39
+ when 'custom-field-values' then Teamtailor::CustomFieldValue.new(record, included)
40
+ when 'referrals' then Teamtailor::Referral.new(record, included)
41
+ when 'partner-results' then Teamtailor::PartnerResult.new(record, included)
42
+ when 'requisitions' then Teamtailor::Requisition.new(record, included)
43
+ when 'requisition-step-verdicts' then Teamtailor::RequisitionStepVerdict.new(record, included)
31
44
 
32
45
  else
33
46
  raise Teamtailor::UnknownResponseTypeError, record&.dig('type')
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'teamtailor/record'
4
+
5
+ module Teamtailor
6
+ class CustomField < Record
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'teamtailor/record'
4
+
5
+ module Teamtailor
6
+ class CustomFieldValue < Record
7
+ end
8
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'teamtailor/record'
4
+
5
+ module Teamtailor
6
+ class PartnerResult < Record
7
+ def id
8
+ data.dig('id')
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'teamtailor/record'
4
+
5
+ module Teamtailor
6
+ class Referral < Record
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'teamtailor/record'
4
+
5
+ module Teamtailor
6
+ class Requisition < Record
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'teamtailor/record'
4
+
5
+ module Teamtailor
6
+ class RequisitionStepVerdict < Record
7
+ end
8
+ end
@@ -9,27 +9,29 @@ module Teamtailor
9
9
  end
10
10
 
11
11
  def loaded?
12
- !record_id.nil?
12
+ !record_ids.empty?
13
13
  end
14
14
 
15
- def record
15
+ def records
16
16
  raise Teamtailor::UnloadedRelationError unless loaded?
17
17
 
18
- record_json = included.find do |k|
19
- k['id'] == record_id && k['type'] == record_type
18
+ record_json = included.select do |k|
19
+ record_ids.include?(k['id']) && k['type'] == record_type
20
20
  end
21
21
 
22
- Teamtailor::Parser.parse({ 'data' => record_json }).first
22
+ Teamtailor::Parser.parse({ 'data' => record_json, 'included' => included })
23
23
  end
24
24
 
25
25
  private
26
26
 
27
- def record_id
28
- relationships&.dig(relation_name, 'data', 'id')
27
+ def record_ids
28
+ data = [relationships&.dig(relation_name, 'data')].flatten.compact
29
+ data.map { |row| row['id'] }
29
30
  end
30
31
 
31
32
  def record_type
32
- relationships&.dig(relation_name, 'data', 'type')
33
+ data = [relationships&.dig(relation_name, 'data')].flatten
34
+ data.map { |row| row['type'] }.first
33
35
  end
34
36
 
35
37
  attr_reader :relation_name, :relationships, :included
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Teamtailor
4
- VERSION = '0.2.4'
4
+ VERSION = '0.3.2'
5
5
  end
data/teamtailor.gemspec CHANGED
@@ -9,13 +9,15 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ['hi@andreligne.se']
10
10
 
11
11
  spec.summary = 'Library for interacting with the Teamtailor API'
12
- spec.homepage = 'https://github.com/bzf/teamtailor-gem'
12
+ spec.homepage = 'https://github.com/teamtailor/teamtailor-gem'
13
13
  spec.license = 'MIT'
14
14
  spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
15
15
 
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = 'https://github.com/bzf/teamtailor-rb'
18
- spec.metadata['changelog_uri'] = 'https://github.com/bzf/teamtailor-rb/master/CHANGELOG.md'
18
+ spec.metadata['changelog_uri'] = 'https://github.com/bzf/teamtailor-rb/main/CHANGELOG.md'
19
+
20
+ spec.extra_rdoc_files = ['README.md']
19
21
 
20
22
  spec.add_development_dependency 'rspec', '~> 3.2'
21
23
  spec.add_dependency 'typhoeus', '~> 1.3.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teamtailor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Ligné
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-07 00:00:00.000000000 Z
11
+ date: 2021-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -38,13 +38,15 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.3.1
41
- description:
41
+ description:
42
42
  email:
43
43
  - hi@andreligne.se
44
44
  executables: []
45
45
  extensions: []
46
- extra_rdoc_files: []
46
+ extra_rdoc_files:
47
+ - README.md
47
48
  files:
49
+ - ".github/workflows/ruby.yml"
48
50
  - ".gitignore"
49
51
  - ".rspec"
50
52
  - ".travis.yml"
@@ -63,11 +65,17 @@ files:
63
65
  - lib/teamtailor/parser.rb
64
66
  - lib/teamtailor/parser/candidate.rb
65
67
  - lib/teamtailor/parser/company.rb
68
+ - lib/teamtailor/parser/custom_field.rb
69
+ - lib/teamtailor/parser/custom_field_value.rb
66
70
  - lib/teamtailor/parser/department.rb
67
71
  - lib/teamtailor/parser/job.rb
68
72
  - lib/teamtailor/parser/job_application.rb
69
73
  - lib/teamtailor/parser/location.rb
74
+ - lib/teamtailor/parser/partner_result.rb
75
+ - lib/teamtailor/parser/referral.rb
70
76
  - lib/teamtailor/parser/reject_reason.rb
77
+ - lib/teamtailor/parser/requisition.rb
78
+ - lib/teamtailor/parser/requisition_step_verdict.rb
71
79
  - lib/teamtailor/parser/stage.rb
72
80
  - lib/teamtailor/parser/user.rb
73
81
  - lib/teamtailor/record.rb
@@ -75,14 +83,14 @@ files:
75
83
  - lib/teamtailor/request.rb
76
84
  - lib/teamtailor/version.rb
77
85
  - teamtailor.gemspec
78
- homepage: https://github.com/bzf/teamtailor-gem
86
+ homepage: https://github.com/teamtailor/teamtailor-gem
79
87
  licenses:
80
88
  - MIT
81
89
  metadata:
82
- homepage_uri: https://github.com/bzf/teamtailor-gem
90
+ homepage_uri: https://github.com/teamtailor/teamtailor-gem
83
91
  source_code_uri: https://github.com/bzf/teamtailor-rb
84
- changelog_uri: https://github.com/bzf/teamtailor-rb/master/CHANGELOG.md
85
- post_install_message:
92
+ changelog_uri: https://github.com/bzf/teamtailor-rb/main/CHANGELOG.md
93
+ post_install_message:
86
94
  rdoc_options: []
87
95
  require_paths:
88
96
  - lib
@@ -97,8 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
105
  - !ruby/object:Gem::Version
98
106
  version: '0'
99
107
  requirements: []
100
- rubygems_version: 3.1.2
101
- signing_key:
108
+ rubygems_version: 3.1.4
109
+ signing_key:
102
110
  specification_version: 4
103
111
  summary: Library for interacting with the Teamtailor API
104
112
  test_files: []