careerjet-api-client 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/.rspec +3 -0
- data/.travis.yml +11 -0
- data/Gemfile +3 -0
- data/README.md +164 -0
- data/Rakefile +6 -0
- data/careerjet-api-client.gemspec +21 -0
- data/lib/careerjet.rb +2 -0
- data/lib/careerjet/api_client.rb +74 -0
- data/lib/careerjet/constants.rb +78 -0
- data/lib/careerjet/errors.rb +10 -0
- data/lib/careerjet/mash.rb +11 -0
- data/lib/careerjet/version.rb +7 -0
- data/spec/careerjet_spec.rb +33 -0
- metadata +189 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
# Careerjet API Client Ruby
|
2
|
+
|
3
|
+
It's ruby wrapper for [Careerjet](http://www.careerjet.com)'s API.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'careerjet-api-client', :require => "careerjet/api_client"
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install careerjet-api-client
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
> cj_api_client = Careerjet::APIClient.new(:locale=> :es_ES)
|
23
|
+
> cj_api_client.search(:affid=>'213e213hd12344552',:user_ip=>'192.168.0.40',:user_agent=>'Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0');
|
24
|
+
=> #<Careerjet::Mash hits=5704 jobs=[<..>] pages=286 response_time=0.0434670448303223 type="JOBS">
|
25
|
+
```
|
26
|
+
|
27
|
+
You will get [Hashie::Mash](https://github.com/intridea/hashie#mash) as a response,
|
28
|
+
so you can get all data via convenient methods:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
> cj_api_client.search(:affid=>'213e213hd12344552',:user_ip=>'192.168.0.40',:user_agent=>'Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0').jobs.first
|
32
|
+
#<Careerjet::Mash company="Company Name" date="Wed, 17 Apr 2013 00:00:00 GMT" description=" <..>" url="http://...">
|
33
|
+
```
|
34
|
+
|
35
|
+
|
36
|
+
### Mandatory Search Params
|
37
|
+
|
38
|
+
* `affid` : Affiliate ID provided by Careerjet. Requires to open a Careerjet partner account (http://www.careerjet.com/partners/).
|
39
|
+
* `user_ip` : IP address of the end-user to whom the search results will be displayed.
|
40
|
+
* `user_agent` : User agent of the end-user's browser.
|
41
|
+
* `url` : URL of page that will display the search results
|
42
|
+
|
43
|
+
### Optional Search Params
|
44
|
+
|
45
|
+
* `keywords`: Keywords to search in job offers.
|
46
|
+
|
47
|
+
* `location`: Location to search job offers in.
|
48
|
+
|
49
|
+
* `sort`: Type of sort. Can be: `relevance` (default) — most relevant first, `date` — freshest offer first and `salary` — biggest salary first.
|
50
|
+
|
51
|
+
* `start_num`: Number of first offer returned in entire result space. Should be >= 1 and <= Number of hits.
|
52
|
+
|
53
|
+
* `pagesize`: Number of offers returned in one call.
|
54
|
+
|
55
|
+
* `page`: Number of the asked page. Should be >=1. If this value is set, the eventually given `start_num` is overrided.
|
56
|
+
|
57
|
+
* `contracttype`: Character code for contract type.`p` — permanent job, `c` — contract, `t` — temporary, `i` — training, `v` — voluntary, none — all contract types.
|
58
|
+
|
59
|
+
* `contractperiod`: Character code for contract work period. `f` — full time, `p` — part time, none — all work period.
|
60
|
+
|
61
|
+
* `locale`: Locale of search, if locale not specified — using `:en_US`
|
62
|
+
supported locale
|
63
|
+
```
|
64
|
+
:cs_CZ => 'http://www.careerjet.cz' ,
|
65
|
+
:da_DK => 'http://www.careerjet.dk' ,
|
66
|
+
:de_AT => 'http://www.careerjet.at' ,
|
67
|
+
:de_CH => 'http://www.careerjet.ch' ,
|
68
|
+
:de_DE => 'http://www.careerjet.de' ,
|
69
|
+
:en_AE => 'http://www.careerjet.ae' ,
|
70
|
+
:en_AU => 'http://www.careerjet.com.au' ,
|
71
|
+
:en_BD => 'http://www.careerjet.com.bd' ,
|
72
|
+
:en_CA => 'http://www.careerjet.ca' ,
|
73
|
+
:en_CN => 'http://en.careerjet.cn' ,
|
74
|
+
:en_HK => 'http://www.careerjet.hk' ,
|
75
|
+
:en_IE => 'http://www.careerjet.ie' ,
|
76
|
+
:en_IN => 'http://www.careerjet.co.in' ,
|
77
|
+
:en_KW => 'http://www.careerjet.com.kw' ,
|
78
|
+
:en_MY => 'http://www.careerjet.com.my' ,
|
79
|
+
:en_NZ => 'http://www.careerjet.co.nz' ,
|
80
|
+
:en_OM => 'http://www.careerjet.com.om' ,
|
81
|
+
:en_PH => 'http://www.careerjet.ph' ,
|
82
|
+
:en_PK => 'http://www.careerjet.com.pk' ,
|
83
|
+
:en_QA => 'http://www.careerjet.com.qa' ,
|
84
|
+
:en_SG => 'http://www.careerjet.sg' ,
|
85
|
+
:en_GB => 'http://www.careerjet.co.uk' ,
|
86
|
+
:en_US => 'http://www.careerjet.com' ,
|
87
|
+
:en_ZA => 'http://www.careerjet.co.za' ,
|
88
|
+
:en_SA => 'http://www.careerjet-saudi-arabia.com' ,
|
89
|
+
:en_TW => 'http://www.careerjet.com.tw' ,
|
90
|
+
:en_VN => 'http://www.careerjet.vn' ,
|
91
|
+
:es_AR => 'http://www.opcionempleo.com.ar' ,
|
92
|
+
:es_BO => 'http://www.opcionempleo.com.bo' ,
|
93
|
+
:es_CL => 'http://www.opcionempleo.cl' ,
|
94
|
+
:es_CO => 'http://www.opcionempleo.com.co' ,
|
95
|
+
:es_CR => 'http://www.opcionempleo.co.cr' ,
|
96
|
+
:es_DO => 'http://www.opcionempleo.com.do' ,
|
97
|
+
:es_EC => 'http://www.opcionempleo.ec' ,
|
98
|
+
:es_ES => 'http://www.opcionempleo.com' ,
|
99
|
+
:es_GT => 'http://www.opcionempleo.com.gt' ,
|
100
|
+
:es_MX => 'http://www.opcionempleo.com.mx' ,
|
101
|
+
:es_PA => 'http://www.opcionempleo.com.pa' ,
|
102
|
+
:es_PE => 'http://www.opcionempleo.com.pe' ,
|
103
|
+
:es_PR => 'http://www.opcionempleo.com.pr' ,
|
104
|
+
:es_PY => 'http://www.opcionempleo.com.py' ,
|
105
|
+
:es_UY => 'http://www.opcionempleo.com.uy' ,
|
106
|
+
:es_VE => 'http://www.opcionempleo.com.ve' ,
|
107
|
+
:fi_FI => 'http://www.careerjet.fi' ,
|
108
|
+
:fr_CA => 'http://fr.careerjet.ca' ,
|
109
|
+
:fr_BE => 'http://www.optioncarriere.be' ,
|
110
|
+
:fr_CH => 'http://www.optioncarriere.ch' ,
|
111
|
+
:fr_FR => 'http://www.optioncarriere.com' ,
|
112
|
+
:fr_LU => 'http://www.optioncarriere.lu' ,
|
113
|
+
:fr_MA => 'http://www.optioncarriere.ma' ,
|
114
|
+
:hu_HU => 'http://www.careerjet.hu' ,
|
115
|
+
:it_IT => 'http://www.careerjet.it' ,
|
116
|
+
:ja_JP => 'http://www.careerjet.jp' ,
|
117
|
+
:ko_KR => 'http://www.careerjet.co.kr' ,
|
118
|
+
:nl_BE => 'http://www.careerjet.be' ,
|
119
|
+
:nl_NL => 'http://www.careerjet.nl' ,
|
120
|
+
:no_NO => 'http://www.careerjet.no' ,
|
121
|
+
:pl_PL => 'http://www.careerjet.pl' ,
|
122
|
+
:pt_PT => 'http://www.careerjet.pt' ,
|
123
|
+
:pt_BR => 'http://www.careerjet.com.br' ,
|
124
|
+
:ru_RU => 'http://www.careerjet.ru' ,
|
125
|
+
:ru_UA => 'http://www.careerjet.com.ua' ,
|
126
|
+
:sv_SE => 'http://www.careerjet.se' ,
|
127
|
+
:sk_SK => 'http://www.careerjet.sk' ,
|
128
|
+
:tr_TR => 'http://www.careerjet.com.tr' ,
|
129
|
+
:uk_UA => 'http://www.careerjet.ua' ,
|
130
|
+
:vi_VN => 'http://www.careerjet.com.vn' ,
|
131
|
+
:zh_CN => 'http://www.careerjet.cn' ,
|
132
|
+
|
133
|
+
```
|
134
|
+
|
135
|
+
|
136
|
+
## Thanks
|
137
|
+
|
138
|
+
This gem was inspired by [careerjet](https://github.com/kostia/careerjet) gem from [kostia](https://github.com/kostia).
|
139
|
+
|
140
|
+
## License
|
141
|
+
|
142
|
+
Copyright (c) 2012-2013 Sergey Efremov, Kostiantyn Kahanskyi, Careerjet Ltd
|
143
|
+
|
144
|
+
MIT License
|
145
|
+
|
146
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
147
|
+
a copy of this software and associated documentation files (the
|
148
|
+
"Software"), to deal in the Software without restriction, including
|
149
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
150
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
151
|
+
permit persons to whom the Software is furnished to do so, subject to
|
152
|
+
the following conditions:
|
153
|
+
|
154
|
+
The above copyright notice and this permission notice shall be
|
155
|
+
included in all copies or substantial portions of the Software.
|
156
|
+
|
157
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
158
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
159
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
160
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
161
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
162
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
163
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
164
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.expand_path('../lib/careerjet/version', __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'careerjet-api-client'
|
5
|
+
gem.version = Careerjet::APIClient.version
|
6
|
+
gem.description = "Ruby wrapper for Careerjet's API"
|
7
|
+
gem.summary = "Ruby wrapper for Careerjet's API"
|
8
|
+
gem.homepage = 'https://github.com/careerjet/careerjet-api-client-ruby'
|
9
|
+
gem.authors = ['Sergey Efremov', 'Kostiantyn Kahanskyi','Careerjet']
|
10
|
+
gem.license = 'MIT'
|
11
|
+
gem.files = `git ls-files`.split("\n")
|
12
|
+
gem.require_paths = %w[lib]
|
13
|
+
gem.add_dependency 'multi_json'
|
14
|
+
gem.add_dependency 'rest-client'
|
15
|
+
gem.add_dependency 'hashie'
|
16
|
+
gem.add_development_dependency 'pry'
|
17
|
+
gem.add_development_dependency 'rake'
|
18
|
+
gem.add_development_dependency 'rspec'
|
19
|
+
gem.add_development_dependency 'webmock'
|
20
|
+
gem.add_development_dependency 'yajl-ruby' # To avoid warning from MultiJson
|
21
|
+
end
|
data/lib/careerjet.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'careerjet/errors'
|
2
|
+
require 'careerjet/mash'
|
3
|
+
require 'careerjet/version'
|
4
|
+
require 'rest_client'
|
5
|
+
require 'careerjet/constants'
|
6
|
+
module Careerjet
|
7
|
+
class APIClient
|
8
|
+
def initialize(params)
|
9
|
+
@params = params || {}
|
10
|
+
init_locale
|
11
|
+
check_locale_param
|
12
|
+
end
|
13
|
+
|
14
|
+
def check_locale_param
|
15
|
+
unless Careerjet::LOCALES.keys.include?(@params[:locale_code])
|
16
|
+
raise Careerjet::UnknownLocale, "Not supported locale '#{@params[:locale_code]}'"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def search(search_params)
|
21
|
+
@search_params = search_params || {}
|
22
|
+
check_search_params(search_params)
|
23
|
+
response = RestClient.get [Careerjet::DOMAIN, 'search'].join('/'), params: @search_params,:user_agent => 'careerjet-api-client-v' + Careerjet::APIClient.version + '-ruby-v' + RUBY_VERSION
|
24
|
+
raise_errors response
|
25
|
+
|
26
|
+
results = response.body
|
27
|
+
Careerjet::Mash.from_json results
|
28
|
+
end
|
29
|
+
|
30
|
+
def check_search_params(search_params)
|
31
|
+
@search_params = search_params || {}
|
32
|
+
|
33
|
+
#set search locale
|
34
|
+
@search_params[:locale_code] = @search_params[:locale_code] || @search_params[:locale] || @params[:locale_code]
|
35
|
+
@search_params.delete(:locale)
|
36
|
+
|
37
|
+
@search_params.each_key do |k|
|
38
|
+
unless Careerjet::ALLOWED_FIELDS.include? k
|
39
|
+
raise InvalidParam, "Unknown param key '#{k}'"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
unless @search_params[:affid]
|
44
|
+
raise MandatoryParamMissing,"Mandatory param 'affid' missing"
|
45
|
+
end
|
46
|
+
|
47
|
+
unless @search_params[:user_ip]
|
48
|
+
raise MandatoryParamMissing,"Mandatory param 'user_ip' missing"
|
49
|
+
end
|
50
|
+
|
51
|
+
unless @search_params[:user_agent]
|
52
|
+
raise MandatoryParamMissing,"Mandatory param 'user_agent' missing"
|
53
|
+
end
|
54
|
+
|
55
|
+
unless @search_params[:url]
|
56
|
+
raise MandatoryParamMissing,"Mandatory param 'url' missing"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def init_locale
|
61
|
+
@params[:locale_code] = @params[:locale_code] || @params[:locale] || :en_GB
|
62
|
+
@params.delete(:locale)
|
63
|
+
end
|
64
|
+
|
65
|
+
def raise_errors response
|
66
|
+
case response.code.to_i
|
67
|
+
when 400..405
|
68
|
+
raise Careerjet::NotFoundError, "(#{response.code}): #{response.message}"
|
69
|
+
when 500..503
|
70
|
+
raise Careerjet::UnavailableError, "(#{response.code}): #{response.message}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module Careerjet
|
2
|
+
DOMAIN = "http://public.api.careerjet.net"
|
3
|
+
|
4
|
+
ALLOWED_FIELDS = [:keywords, :location, :sort, :start_num, :pagesize, :page,
|
5
|
+
:contracttype, :contractperiod, :locale_code,:affid,:user_ip,:user_agent,:url]
|
6
|
+
|
7
|
+
LOCALES = {
|
8
|
+
:cs_CZ => 'http://www.careerjet.cz' ,
|
9
|
+
:da_DK => 'http://www.careerjet.dk' ,
|
10
|
+
:de_AT => 'http://www.careerjet.at' ,
|
11
|
+
:de_CH => 'http://www.careerjet.ch' ,
|
12
|
+
:de_DE => 'http://www.careerjet.de' ,
|
13
|
+
:en_AE => 'http://www.careerjet.ae' ,
|
14
|
+
:en_AU => 'http://www.careerjet.com.au' ,
|
15
|
+
:en_BD => 'http://www.careerjet.com.bd' ,
|
16
|
+
:en_CA => 'http://www.careerjet.ca' ,
|
17
|
+
:en_CN => 'http://en.careerjet.cn' ,
|
18
|
+
:en_HK => 'http://www.careerjet.hk' ,
|
19
|
+
:en_IE => 'http://www.careerjet.ie' ,
|
20
|
+
:en_IN => 'http://www.careerjet.co.in' ,
|
21
|
+
:en_KW => 'http://www.careerjet.com.kw' ,
|
22
|
+
:en_MY => 'http://www.careerjet.com.my' ,
|
23
|
+
:en_NZ => 'http://www.careerjet.co.nz' ,
|
24
|
+
:en_OM => 'http://www.careerjet.com.om' ,
|
25
|
+
:en_PH => 'http://www.careerjet.ph' ,
|
26
|
+
:en_PK => 'http://www.careerjet.com.pk' ,
|
27
|
+
:en_QA => 'http://www.careerjet.com.qa' ,
|
28
|
+
:en_SG => 'http://www.careerjet.sg' ,
|
29
|
+
:en_GB => 'http://www.careerjet.co.uk' ,
|
30
|
+
:en_US => 'http://www.careerjet.com' ,
|
31
|
+
:en_ZA => 'http://www.careerjet.co.za' ,
|
32
|
+
:en_SA => 'http://www.careerjet-saudi-arabia.com' ,
|
33
|
+
:en_TW => 'http://www.careerjet.com.tw' ,
|
34
|
+
:en_VN => 'http://www.careerjet.vn' ,
|
35
|
+
:es_AR => 'http://www.opcionempleo.com.ar' ,
|
36
|
+
:es_BO => 'http://www.opcionempleo.com.bo' ,
|
37
|
+
:es_CL => 'http://www.opcionempleo.cl' ,
|
38
|
+
:es_CO => 'http://www.opcionempleo.com.co' ,
|
39
|
+
:es_CR => 'http://www.opcionempleo.co.cr' ,
|
40
|
+
:es_DO => 'http://www.opcionempleo.com.do' ,
|
41
|
+
:es_EC => 'http://www.opcionempleo.ec' ,
|
42
|
+
:es_ES => 'http://www.opcionempleo.com' ,
|
43
|
+
:es_GT => 'http://www.opcionempleo.com.gt' ,
|
44
|
+
:es_MX => 'http://www.opcionempleo.com.mx' ,
|
45
|
+
:es_PA => 'http://www.opcionempleo.com.pa' ,
|
46
|
+
:es_PE => 'http://www.opcionempleo.com.pe' ,
|
47
|
+
:es_PR => 'http://www.opcionempleo.com.pr' ,
|
48
|
+
:es_PY => 'http://www.opcionempleo.com.py' ,
|
49
|
+
:es_UY => 'http://www.opcionempleo.com.uy' ,
|
50
|
+
:es_VE => 'http://www.opcionempleo.com.ve' ,
|
51
|
+
:fi_FI => 'http://www.careerjet.fi' ,
|
52
|
+
:fr_CA => 'http://fr.careerjet.ca' ,
|
53
|
+
:fr_BE => 'http://www.optioncarriere.be' ,
|
54
|
+
:fr_CH => 'http://www.optioncarriere.ch' ,
|
55
|
+
:fr_FR => 'http://www.optioncarriere.com' ,
|
56
|
+
:fr_LU => 'http://www.optioncarriere.lu' ,
|
57
|
+
:fr_MA => 'http://www.optioncarriere.ma' ,
|
58
|
+
:hu_HU => 'http://www.careerjet.hu' ,
|
59
|
+
:it_IT => 'http://www.careerjet.it' ,
|
60
|
+
:ja_JP => 'http://www.careerjet.jp' ,
|
61
|
+
:ko_KR => 'http://www.careerjet.co.kr' ,
|
62
|
+
:nl_BE => 'http://www.careerjet.be' ,
|
63
|
+
:nl_NL => 'http://www.careerjet.nl' ,
|
64
|
+
:no_NO => 'http://www.careerjet.no' ,
|
65
|
+
:pl_PL => 'http://www.careerjet.pl' ,
|
66
|
+
:pt_PT => 'http://www.careerjet.pt' ,
|
67
|
+
:pt_BR => 'http://www.careerjet.com.br' ,
|
68
|
+
:ru_RU => 'http://www.careerjet.ru' ,
|
69
|
+
:ru_UA => 'http://www.careerjet.com.ua' ,
|
70
|
+
:sv_SE => 'http://www.careerjet.se' ,
|
71
|
+
:sk_SK => 'http://www.careerjet.sk' ,
|
72
|
+
:tr_TR => 'http://www.careerjet.com.tr' ,
|
73
|
+
:uk_UA => 'http://www.careerjet.ua' ,
|
74
|
+
:vi_VN => 'http://www.careerjet.com.vn' ,
|
75
|
+
:zh_CN => 'http://www.careerjet.cn' ,
|
76
|
+
}
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'webmock/rspec'
|
2
|
+
require 'careerjet/api_client'
|
3
|
+
|
4
|
+
describe Careerjet::APIClient do
|
5
|
+
it "should request Careejet's search API with correct domain and given params" do
|
6
|
+
resp = {'hits' => 1, 'response_time' => 0.001, 'type' => 'JOBS', 'pages' => 1}
|
7
|
+
stub_request(:get, "http://public.api.careerjet.net/search?affid=test_affid&keywords=rails&locale_code=en_US&page=1&user_agent=Mozilla/5.0%20(X11%3B%20Linux%20x86_64%3B%20rv:31.0)%20Gecko/20100101%20Firefox/31.0&user_ip=192.168.0.40").to_return(
|
8
|
+
:body => MultiJson.encode(resp))
|
9
|
+
careerjet_api_client = Careerjet::APIClient.new(:locale => :en_US);
|
10
|
+
|
11
|
+
results = careerjet_api_client.search(:affid=>'test_affid',:user_ip=>'192.168.0.40',:user_agent=>'Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0',:locale => :en_US, :keywords => 'rails', :page => 1)
|
12
|
+
|
13
|
+
expect(results.hits).to eq 1
|
14
|
+
expect(results.response_time).to eq 0.001
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'should raise appropriate error on unknown locale' do
|
18
|
+
expect(
|
19
|
+
lambda do
|
20
|
+
careerjet_api_client = Careerjet::APIClient.new(:locale => :foo_BAR);
|
21
|
+
end
|
22
|
+
).to raise_error(Careerjet::UnknownLocale)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should validate given params' do
|
26
|
+
expect(
|
27
|
+
lambda do
|
28
|
+
careerjet_api_client = Careerjet::APIClient.new(:locale => :en_GB);
|
29
|
+
careerjet_api_client.search(:locale => :en_US, :keywords => 'rails', :foo => 'bar')
|
30
|
+
end
|
31
|
+
).to raise_error(Careerjet::InvalidParam)
|
32
|
+
end
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,189 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: careerjet-api-client
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Sergey Efremov
|
9
|
+
- Kostiantyn Kahanskyi
|
10
|
+
- Careerjet
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
date: 2015-05-13 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: multi_json
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ! '>='
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '0'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
28
|
+
requirements:
|
29
|
+
- - ! '>='
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '0'
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: rest-client
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: hashie
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: pry
|
66
|
+
requirement: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
type: :development
|
73
|
+
prerelease: false
|
74
|
+
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rake
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
92
|
+
requirements:
|
93
|
+
- - ! '>='
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: rspec
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: webmock
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ! '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
type: :development
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ! '>='
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
version: '0'
|
128
|
+
- !ruby/object:Gem::Dependency
|
129
|
+
name: yajl-ruby
|
130
|
+
requirement: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ! '>='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
type: :development
|
137
|
+
prerelease: false
|
138
|
+
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ! '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
description: Ruby wrapper for Careerjet's API
|
145
|
+
email:
|
146
|
+
executables: []
|
147
|
+
extensions: []
|
148
|
+
extra_rdoc_files: []
|
149
|
+
files:
|
150
|
+
- .gitignore
|
151
|
+
- .rspec
|
152
|
+
- .travis.yml
|
153
|
+
- Gemfile
|
154
|
+
- README.md
|
155
|
+
- Rakefile
|
156
|
+
- careerjet-api-client.gemspec
|
157
|
+
- lib/careerjet.rb
|
158
|
+
- lib/careerjet/api_client.rb
|
159
|
+
- lib/careerjet/constants.rb
|
160
|
+
- lib/careerjet/errors.rb
|
161
|
+
- lib/careerjet/mash.rb
|
162
|
+
- lib/careerjet/version.rb
|
163
|
+
- spec/careerjet_spec.rb
|
164
|
+
homepage: https://github.com/careerjet/careerjet-api-client-ruby
|
165
|
+
licenses:
|
166
|
+
- MIT
|
167
|
+
post_install_message:
|
168
|
+
rdoc_options: []
|
169
|
+
require_paths:
|
170
|
+
- lib
|
171
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
172
|
+
none: false
|
173
|
+
requirements:
|
174
|
+
- - ! '>='
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0'
|
177
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
|
+
none: false
|
179
|
+
requirements:
|
180
|
+
- - ! '>='
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
183
|
+
requirements: []
|
184
|
+
rubyforge_project:
|
185
|
+
rubygems_version: 1.8.25
|
186
|
+
signing_key:
|
187
|
+
specification_version: 3
|
188
|
+
summary: Ruby wrapper for Careerjet's API
|
189
|
+
test_files: []
|