greenhouse_io 2.1.0 → 2.2.0

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
  SHA1:
3
- metadata.gz: 539f7c131f2d348b273be125f7b9b00df9cbeea2
4
- data.tar.gz: 3e8e48e4462b551661df6a4088bd3741ff70ee22
3
+ metadata.gz: 2c096b1bb7f6c152e7a1c189791cdb962bcf6188
4
+ data.tar.gz: 26723c9efc5e6f049ea28f992d6b447d51191d14
5
5
  SHA512:
6
- metadata.gz: 35ffdc2292f3496d102e43692ef3cd661506384fa8efb5bf6d77bd501faa62567a92dd9c34a3be3a905e7b768451dae3b1a0c81364c3482297130761567b3877
7
- data.tar.gz: f2cc9f9635742e1eb51fd000c3999d0cf8853da659c92193cfc5733421add667e1e7eacceb5719006f1c5cc5cd845fe18d28598995e46713179cd2a1d503160e
6
+ metadata.gz: 1ed79b98c1056815a11642df2a83da6e7c710a3135a9fd2c2f5421b70758a5caac53cf7f80951906bc59cdf7152a8daf147cd96e898dcbdba4852c775b2ef0d7
7
+ data.tar.gz: 66e6afa7ac721cfdf1426194f20d80c387ce570cb25d0d1fb1bb9040330746288e96ffa645448d53e93fbda9e4cc3345ca5e1ce6744435e79c35b2902e2d6e48
data/.travis.yml CHANGED
@@ -1,6 +1,11 @@
1
1
  language: ruby
2
+
2
3
  rvm:
3
- - 2.1.2
4
- - 2.1.0
5
- - 2.0.0
6
4
  - 1.9.3
5
+ - 2.0.0
6
+ - 2.2
7
+ - 2.1
8
+
9
+ script: rake spec
10
+
11
+ sudo: false
data/CHANGES.md ADDED
@@ -0,0 +1,14 @@
1
+ # greenhouse_io changelog
2
+
3
+ This project follows [semantic versioning](http://semver.org/). This changelog follows suggestions from [keepachangelog.com](http://keepachangelog.com/).
4
+
5
+ ## Version 2.1.0
6
+ Released 2016-02-03.
7
+
8
+ ##### Added
9
+ - Added support for listing Offers and retrieving them by ID
10
+ - Added support for filtering with `job_id` parameter
11
+
12
+ ##### Changed
13
+ - Upgraded dependencies: `multi_json` (now ~>1.11.2), and development gems
14
+ - Added version dependency for `httmultiparty`: ``'~> 0.3.16'``
data/Gemfile CHANGED
@@ -5,7 +5,7 @@ group :development do
5
5
  end
6
6
 
7
7
  group :test do
8
- gem 'coveralls', :require => false
8
+ gem "codeclimate-test-reporter", group: :test, require: nil
9
9
  end
10
10
 
11
11
  gemspec
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  [![Gem
4
4
  Version](https://badge.fury.io/rb/greenhouse_io.png)](http://badge.fury.io/rb/greenhouse_io)
5
- [![Build
6
- Status](https://travis-ci.org/adrianbautista/greenhouse_io.png)](https://travis-ci.org/adrianbautista/greenhouse_io)
7
- [![Coverage Status](https://coveralls.io/repos/adrianbautista/greenhouse_io/badge.png)](https://coveralls.io/r/adrianbautista/greenhouse_io)
5
+ [![Build Status](https://travis-ci.org/grnhse/greenhouse_io.svg?branch=master)](https://travis-ci.org/grnhse/greenhouse_io)
6
+ [![Test Coverage](https://codeclimate.com/github/grnhse/greenhouse_io/badges/coverage.svg)](https://codeclimate.com/github/grnhse/greenhouse_io/coverage)
7
+ [![Dependency Status](https://gemnasium.com/grnhse/greenhouse_io.svg)](https://gemnasium.com/grnhse/greenhouse_io)
8
8
 
9
9
  A Ruby interface to
10
10
  [Greenhouse.io's](https://app.greenhouse.io/jobboard/jsonp_instructions)
@@ -35,7 +35,7 @@ end
35
35
 
36
36
  ## Usage
37
37
 
38
- Greenhouse's two APIs, **[Harvest](https://app.greenhouse.io/configure/dev_center/harvest)** and **[JobBoard](https://app.greenhouse.io/configure/dev_center/api_documentation)**, can now be accessed through the gem. The [`GreenhouseIo::JobBoard`](#greenhouseiojobboard) is nearly identical to the old `GreenhouseIo::API` class. [`GreenhouseIo::Client`](#greenhouseioclient) connects to the new Harvest API.
38
+ Greenhouse's two APIs, **[Harvest](https://app.greenhouse.io/configure/dev_center/harvest)** and **[Job Board](https://app.greenhouse.io/configure/dev_center/api_documentation)**, can now be accessed through the gem. The [`GreenhouseIo::JobBoard`](#greenhouseiojobboard) is nearly identical to the old `GreenhouseIo::API` class. [`GreenhouseIo::Client`](#greenhouseioclient) connects to the new Harvest API.
39
39
 
40
40
  ### GreenhouseIo::JobBoard
41
41
 
@@ -140,6 +140,7 @@ Methods in which an `id` is optional:
140
140
  * `jobs`
141
141
  * `users`
142
142
  * `sources`
143
+ * `offers`
143
144
 
144
145
  Methods in which an `id` is **required**:
145
146
 
@@ -6,10 +6,10 @@ require 'greenhouse_io/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "greenhouse_io"
8
8
  spec.version = GreenhouseIo::VERSION
9
- spec.authors = ["Adrian Bautista"]
10
- spec.email = ["adrianbautista8@gmail.com"]
11
- spec.description = %q{A Ruby based wrapper for Greenhouse.io API}
12
- spec.summary = %q{A Ruby based wrapper for Greenhouse.io API}
9
+ spec.authors = ["Greenhouse Software", "Adrian Bautista"]
10
+ spec.email = ["support@greenhouse.io", "adrianbautista8@gmail.com"]
11
+ spec.description = %q{Ruby bindings for the greenhouse.io Harvest API and Job Board API}
12
+ spec.summary = %q{Ruby bindings for the greenhouse.io Harvest API and Job Board API}
13
13
  spec.license = "MIT"
14
14
 
15
15
  spec.files = `git ls-files`.split($/)
@@ -17,13 +17,13 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency('httmultiparty')
21
- spec.add_dependency('multi_json', '>= 1.9.2', '<= 1.10.1')
20
+ spec.add_dependency('httmultiparty', '~> 0.3.16')
21
+ spec.add_dependency('multi_json', '~>1.11.2')
22
22
  spec.required_ruby_version = '>= 1.9.3'
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
25
25
  spec.add_development_dependency "rake"
26
- spec.add_development_dependency "rspec", "~> 2.14.1"
27
- spec.add_development_dependency "webmock", "~> 1.8.0"
28
- spec.add_development_dependency "vcr", "~> 2.5.0"
26
+ spec.add_development_dependency "rspec", "~> 3.4.0"
27
+ spec.add_development_dependency "webmock", "~> 1.22.6"
28
+ spec.add_development_dependency "vcr", "~> 3.0.1"
29
29
  end
@@ -3,7 +3,7 @@ module GreenhouseIo
3
3
  include HTTMultiParty
4
4
  include GreenhouseIo::API
5
5
 
6
- PERMITTED_OPTIONS = [:page, :per_page]
6
+ PERMITTED_OPTIONS = [:page, :per_page, :job_id]
7
7
 
8
8
  attr_accessor :api_token, :rate_limit, :rate_limit_remaining
9
9
  base_uri 'https://harvest.greenhouse.io/v1'
@@ -16,6 +16,10 @@ module GreenhouseIo
16
16
  get_from_harvest_api "/offices#{path_id(id)}", options
17
17
  end
18
18
 
19
+ def offers(id = nil, options = {})
20
+ get_from_harvest_api "/offers#{path_id(id)}", options
21
+ end
22
+
19
23
  def departments(id = nil, options = {})
20
24
  get_from_harvest_api "/departments#{path_id(id)}", options
21
25
  end
@@ -1,3 +1,3 @@
1
1
  module GreenhouseIo
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
@@ -0,0 +1,139 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/applications?job_id=144371
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Cowboy
23
+ Connection:
24
+ - keep-alive
25
+ Date:
26
+ - Wed, 27 Jan 2016 18:09:18 GMT
27
+ Status:
28
+ - 200 OK
29
+ Content-Type:
30
+ - application/json;charset=utf-8
31
+ Link:
32
+ - <https://harvest.greenhouse.io/v1/applications?job_id=144371&page=1&per_page=100>;
33
+ rel="last"
34
+ Content-Length:
35
+ - '11280'
36
+ X-Ratelimit-Limit:
37
+ - '50'
38
+ X-Ratelimit-Remaining:
39
+ - '49'
40
+ X-Content-Type-Options:
41
+ - nosniff
42
+ Via:
43
+ - 1.1 vegur
44
+ body:
45
+ encoding: UTF-8
46
+ string: '[{"id":21708448,"candidate_id":13381395,"prospect":false,"applied_at":"2015-11-19T20:22:30Z","rejected_at":null,"last_activity_at":"2015-11-19T20:22:30Z","source":{"id":2,"public_name":"Jobs
47
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
48
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
49
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
50
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
51
+ Profile","answer":null}]},{"id":21708450,"candidate_id":13381397,"prospect":false,"applied_at":"2015-11-19T20:22:30Z","rejected_at":null,"last_activity_at":"2015-11-19T20:22:30Z","source":{"id":2,"public_name":"Jobs
52
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
53
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
54
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
55
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
56
+ Profile","answer":null}]},{"id":21708449,"candidate_id":13381396,"prospect":false,"applied_at":"2015-11-19T20:22:30Z","rejected_at":null,"last_activity_at":"2015-11-19T20:22:30Z","source":{"id":2,"public_name":"Jobs
57
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
58
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
59
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
60
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
61
+ Profile","answer":null}]},{"id":21708451,"candidate_id":13381398,"prospect":false,"applied_at":"2015-11-19T20:22:30Z","rejected_at":null,"last_activity_at":"2015-11-19T20:22:30Z","source":{"id":2,"public_name":"Jobs
62
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
63
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
64
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
65
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
66
+ Profile","answer":null}]},{"id":21708452,"candidate_id":13381399,"prospect":false,"applied_at":"2015-11-19T20:22:31Z","rejected_at":null,"last_activity_at":"2015-11-19T20:22:31Z","source":{"id":2,"public_name":"Jobs
67
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
68
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
69
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
70
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
71
+ Profile","answer":null}]},{"id":21708453,"candidate_id":13381400,"prospect":false,"applied_at":"2015-11-19T20:22:31Z","rejected_at":null,"last_activity_at":"2015-11-19T20:22:31Z","source":{"id":2,"public_name":"Jobs
72
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
73
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
74
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
75
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
76
+ Profile","answer":null}]},{"id":21708454,"candidate_id":13381401,"prospect":false,"applied_at":"2015-11-19T20:22:31Z","rejected_at":null,"last_activity_at":"2015-11-19T20:22:31Z","source":{"id":2,"public_name":"Jobs
77
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
78
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
79
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
80
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
81
+ Profile","answer":null}]},{"id":21708456,"candidate_id":13381403,"prospect":false,"applied_at":"2015-11-19T20:22:32Z","rejected_at":null,"last_activity_at":"2015-11-19T20:22:32Z","source":{"id":2,"public_name":"Jobs
82
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
83
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
84
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
85
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
86
+ Profile","answer":null}]},{"id":21708460,"candidate_id":13381407,"prospect":false,"applied_at":"2015-11-19T20:22:35Z","rejected_at":null,"last_activity_at":"2015-11-19T20:22:35Z","source":{"id":2,"public_name":"Jobs
87
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
88
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
89
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
90
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
91
+ Profile","answer":null}]},{"id":21708585,"candidate_id":13381528,"prospect":false,"applied_at":"2015-11-19T20:26:25Z","rejected_at":null,"last_activity_at":"2015-11-19T20:26:25Z","source":{"id":2,"public_name":"Jobs
92
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
93
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
94
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
95
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
96
+ Profile","answer":null}]},{"id":21708586,"candidate_id":13381530,"prospect":false,"applied_at":"2015-11-19T20:26:25Z","rejected_at":"2016-01-26T23:57:35Z","last_activity_at":"2016-01-26T23:57:35Z","source":{"id":2,"public_name":"Jobs
97
+ page on your website"},"credited_to":null,"rejection_reason":{"id":14,"name":"None
98
+ specified","type":{"id":3,"name":"None specified"}},"jobs":[{"id":144371,"name":"Good
99
+ Cop"}],"status":"rejected","current_stage":{"id":1031644,"name":"Offer"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
100
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
101
+ Profile","answer":null}]},{"id":21708588,"candidate_id":13381531,"prospect":false,"applied_at":"2015-11-19T20:26:26Z","rejected_at":null,"last_activity_at":"2015-11-19T20:26:26Z","source":{"id":2,"public_name":"Jobs
102
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
103
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
104
+ Review"},"answers":[{"question":"Foobar?","answer":null},{"question":"How
105
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
106
+ Profile","answer":null}]},{"id":21769983,"candidate_id":13440415,"prospect":false,"applied_at":"2015-11-20T22:25:49Z","rejected_at":null,"last_activity_at":"2015-11-20T22:25:49Z","source":{"id":2,"public_name":"Jobs
107
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
108
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
109
+ Review"},"answers":[{"question":"Yeah?","answer":"Five"},{"question":"Huh?","answer":"Yes"},{"question":"What?","answer":"wfawfe"},{"question":"Foobar?","answer":"sgerag"},{"question":"How
110
+ did you hear about this job?","answer":"fawefaewttag"},{"question":"Website","answer":"afwaefw"},{"question":"LinkedIn
111
+ Profile","answer":"wafawefaw"}]},{"id":21772362,"candidate_id":13442759,"prospect":false,"applied_at":"2015-11-20T22:33:14Z","rejected_at":null,"last_activity_at":"2015-11-20T22:33:14Z","source":{"id":2,"public_name":"Jobs
112
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
113
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
114
+ Review"},"answers":[{"question":"Yeah?","answer":"Five"},{"question":"Huh?","answer":"Yes"},{"question":"What?","answer":"wfawfe"},{"question":"Foobar?","answer":"sgerag"},{"question":"How
115
+ did you hear about this job?","answer":"fawefaewttag"},{"question":"Website","answer":"afwaefw"},{"question":"LinkedIn
116
+ Profile","answer":"wafawefaw"}]},{"id":21772559,"candidate_id":13442958,"prospect":false,"applied_at":"2015-11-20T22:33:45Z","rejected_at":null,"last_activity_at":"2015-11-20T22:33:45Z","source":{"id":2,"public_name":"Jobs
117
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
118
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
119
+ Review"},"answers":[{"question":"Yeah?","answer":"Five"},{"question":"Huh?","answer":"Yes"},{"question":"What?","answer":"wfawfe"},{"question":"Foobar?","answer":"sgerag"},{"question":"How
120
+ did you hear about this job?","answer":"fawefaewttag"},{"question":"Website","answer":"afwaefw"},{"question":"LinkedIn
121
+ Profile","answer":"wafawefaw"}]},{"id":21772681,"candidate_id":13443080,"prospect":false,"applied_at":"2015-11-20T22:34:04Z","rejected_at":null,"last_activity_at":"2015-11-20T22:34:03Z","source":{"id":2,"public_name":"Jobs
122
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
123
+ Cop"}],"status":"active","current_stage":{"id":1031639,"name":"Application
124
+ Review"},"answers":[{"question":"Yeah?","answer":"Five"},{"question":"Huh?","answer":"Yes"},{"question":"What?","answer":"wfawfe"},{"question":"Foobar?","answer":"sgerag"},{"question":"How
125
+ did you hear about this job?","answer":"fawefaewttag"},{"question":"Website","answer":"afwaefw"},{"question":"LinkedIn
126
+ Profile","answer":"wafawefaw"}]},{"id":21880506,"candidate_id":13549465,"prospect":false,"applied_at":"2015-11-23T19:58:34Z","rejected_at":null,"last_activity_at":"2016-01-26T23:59:27Z","source":{"id":2,"public_name":"Jobs
127
+ page on your website"},"credited_to":null,"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
128
+ Cop"}],"status":"active","current_stage":{"id":1031644,"name":"Offer"},"answers":[{"question":"Yeah?","answer":"Three"},{"question":"Huh?","answer":"No"},{"question":"What?","answer":null},{"question":"Foobar?","answer":null},{"question":"How
129
+ did you hear about this job?","answer":null},{"question":"Website","answer":null},{"question":"LinkedIn
130
+ Profile","answer":null}]},{"id":22109641,"candidate_id":13769762,"prospect":false,"applied_at":"2015-11-30T22:30:47Z","rejected_at":"2015-11-30T22:30:52Z","last_activity_at":"2015-11-30T22:30:53Z","source":{"id":2,"public_name":"Jobs
131
+ page on your website"},"credited_to":{"id":158108,"name":"Gordon Zheng"},"rejection_reason":{"id":14,"name":"None
132
+ specified","type":{"id":3,"name":"None specified"}},"jobs":[{"id":144371,"name":"Good
133
+ Cop"}],"status":"rejected","current_stage":{"id":1031639,"name":"Application
134
+ Review"},"answers":[]},{"id":24709881,"candidate_id":13769693,"prospect":false,"applied_at":"2016-01-26T23:58:09Z","rejected_at":null,"last_activity_at":"2016-01-26T23:59:07Z","source":{"id":2,"public_name":"Jobs
135
+ page on your website"},"credited_to":{"id":158108,"name":"Gordon Zheng"},"rejection_reason":null,"jobs":[{"id":144371,"name":"Good
136
+ Cop"}],"status":"hired","current_stage":null,"answers":[]}]'
137
+ http_version:
138
+ recorded_at: Wed, 27 Jan 2016 18:09:18 GMT
139
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/offers/221598
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Cowboy
23
+ Connection:
24
+ - keep-alive
25
+ Date:
26
+ - Wed, 27 Jan 2016 00:27:44 GMT
27
+ Status:
28
+ - 200 OK
29
+ Content-Type:
30
+ - application/json;charset=utf-8
31
+ Content-Length:
32
+ - '400'
33
+ X-Ratelimit-Limit:
34
+ - '50'
35
+ X-Ratelimit-Remaining:
36
+ - '49'
37
+ X-Content-Type-Options:
38
+ - nosniff
39
+ Via:
40
+ - 1.1 vegur
41
+ body:
42
+ encoding: UTF-8
43
+ string: '{"id":221598,"version":1,"application_id":21708586,"created_at":"2016-01-26T23:57:28Z","sent_at":null,"resolved_at":"2016-01-26T23:57:35Z","starts_at":"2016-01-26","status":"rejected","custom_fields":{"benefits":"Full
44
+ Medical","bonus":"1000","current_salary":"25000","employment_type":"Full-time","notes":"He
45
+ was very excited.","options":"2000","salary":"31000","source_cost":null,"visa_cost":"200"}}'
46
+ http_version:
47
+ recorded_at: Wed, 27 Jan 2016 00:27:44 GMT
48
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://123FakeToken:@harvest.greenhouse.io/v1/offers
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Cowboy
23
+ Connection:
24
+ - keep-alive
25
+ Date:
26
+ - Tue, 26 Jan 2016 23:59:58 GMT
27
+ Status:
28
+ - 200 OK
29
+ Content-Type:
30
+ - application/json;charset=utf-8
31
+ Link:
32
+ - <https://harvest.greenhouse.io/v1/offers?page=1&per_page=100>; rel="last"
33
+ Content-Length:
34
+ - '1517'
35
+ X-Ratelimit-Limit:
36
+ - '50'
37
+ X-Ratelimit-Remaining:
38
+ - '49'
39
+ X-Content-Type-Options:
40
+ - nosniff
41
+ Via:
42
+ - 1.1 vegur
43
+ body:
44
+ encoding: UTF-8
45
+ string: '[{"id":221598,"version":1,"application_id":21708586,"created_at":"2016-01-26T23:57:28Z","sent_at":null,"resolved_at":"2016-01-26T23:57:35Z","starts_at":"2016-01-26","status":"rejected","custom_fields":{"benefits":"Full
46
+ Medical","bonus":"1000","current_salary":"25000","employment_type":"Full-time","notes":"He
47
+ was very excited.","options":"2000","salary":"31000","source_cost":null,"visa_cost":"200"}},{"id":221603,"version":1,"application_id":21880506,"created_at":"2016-01-26T23:59:27Z","sent_at":null,"resolved_at":null,"starts_at":"2016-01-30","status":"unresolved","custom_fields":{"benefits":null,"bonus":"1000","current_salary":null,"employment_type":"Full-time","notes":null,"options":"2000","salary":"60000","source_cost":null,"visa_cost":null}},{"id":163831,"version":1,"application_id":22109366,"created_at":"2015-11-30T22:29:19Z","sent_at":null,"resolved_at":"2015-11-30T22:29:52Z","starts_at":"2015-12-01","status":"accepted","custom_fields":{"benefits":null,"bonus":null,"current_salary":null,"employment_type":"Full-time","notes":null,"options":null,"salary":"20000","source_cost":null,"visa_cost":null}},{"id":221601,"version":1,"application_id":24709881,"created_at":"2016-01-26T23:58:48Z","sent_at":null,"resolved_at":"2016-01-26T23:59:07Z","starts_at":"2016-01-19","status":"accepted","custom_fields":{"benefits":null,"bonus":"1000","current_salary":"500","employment_type":"Full-time","notes":"He
48
+ didn''t seem too impressed.","options":"100","salary":"74111","source_cost":"200","visa_cost":null}}]'
49
+ http_version:
50
+ recorded_at: Tue, 26 Jan 2016 23:59:58 GMT
51
+ recorded_with: VCR 3.0.1
@@ -2,6 +2,8 @@ require 'spec_helper'
2
2
 
3
3
  describe GreenhouseIo::Client do
4
4
 
5
+ FAKE_API_TOKEN = '123FakeToken'
6
+
5
7
  it "should have a base url for an API endpoint" do
6
8
  expect(GreenhouseIo::Client.base_uri).to eq("https://harvest.greenhouse.io/v1")
7
9
  end
@@ -10,12 +12,12 @@ describe GreenhouseIo::Client do
10
12
 
11
13
  before do
12
14
  GreenhouseIo.configuration.symbolize_keys = true
13
- @client = GreenhouseIo::Client.new('123FakeToken')
15
+ @client = GreenhouseIo::Client.new(FAKE_API_TOKEN)
14
16
  end
15
17
 
16
18
  describe "#initialize" do
17
19
  it "has an api_token" do
18
- expect(@client.api_token).to eq('123FakeToken')
20
+ expect(@client.api_token).to eq(FAKE_API_TOKEN)
19
21
  end
20
22
 
21
23
  it "uses the configuration value when token is not specified" do
@@ -263,6 +265,24 @@ describe GreenhouseIo::Client do
263
265
  expect(@application).to have_key(:person_id)
264
266
  end
265
267
  end
268
+
269
+ context "given a job_id" do
270
+ before do
271
+ VCR.use_cassette('client/application_by_job_id') do
272
+ @applications = @client.applications(nil, :job_id => 144371)
273
+ end
274
+ end
275
+
276
+ it "returns a response" do
277
+ expect(@applications).to_not be_nil
278
+ end
279
+
280
+ it "returns an array of applications" do
281
+ expect(@applications).to be_an_instance_of(Array)
282
+ expect(@applications.first).to be_an_instance_of(Hash)
283
+ expect(@applications.first).to have_key(:prospect)
284
+ end
285
+ end
266
286
  end
267
287
 
268
288
  describe "#scorecards" do
@@ -470,5 +490,47 @@ describe GreenhouseIo::Client do
470
490
  end
471
491
  end
472
492
  end
493
+
494
+ describe "#offers" do
495
+ context "given no id" do
496
+ before do
497
+ VCR.use_cassette('client/offers') do
498
+ @offers = @client.offers
499
+ end
500
+ end
501
+
502
+ it "returns a response" do
503
+ expect(@offers).to_not be nil
504
+ end
505
+
506
+ it "returns an array of offers" do
507
+ expect(@offers).to be_an_instance_of(Array)
508
+ expect(@offers.first[:id]).to be_a(Integer).and be > 0
509
+ expect(@offers.first[:created_at]).to be_a(String)
510
+ expect(@offers.first[:version]).to be_a(Integer).and be > 0
511
+ expect(@offers.first[:status]).to be_a(String)
512
+ end
513
+ end
514
+
515
+ context "given an id" do
516
+ before do
517
+ VCR.use_cassette('client/offer') do
518
+ @offer = @client.offers(221598)
519
+ end
520
+ end
521
+
522
+ it "returns a response" do
523
+ expect(@offer).to_not be nil
524
+ end
525
+
526
+ it "returns an offer object" do
527
+ expect(@offer).to be_an_instance_of(Hash)
528
+ expect(@offer[:id]).to be_a(Integer).and be > 0
529
+ expect(@offer[:created_at]).to be_a(String)
530
+ expect(@offer[:version]).to be_a(Integer).and be > 0
531
+ expect(@offer[:status]).to be_a(String)
532
+ end
533
+ end
534
+ end
473
535
  end
474
536
  end
@@ -9,7 +9,7 @@ describe GreenhouseIo::Configuration do
9
9
  end
10
10
 
11
11
  it "returns the default value" do
12
- expect(GreenhouseIo.configuration.symbolize_keys).to be_false
12
+ expect(GreenhouseIo.configuration.symbolize_keys).to be false
13
13
  end
14
14
  end
15
15
 
@@ -21,7 +21,7 @@ describe GreenhouseIo::Configuration do
21
21
  end
22
22
 
23
23
  it "returns the specified value" do
24
- expect(GreenhouseIo.configuration.symbolize_keys).to be_true
24
+ expect(GreenhouseIo.configuration.symbolize_keys).to be true
25
25
  end
26
26
  end
27
27
 
data/spec/spec_helper.rb CHANGED
@@ -1,18 +1,19 @@
1
+ require "codeclimate-test-reporter"
2
+ CodeClimate::TestReporter.start
3
+
1
4
  require 'rubygems'
2
5
  require 'bundler'
3
6
  require 'webmock/rspec'
4
7
  require 'vcr'
5
8
  require 'greenhouse_io'
6
9
 
7
- require 'coveralls'
8
- Coveralls.wear!
9
-
10
10
  RSpec.configure do |config|
11
11
  end
12
12
 
13
13
  VCR.configure do |config|
14
14
  config.cassette_library_dir = 'spec/fixtures/cassettes'
15
15
  config.hook_into :webmock
16
+ config.ignore_hosts 'codeclimate.com'
16
17
  end
17
18
 
18
19
  def restore_default_config
metadata CHANGED
@@ -1,49 +1,44 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greenhouse_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
+ - Greenhouse Software
7
8
  - Adrian Bautista
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-01-28 00:00:00.000000000 Z
12
+ date: 2016-02-03 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: httmultiparty
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - ">="
18
+ - - "~>"
18
19
  - !ruby/object:Gem::Version
19
- version: '0'
20
+ version: 0.3.16
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - ">="
25
+ - - "~>"
25
26
  - !ruby/object:Gem::Version
26
- version: '0'
27
+ version: 0.3.16
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: multi_json
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.9.2
34
- - - "<="
32
+ - - "~>"
35
33
  - !ruby/object:Gem::Version
36
- version: 1.10.1
34
+ version: 1.11.2
37
35
  type: :runtime
38
36
  prerelease: false
39
37
  version_requirements: !ruby/object:Gem::Requirement
40
38
  requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 1.9.2
44
- - - "<="
39
+ - - "~>"
45
40
  - !ruby/object:Gem::Version
46
- version: 1.10.1
41
+ version: 1.11.2
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: bundler
49
44
  requirement: !ruby/object:Gem::Requirement
@@ -78,44 +73,45 @@ dependencies:
78
73
  requirements:
79
74
  - - "~>"
80
75
  - !ruby/object:Gem::Version
81
- version: 2.14.1
76
+ version: 3.4.0
82
77
  type: :development
83
78
  prerelease: false
84
79
  version_requirements: !ruby/object:Gem::Requirement
85
80
  requirements:
86
81
  - - "~>"
87
82
  - !ruby/object:Gem::Version
88
- version: 2.14.1
83
+ version: 3.4.0
89
84
  - !ruby/object:Gem::Dependency
90
85
  name: webmock
91
86
  requirement: !ruby/object:Gem::Requirement
92
87
  requirements:
93
88
  - - "~>"
94
89
  - !ruby/object:Gem::Version
95
- version: 1.8.0
90
+ version: 1.22.6
96
91
  type: :development
97
92
  prerelease: false
98
93
  version_requirements: !ruby/object:Gem::Requirement
99
94
  requirements:
100
95
  - - "~>"
101
96
  - !ruby/object:Gem::Version
102
- version: 1.8.0
97
+ version: 1.22.6
103
98
  - !ruby/object:Gem::Dependency
104
99
  name: vcr
105
100
  requirement: !ruby/object:Gem::Requirement
106
101
  requirements:
107
102
  - - "~>"
108
103
  - !ruby/object:Gem::Version
109
- version: 2.5.0
104
+ version: 3.0.1
110
105
  type: :development
111
106
  prerelease: false
112
107
  version_requirements: !ruby/object:Gem::Requirement
113
108
  requirements:
114
109
  - - "~>"
115
110
  - !ruby/object:Gem::Version
116
- version: 2.5.0
117
- description: A Ruby based wrapper for Greenhouse.io API
111
+ version: 3.0.1
112
+ description: Ruby bindings for the greenhouse.io Harvest API and Job Board API
118
113
  email:
114
+ - support@greenhouse.io
119
115
  - adrianbautista8@gmail.com
120
116
  executables: []
121
117
  extensions: []
@@ -123,6 +119,7 @@ extra_rdoc_files: []
123
119
  files:
124
120
  - ".gitignore"
125
121
  - ".travis.yml"
122
+ - CHANGES.md
126
123
  - Gemfile
127
124
  - LICENSE.txt
128
125
  - README.md
@@ -138,6 +135,7 @@ files:
138
135
  - spec/fixtures/cassettes/apply_to_job.yml
139
136
  - spec/fixtures/cassettes/client/activity_feed.yml
140
137
  - spec/fixtures/cassettes/client/application.yml
138
+ - spec/fixtures/cassettes/client/application_by_job_id.yml
141
139
  - spec/fixtures/cassettes/client/applications.yml
142
140
  - spec/fixtures/cassettes/client/candidate.yml
143
141
  - spec/fixtures/cassettes/client/candidates.yml
@@ -146,6 +144,8 @@ files:
146
144
  - spec/fixtures/cassettes/client/job.yml
147
145
  - spec/fixtures/cassettes/client/job_post.yml
148
146
  - spec/fixtures/cassettes/client/jobs.yml
147
+ - spec/fixtures/cassettes/client/offer.yml
148
+ - spec/fixtures/cassettes/client/offers.yml
149
149
  - spec/fixtures/cassettes/client/office.yml
150
150
  - spec/fixtures/cassettes/client/offices.yml
151
151
  - spec/fixtures/cassettes/client/scheduled_interviews.yml
@@ -192,14 +192,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  requirements: []
194
194
  rubyforge_project:
195
- rubygems_version: 2.2.1
195
+ rubygems_version: 2.4.8
196
196
  signing_key:
197
197
  specification_version: 4
198
- summary: A Ruby based wrapper for Greenhouse.io API
198
+ summary: Ruby bindings for the greenhouse.io Harvest API and Job Board API
199
199
  test_files:
200
200
  - spec/fixtures/cassettes/apply_to_job.yml
201
201
  - spec/fixtures/cassettes/client/activity_feed.yml
202
202
  - spec/fixtures/cassettes/client/application.yml
203
+ - spec/fixtures/cassettes/client/application_by_job_id.yml
203
204
  - spec/fixtures/cassettes/client/applications.yml
204
205
  - spec/fixtures/cassettes/client/candidate.yml
205
206
  - spec/fixtures/cassettes/client/candidates.yml
@@ -208,6 +209,8 @@ test_files:
208
209
  - spec/fixtures/cassettes/client/job.yml
209
210
  - spec/fixtures/cassettes/client/job_post.yml
210
211
  - spec/fixtures/cassettes/client/jobs.yml
212
+ - spec/fixtures/cassettes/client/offer.yml
213
+ - spec/fixtures/cassettes/client/offers.yml
211
214
  - spec/fixtures/cassettes/client/office.yml
212
215
  - spec/fixtures/cassettes/client/offices.yml
213
216
  - spec/fixtures/cassettes/client/scheduled_interviews.yml