workable 2.0.0 → 2.1.0

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
  SHA1:
3
- metadata.gz: 1918a3c5a23e3c42973eed949f0b0cc3ba83c613
4
- data.tar.gz: 307220a59d69533df3446a11c216f72a8748be8a
3
+ metadata.gz: f79182d801ebc90eb4f72ff018f5963b67d6e619
4
+ data.tar.gz: 84d6252a9b5f2cbe24254b0bea3997908c77188e
5
5
  SHA512:
6
- metadata.gz: 2fd937d0071f53b9c2df9735cd376d774abe397d2565ee0a12e13cb89c2b0fbeb77e7d2f802e83be0aa69d25bcc775ca964df002982f697b2e538ed99f8288f6
7
- data.tar.gz: 80671b951b7f0a01bb0c00fd5bff54fa2e209358c4dbeb2b6ea06ea0946829ba63cdebc3319d56a1bf2daa2016133befdfc53b1d58d6caaae936e5dd0dad12e7
6
+ metadata.gz: bc72c0fbb34291527fd66ebdce1e02c53edd6af4f040989d9f0207e8b0a09b7582c728e8d4f5f904956930b50d279ade62cc97da3419b5219ccee3ace483cdb9
7
+ data.tar.gz: 599d72ac71fa533f05f4ad8d4ad041a50c5c413c923f84267a49d219e9c4e2364b4fe3a5ab94b872a7c74a8a8f983d32d13366031b85a9e790a6e2c7d7b444a8
data/.travis.yml CHANGED
@@ -3,15 +3,17 @@ sudo: false
3
3
  cache: bundler
4
4
 
5
5
  rvm:
6
- - 2.1
7
- - 2.2
6
+ - 2.1.10
7
+ - 2.2.7
8
+ - 2.3.4
9
+ - 2.4.1
8
10
  - jruby-head
9
- - rbx-2
10
11
  - ruby-head
11
12
 
13
+ # https://github.com/travis-ci/travis-ci/issues/5861
14
+ before_install:
15
+ - gem install bundler
16
+ - gem update bundler
17
+
12
18
  notifications:
13
19
  email: false
14
-
15
- matrix:
16
- allow_failures:
17
- - rvm: rbx-2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 2.1.0
2
+
3
+ Date: 2017-06-19
4
+
5
+ - `application_form` endpoint handler [#11](https://github.com/emq/workable/pull/11) (@klaszcze)
6
+
1
7
  ## 2.0.0
2
8
 
3
9
  Date: 2015-11-14
data/README.md CHANGED
@@ -40,6 +40,16 @@ client = Workable::Client.new(api_key: 'api_key', subdomain: 'your_subdomain')
40
40
  # takes optional phase argument (string): 'published' (default), 'draft', 'closed' or 'archived'
41
41
  client.jobs # => Workable::Collection
42
42
 
43
+ # Workable::Collection example
44
+ jobs = client.jobs
45
+ loop do
46
+ jobs.each do |job|
47
+ # Do something with the job
48
+ end
49
+ break unless jobs.next_page?
50
+ jobs = jobs.fetch_next_page
51
+ end
52
+
43
53
  shortcode = client.jobs.first["shortcode"]
44
54
 
45
55
  # API queries are not cached (at all) - it's up to you to cache results one way or another
@@ -48,6 +58,7 @@ client.stages # => Array of hashes
48
58
  client.recruiters # => Array of hashes
49
59
  client.job_details(shortcode) # => Hash
50
60
  client.job_questions(shortcode) # => Array of hashes
61
+ client.job_application_form(shortcode) # => Hash
51
62
  client.job_candidates(shortcode, :stage => stage_slug, :limit => 100) # => Array of hashes:
52
63
  # if given stage limits to given stage
53
64
  # if given limit lists the last `limit` added candidates
@@ -60,7 +71,7 @@ client.create_job_candidate(candidate, shortcode, stage_slug) # => Hash (stage_s
60
71
  # Possible errors (each one inherits from Workable::Errors::WorkableError)
61
72
  Workable::Errors::InvalidConfiguration # missing api_key / subdomain
62
73
  Workable::Errors::NotAuthorized # wrong api key
63
- Workable::Errors::InvalidResponse # something when wrong during the request?
74
+ Workable::Errors::InvalidResponse # something went wrong during the request?
64
75
  Workable::Errors::NotFound # 404 from workable
65
76
  Workable::Errors::RequestToLong # When the requested result takes to long to calculate, try limiting your query
66
77
  ```
@@ -78,6 +78,12 @@ module Workable
78
78
  @transform_to.apply(:question, get_request("jobs/#{shortcode}/questions")['questions'])
79
79
  end
80
80
 
81
+ # application form questions for job
82
+ # @param shortcode [String] job short code
83
+ def job_application_form(shortcode)
84
+ @transform_to.apply(:question, get_request("jobs/#{shortcode}/application_form"))
85
+ end
86
+
81
87
  # return a collection of job's members
82
88
  # @param shortcode [String] job short code
83
89
  def job_members(shortcode)
@@ -1,3 +1,3 @@
1
1
  module Workable
2
- VERSION = '2.0.0'
2
+ VERSION = '2.1.0'
3
3
  end
data/spec/fixtures.rb CHANGED
@@ -29,6 +29,10 @@ def job_questions_json_fixture
29
29
  read_fixture 'job_questions.json'
30
30
  end
31
31
 
32
+ def job_application_form_fixture
33
+ read_fixture 'job_application_form.json'
34
+ end
35
+
32
36
  def recruiters_json_fixture
33
37
  read_fixture 'recruiters.json'
34
38
  end
@@ -0,0 +1,98 @@
1
+ {
2
+ "form_fields": [
3
+ {
4
+ "key": "phone",
5
+ "label": "Phone",
6
+ "type": "string",
7
+ "required": true
8
+ },
9
+ {
10
+ "key": "experience",
11
+ "label": "Experience",
12
+ "type": "complex",
13
+ "multiple": true,
14
+ "required": false,
15
+ "fields": [
16
+ {
17
+ "key": "title",
18
+ "label": "Title",
19
+ "type": "string",
20
+ "required": true
21
+ },
22
+ {
23
+ "key": "company",
24
+ "label": "Company",
25
+ "type": "string",
26
+ "required": false
27
+ },
28
+ {
29
+ "key": "summary",
30
+ "label": "Summary",
31
+ "type": "free_text",
32
+ "required": false
33
+ },
34
+ {
35
+ "key": "current",
36
+ "label": "I currently work here",
37
+ "type": "boolean",
38
+ "required": true
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "key": "summary",
44
+ "label": "Summary",
45
+ "type": "free_text",
46
+ "required": false
47
+ },
48
+ {
49
+ "key": "resume",
50
+ "label": "Resume",
51
+ "type": "file",
52
+ "supported_file_types": [
53
+ "pdf",
54
+ "doc",
55
+ "docx",
56
+ "odt",
57
+ "rtf",
58
+ "html",
59
+ "htm",
60
+ "txt"
61
+ ],
62
+ "max_file_size": 5242880,
63
+ "required": false
64
+ }
65
+ ],
66
+ "questions": [
67
+ {
68
+ "id": "2128d717",
69
+ "body": "Explain one aspect of this role you believe you will excel at.",
70
+ "type": "free_text"
71
+ },
72
+ {
73
+ "id": "3399e6cd",
74
+ "body": "How many years administrative experience do you have?",
75
+ "type": "multiple_choice",
76
+ "single_answer": true,
77
+ "choices": [
78
+ {
79
+ "id": "3049114a",
80
+ "body": "0-3 years"
81
+ },
82
+ {
83
+ "id": "29406296",
84
+ "body": "3-5 years"
85
+ },
86
+ {
87
+ "id": "1e477229",
88
+ "body": "Over 5 years"
89
+ }
90
+ ]
91
+ },
92
+ {
93
+ "id": "1d3f348f",
94
+ "body": "Intermediate or above proficiency with MS Office?",
95
+ "type": "boolean"
96
+ }
97
+ ]
98
+ }
@@ -139,6 +139,24 @@ describe Workable::Client do
139
139
  end
140
140
  end
141
141
 
142
+ describe '#job_application_form' do
143
+ it 'returns application form for given job' do
144
+ stub_request(:get, 'https://www.workable.com/spi/v3/accounts/subdomain/jobs/03FF356C8B/application_form')
145
+ .to_return(status: 200, body: job_application_form_fixture)
146
+
147
+ form = client.job_application_form('03FF356C8B')
148
+ expect(form).to be_kind_of(Hash)
149
+ expect(form.has_key?('questions')).to eq true
150
+ expect(form['form_fields'][0]).to eq({
151
+ 'key' => 'phone',
152
+ 'label' => 'Phone',
153
+ 'type' => 'string',
154
+ 'required' => true
155
+ })
156
+
157
+ end
158
+ end
159
+
142
160
  describe '#job_members' do
143
161
  it "returns array of job's members" do
144
162
  stub_request(:get, 'https://www.workable.com/spi/v3/accounts/subdomain/jobs/job_slug/members')
data/workable.gemspec CHANGED
@@ -22,7 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency 'rake', '~> 10.0'
23
23
  spec.add_development_dependency 'rspec', '~> 3.1.0'
24
24
  spec.add_development_dependency 'webmock', '~> 1.20.4'
25
- spec.add_development_dependency 'coveralls', '~> 0.8.9'
26
- spec.add_development_dependency 'guard', '~> 2.12'
27
- spec.add_development_dependency 'guard-rspec', '~> 4.5'
25
+ spec.add_development_dependency 'coveralls', '~> 0.8.21'
28
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafał Wojsznis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-14 00:00:00.000000000 Z
12
+ date: 2017-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -59,42 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 0.8.9
62
+ version: 0.8.21
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: 0.8.9
70
- - !ruby/object:Gem::Dependency
71
- name: guard
72
- requirement: !ruby/object:Gem::Requirement
73
- requirements:
74
- - - "~>"
75
- - !ruby/object:Gem::Version
76
- version: '2.12'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '2.12'
84
- - !ruby/object:Gem::Dependency
85
- name: guard-rspec
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '4.5'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '4.5'
69
+ version: 0.8.21
98
70
  description: Dead-simple Ruby API client for workable.com
99
71
  email:
100
72
  - rafal.wojsznis@gmail.com
@@ -121,6 +93,7 @@ files:
121
93
  - spec/fixtures.rb
122
94
  - spec/fixtures/about.json
123
95
  - spec/fixtures/job.json
96
+ - spec/fixtures/job_application_form.json
124
97
  - spec/fixtures/job_candidate.json
125
98
  - spec/fixtures/job_candidates.json
126
99
  - spec/fixtures/job_questions.json
@@ -155,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
128
  version: '0'
156
129
  requirements: []
157
130
  rubyforge_project:
158
- rubygems_version: 2.4.6
131
+ rubygems_version: 2.6.8
159
132
  signing_key:
160
133
  specification_version: 4
161
134
  summary: Dead-simple Ruby API client for workable.com
@@ -163,6 +136,7 @@ test_files:
163
136
  - spec/fixtures.rb
164
137
  - spec/fixtures/about.json
165
138
  - spec/fixtures/job.json
139
+ - spec/fixtures/job_application_form.json
166
140
  - spec/fixtures/job_candidate.json
167
141
  - spec/fixtures/job_candidates.json
168
142
  - spec/fixtures/job_questions.json