workable 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +16 -0
- data/.rspec +2 -0
- data/.travis.yml +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +71 -0
- data/Rakefile +11 -0
- data/lib/workable.rb +14 -0
- data/lib/workable/client.rb +63 -0
- data/lib/workable/errors.rb +9 -0
- data/lib/workable/job.rb +26 -0
- data/lib/workable/version.rb +3 -0
- data/spec/fixtures.rb +117 -0
- data/spec/lib/workable/client_spec.rb +72 -0
- data/spec/lib/workable/job_spec.rb +10 -0
- data/spec/spec_helper.rb +66 -0
- data/workable.gemspec +27 -0
- metadata +135 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f5b055057eaa9673cc11ff001494e2de8f474202
|
4
|
+
data.tar.gz: debfe438f1b676c201e150a3df03f912e18ebb49
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dd0315dec1bd07662e96a22213263121e7306b481662326689e0bce5817999f08f74477e2877c781d043d920a8dbd2e251335374741b833ca53ec27c46b4e4d0
|
7
|
+
data.tar.gz: 7458b826e7359bd25ad50fabe5c88921c3e687523748664cfd982874f0b77b318de697621dbfdb7ddaccef75cb709ce08f50af8ec7a80496a9d37d70b2bec6cb
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Rafal Wojsznis
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# Workable
|
2
|
+
|
3
|
+
[![Code Climate](https://codeclimate.com/github/emq/workable/badges/gpa.svg)](https://codeclimate.com/github/emq/workable)
|
4
|
+
[![Build Status](https://travis-ci.org/emq/workable.svg?branch=master)](https://travis-ci.org/emq/workable)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/emq/workable/badge.png?branch=master)](https://coveralls.io/r/emq/workable?branch=master)
|
6
|
+
|
7
|
+
Dead-simple Ruby API client for [workable.com][1]. No extra runtime dependencies. Ruby >= 1.9.3.
|
8
|
+
|
9
|
+
Uses v2 API provided by workable.
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
Add this line to your application's Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'workable'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then execute:
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
Or install it yourself as:
|
24
|
+
|
25
|
+
$ gem install workable
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
Internal interface / api is in early stage, so far you can:
|
30
|
+
- fetch jobs
|
31
|
+
- fetch job details
|
32
|
+
- fetch candidates for given job
|
33
|
+
|
34
|
+
**Example:**
|
35
|
+
|
36
|
+
``` ruby
|
37
|
+
client = Workable::Client.new(api_key: 'api_key', subdomain: 'your_subdomain')
|
38
|
+
client.jobs # => [#<Workable::Job>, #<Workable::Job>]
|
39
|
+
|
40
|
+
shortcode = 'job_shortcode'
|
41
|
+
|
42
|
+
# API queries are not cached (at all) - it's up to you to cache results one way or another
|
43
|
+
|
44
|
+
client.job_details(shortcode) # => #<Workable::Job>
|
45
|
+
client.job_candidates(shortcode) # => Array of hashes
|
46
|
+
|
47
|
+
# Possible errors (each one inherits from Workable::Errors::WorkableError)
|
48
|
+
Workable::Errors::InvalidConfiguration # missing api_key / subdomain
|
49
|
+
Workable::Errors::NotAuthorized # wrong api key
|
50
|
+
Workable::Errors::InvalidResponse # something when wrong during the request?
|
51
|
+
Workable::Errors::NotFound # 404 from workable
|
52
|
+
```
|
53
|
+
|
54
|
+
## Missing/Todo
|
55
|
+
|
56
|
+
Pull requests are welcomed. So far this gem does not provide:
|
57
|
+
|
58
|
+
- candidates import
|
59
|
+
- some sane way for parsing candidates json response
|
60
|
+
|
61
|
+
_(Personally I don't really need/use it)_
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
1. Fork it ( https://github.com/emq/workable/fork )
|
66
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
67
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
68
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
69
|
+
5. Create a new Pull Request
|
70
|
+
|
71
|
+
[1]: http://workable.com/
|
data/Rakefile
ADDED
data/lib/workable.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'uri'
|
3
|
+
require 'net/http'
|
4
|
+
require 'date'
|
5
|
+
require 'ostruct'
|
6
|
+
|
7
|
+
require_relative "workable/version"
|
8
|
+
require_relative "workable/errors"
|
9
|
+
require_relative "workable/client"
|
10
|
+
require_relative "workable/job"
|
11
|
+
|
12
|
+
module Workable
|
13
|
+
API_VERSION = "2".freeze
|
14
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Workable
|
2
|
+
class Client
|
3
|
+
def initialize(options = {})
|
4
|
+
@api_key = options.fetch(:api_key) { fail Errors::InvalidConfiguration, "Missing api_key argument" }
|
5
|
+
@subdomain = options.fetch(:subdomain) { fail Errors::InvalidConfiguration, "Missing subdomain argument" }
|
6
|
+
end
|
7
|
+
|
8
|
+
def jobs(type = 'published')
|
9
|
+
get_request("jobs?phase=#{type}")['jobs'].map do |params|
|
10
|
+
Job.new(params)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def job_details(shortcode)
|
15
|
+
Job.new(get_request"jobs/#{shortcode}")
|
16
|
+
end
|
17
|
+
|
18
|
+
def job_candidates(shortcode)
|
19
|
+
get_request("jobs/#{shortcode}/candidates")['candidates']
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
attr_reader :api_key, :subdomain
|
25
|
+
|
26
|
+
def api_url
|
27
|
+
"https://www.workable.com/spi/v%s/accounts/%s" % [Workable::API_VERSION, subdomain]
|
28
|
+
end
|
29
|
+
|
30
|
+
def get_request(url)
|
31
|
+
uri = URI.parse("#{api_url}/#{url}")
|
32
|
+
|
33
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
34
|
+
http.use_ssl = true
|
35
|
+
|
36
|
+
request = Net::HTTP::Get.new(uri.request_uri, headers)
|
37
|
+
response = http.request(request)
|
38
|
+
|
39
|
+
validate!(response)
|
40
|
+
|
41
|
+
JSON.parse(response.body)
|
42
|
+
end
|
43
|
+
|
44
|
+
def validate!(response)
|
45
|
+
case response.code.to_i
|
46
|
+
when 401
|
47
|
+
raise Errors::NotAuthorized, response.body
|
48
|
+
when 404
|
49
|
+
raise Errors::NotFound, response.body
|
50
|
+
when proc { |code| code != 200 }
|
51
|
+
raise Errors::InvalidResponse, "Response code: #{response.code}"
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def headers
|
56
|
+
{
|
57
|
+
'Accept' => 'application/json',
|
58
|
+
'Authorization' => "Bearer #{api_key}",
|
59
|
+
'User-Agent' => 'Workable Ruby Client'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/lib/workable/job.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Workable
|
2
|
+
class Job
|
3
|
+
# from main jobs query
|
4
|
+
attr_reader :key, :title, :full_title, :code, :shortcode, :state,
|
5
|
+
:department, :url, :application_url, :shortlink, :location
|
6
|
+
|
7
|
+
# from job details
|
8
|
+
attr_reader :full_description, :description, :requirements, :benefits,
|
9
|
+
:employment_type, :industry, :function, :experience, :education
|
10
|
+
|
11
|
+
def initialize(params)
|
12
|
+
params.each do |key, value|
|
13
|
+
value = OpenStruct.new(value) if value.is_a?(Hash)
|
14
|
+
instance_variable_set("@#{key}", value)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def location_name
|
19
|
+
"#{location.city}, #{location.country}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def created_at
|
23
|
+
Date.parse(@created_at)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/fixtures.rb
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
# dead-simple methods instead of full vcr cassettes, because why not?
|
3
|
+
|
4
|
+
def jobs_index_json_fixture
|
5
|
+
JSON.generate({
|
6
|
+
"name" => "wojsznis",
|
7
|
+
"description" => nil,
|
8
|
+
"jobs" => [
|
9
|
+
{
|
10
|
+
"key" => "7c60",
|
11
|
+
"title" => "Ruby on Rails dev",
|
12
|
+
"full_title" => "Ruby on Rails dev - CODE",
|
13
|
+
"code" => "CODE",
|
14
|
+
"shortcode" => "03FF356C8B",
|
15
|
+
"state" => "published",
|
16
|
+
"department" => "DEPT",
|
17
|
+
"url" => "https://wojsznis.workable.com/jobs/30606",
|
18
|
+
"application_url" => "https://wojsznis.workable.com/jobs/30606/candidates/new",
|
19
|
+
"shortlink" => "https://wojsznis.workable.com/j/03FF356C8B",
|
20
|
+
"location" => {
|
21
|
+
"country" => "Poland",
|
22
|
+
"country_code" => "PL",
|
23
|
+
"region" => "Małopolskie",
|
24
|
+
"region_code" => "MA",
|
25
|
+
"city" => "Kraków",
|
26
|
+
"zip_code" => "30-000",
|
27
|
+
"telecommuting" => true
|
28
|
+
},
|
29
|
+
"created_at" => "2015-01-05"
|
30
|
+
}
|
31
|
+
]
|
32
|
+
})
|
33
|
+
end
|
34
|
+
|
35
|
+
def job_json_fixture
|
36
|
+
JSON.generate({
|
37
|
+
"key" => "7c60",
|
38
|
+
"title" => "Ruby on Rails dev",
|
39
|
+
"full_title" => "Ruby on Rails dev - CODE",
|
40
|
+
"code" => "CODE",
|
41
|
+
"shortcode" => "03FF356C8B",
|
42
|
+
"state" => "draft",
|
43
|
+
"department" => "DEPT",
|
44
|
+
"url" => "https://wojsznis.workable.com/jobs/30606",
|
45
|
+
"application_url" => "https://wojsznis.workable.com/jobs/30606/candidates/new",
|
46
|
+
"shortlink" => "https://wojsznis.workable.com/j/03FF356C8B",
|
47
|
+
"location" => {
|
48
|
+
"country" => "Poland",
|
49
|
+
"country_code" => "PL",
|
50
|
+
"region" => "Małopolskie",
|
51
|
+
"region_code" => "MA",
|
52
|
+
"city" => "Kraków",
|
53
|
+
"zip_code" => "30-338",
|
54
|
+
"telecommuting" => true
|
55
|
+
},
|
56
|
+
"created_at" => "2015-01-05",
|
57
|
+
"full_description" => "<p>Example job brief.</p>\r\n<ul>\n<li>test 1</li>\r\n<li>test 2</li>\r\n<li>test 3</li>\r\n</ul><p></p>\r\n<p><b>End of test.</b></p><p><strong>Requirements</strong></p><ul>\n<li>req 1</li>\r\n<li>req 2</li>\r\n</ul><p><strong>Benefits</strong></p><ul>\n<li>ben 1</li>\r\n<li>ben 2</li>\r\n</ul>",
|
58
|
+
"description" => "<p>Example job brief.</p>\r\n<ul>\n<li>test 1</li>\r\n<li>test 2</li>\r\n<li>test 3</li>\r\n</ul><p></p>\r\n<p><b>End of test.</b></p>",
|
59
|
+
"requirements" => "<ul>\n<li>req 1</li>\r\n<li>req 2</li>\r\n</ul>",
|
60
|
+
"benefits" => "<ul>\n<li>ben 1</li>\r\n<li>ben 2</li>\r\n</ul>",
|
61
|
+
"employment_type" => "Full-time",
|
62
|
+
"industry" => "Information Technology and Services",
|
63
|
+
"function" => "Engineering",
|
64
|
+
"experience" => "Mid-Senior level",
|
65
|
+
"education" => "Professional"
|
66
|
+
})
|
67
|
+
end
|
68
|
+
|
69
|
+
def job_candidates_json_fixture
|
70
|
+
JSON.generate({
|
71
|
+
"candidates" => [
|
72
|
+
{
|
73
|
+
"key" => "f7087",
|
74
|
+
"name" => "Test LastName",
|
75
|
+
"firstname" => "Test",
|
76
|
+
"lastname" => "LastName",
|
77
|
+
"headline" => "headline",
|
78
|
+
"account" => {
|
79
|
+
"subdomain" => "wojsznis",
|
80
|
+
"name" => "wojsznis"
|
81
|
+
},
|
82
|
+
"job" => {
|
83
|
+
"shortcode" => "03FF356C8B",
|
84
|
+
"title" => "Ruby on Rails dev"
|
85
|
+
},
|
86
|
+
"stage" => "Applied",
|
87
|
+
"disqualified" => false,
|
88
|
+
"sourced" => false,
|
89
|
+
"profile_url" => "http://wojsznis.workable.com/backend/jobs/30606/candidates/1010613",
|
90
|
+
"address" => "Address",
|
91
|
+
"phone" => "",
|
92
|
+
"email" => "example@test.com",
|
93
|
+
"outbound_mailbox" => "eaqpdpbc@outbound.workablemail.com",
|
94
|
+
"domain" => "unknown",
|
95
|
+
"created_at" => "2015-01-05 11:56:40",
|
96
|
+
"updated_at" => "2015-01-05 11:56:48",
|
97
|
+
"cover_letter" => "",
|
98
|
+
"summary" => "",
|
99
|
+
"education_entries" => [ ],
|
100
|
+
"experience_entries" => [ ],
|
101
|
+
"skills" => [ ],
|
102
|
+
"answers" => [
|
103
|
+
{
|
104
|
+
"question" => {
|
105
|
+
"body" => "Why you want this job?"
|
106
|
+
},
|
107
|
+
"answer" => {
|
108
|
+
"body" => "<p>Sample answer</p>"
|
109
|
+
}
|
110
|
+
}
|
111
|
+
],
|
112
|
+
"resume_url" => "",
|
113
|
+
"tags" => [ ]
|
114
|
+
}
|
115
|
+
]
|
116
|
+
})
|
117
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Workable::Client do
|
4
|
+
|
5
|
+
describe 'initialization' do
|
6
|
+
it 'raises an error on missing api_key / subdomain' do
|
7
|
+
expect { described_class.new }.to raise_error(Workable::Errors::InvalidConfiguration)
|
8
|
+
expect { described_class.new(api_key: 'key') }.to raise_error(Workable::Errors::InvalidConfiguration)
|
9
|
+
expect { described_class.new(subdomain: 'subdomain') }.to raise_error(Workable::Errors::InvalidConfiguration)
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'creates new instance when all required arguments are provided' do
|
13
|
+
expect(described_class.new(api_key: 'key', subdomain: 'subdomain')).to be_kind_of(described_class)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe '#jobs' do
|
18
|
+
let(:client){ described_class.new(api_key: 'test', subdomain: 'subdomain') }
|
19
|
+
|
20
|
+
it 'returns array of posted jobs' do
|
21
|
+
stub_request(:get, "https://www.workable.com/spi/v2/accounts/subdomain/jobs?phase=published")
|
22
|
+
.with(headers: { 'Authorization'=>'Bearer test', 'User-Agent'=>'Workable Ruby Client' })
|
23
|
+
.to_return(status: 200, body: jobs_index_json_fixture, headers: {})
|
24
|
+
|
25
|
+
expect(client.jobs).to be_kind_of(Array)
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'raises exception on not authorized error (401)' do
|
29
|
+
stub_request(:get, "https://www.workable.com/spi/v2/accounts/subdomain/jobs?phase=published")
|
30
|
+
.to_return(status: 401, body: '{"error":"Not authorized"}', headers: {})
|
31
|
+
|
32
|
+
expect { client.jobs }.to raise_error(Workable::Errors::NotAuthorized)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'raises exception when status code differs from 200' do
|
36
|
+
stub_request(:get, "https://www.workable.com/spi/v2/accounts/subdomain/jobs?phase=published")
|
37
|
+
.to_return(status: 500, body: '', headers: {})
|
38
|
+
|
39
|
+
expect { client.jobs }.to raise_error(Workable::Errors::InvalidResponse)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe '#job_details' do
|
44
|
+
let(:client){ described_class.new(api_key: 'test', subdomain: 'subdomain') }
|
45
|
+
|
46
|
+
it 'returns details of given job' do
|
47
|
+
stub_request(:get, "https://www.workable.com/spi/v2/accounts/subdomain/jobs/03FF356C8B")
|
48
|
+
.to_return(status: 200, body: job_json_fixture, headers: {})
|
49
|
+
|
50
|
+
expect(client.job_details('03FF356C8B')).to be_kind_of(Workable::Job)
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'raises an exception when job is not found' do
|
54
|
+
stub_request(:get, "https://www.workable.com/spi/v2/accounts/subdomain/jobs/invalid")
|
55
|
+
.to_return(status: 404, body: '{"error":"Not found"}', headers: {})
|
56
|
+
|
57
|
+
expect { client.job_details('invalid') }.to raise_error(Workable::Errors::NotFound)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
describe '#candidates' do
|
62
|
+
let(:client){ described_class.new(api_key: 'test', subdomain: 'subdomain') }
|
63
|
+
|
64
|
+
it 'returns array of candidates for given job' do
|
65
|
+
stub_request(:get, "https://www.workable.com/spi/v2/accounts/subdomain/jobs/03FF356C8B/candidates")
|
66
|
+
.to_return(status: 200, body: job_candidates_json_fixture, headers: {})
|
67
|
+
|
68
|
+
expect(client.job_candidates('03FF356C8B')).to be_kind_of(Array)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'coveralls'
|
2
|
+
Coveralls.wear!
|
3
|
+
|
4
|
+
require_relative '../lib/workable'
|
5
|
+
require_relative 'fixtures'
|
6
|
+
require 'webmock/rspec'
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.after(:each) do
|
10
|
+
WebMock.reset!
|
11
|
+
end
|
12
|
+
|
13
|
+
# rspec-expectations config goes here. You can use an alternate
|
14
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
15
|
+
# assertions if you prefer.
|
16
|
+
config.expect_with :rspec do |expectations|
|
17
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
18
|
+
# and `failure_message` of custom matchers include text for helper methods
|
19
|
+
# defined using `chain`, e.g.:
|
20
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
21
|
+
# # => "be bigger than 2 and smaller than 4"
|
22
|
+
# ...rather than:
|
23
|
+
# # => "be bigger than 2"
|
24
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
25
|
+
end
|
26
|
+
|
27
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
28
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
29
|
+
config.mock_with :rspec do |mocks|
|
30
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
31
|
+
# a real object. This is generally recommended, and will default to
|
32
|
+
# `true` in RSpec 4.
|
33
|
+
mocks.verify_partial_doubles = true
|
34
|
+
end
|
35
|
+
|
36
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
37
|
+
# be too noisy due to issues in dependencies.
|
38
|
+
config.warnings = true
|
39
|
+
|
40
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
41
|
+
# file, and it's useful to allow more verbose output when running an
|
42
|
+
# individual spec file.
|
43
|
+
if config.files_to_run.one?
|
44
|
+
# Use the documentation formatter for detailed output,
|
45
|
+
# unless a formatter has already been configured
|
46
|
+
# (e.g. via a command-line flag).
|
47
|
+
config.default_formatter = 'doc'
|
48
|
+
end
|
49
|
+
|
50
|
+
# Print the 10 slowest examples and example groups at the
|
51
|
+
# end of the spec run, to help surface which specs are running
|
52
|
+
# particularly slow.
|
53
|
+
config.profile_examples = 10
|
54
|
+
|
55
|
+
# Run specs in random order to surface order dependencies. If you find an
|
56
|
+
# order dependency and want to debug it, you can fix the order by providing
|
57
|
+
# the seed, which is printed after each run.
|
58
|
+
# --seed 1234
|
59
|
+
config.order = :random
|
60
|
+
|
61
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
62
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
63
|
+
# test failures related to randomization by passing the same `--seed` value
|
64
|
+
# as the one that triggered the failure.
|
65
|
+
Kernel.srand config.seed
|
66
|
+
end
|
data/workable.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'workable/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "workable"
|
8
|
+
spec.version = Workable::VERSION
|
9
|
+
spec.authors = ["Rafał Wojsznis"]
|
10
|
+
spec.email = ["rafal.wojsznis@gmail.com"]
|
11
|
+
spec.homepage = "https://github.com/emq/workable"
|
12
|
+
spec.license = "MIT"
|
13
|
+
spec.summary = spec.description = "Dead-simple Ruby API client for workable.com"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.required_ruby_version = '>= 1.9.3'
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
23
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.1.0'
|
25
|
+
spec.add_development_dependency 'webmock', '~> 1.20.4'
|
26
|
+
spec.add_development_dependency 'coveralls', '~> 0.7.2'
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: workable
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rafał Wojsznis
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-05 00:00:00.000000000 Z
|
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.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.1.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 3.1.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.20.4
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.20.4
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: coveralls
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.7.2
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.7.2
|
83
|
+
description: Dead-simple Ruby API client for workable.com
|
84
|
+
email:
|
85
|
+
- rafal.wojsznis@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".gitignore"
|
91
|
+
- ".rspec"
|
92
|
+
- ".travis.yml"
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE.txt
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- lib/workable.rb
|
98
|
+
- lib/workable/client.rb
|
99
|
+
- lib/workable/errors.rb
|
100
|
+
- lib/workable/job.rb
|
101
|
+
- lib/workable/version.rb
|
102
|
+
- spec/fixtures.rb
|
103
|
+
- spec/lib/workable/client_spec.rb
|
104
|
+
- spec/lib/workable/job_spec.rb
|
105
|
+
- spec/spec_helper.rb
|
106
|
+
- workable.gemspec
|
107
|
+
homepage: https://github.com/emq/workable
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
metadata: {}
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: 1.9.3
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 2.4.5
|
128
|
+
signing_key:
|
129
|
+
specification_version: 4
|
130
|
+
summary: Dead-simple Ruby API client for workable.com
|
131
|
+
test_files:
|
132
|
+
- spec/fixtures.rb
|
133
|
+
- spec/lib/workable/client_spec.rb
|
134
|
+
- spec/lib/workable/job_spec.rb
|
135
|
+
- spec/spec_helper.rb
|