diff --git a/.travis.yml b/.travis.yml index fdae58c..3bf23a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,14 @@ rvm: - 2.2 - 2.1 +before_script: + - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter + - chmod +x ./cc-test-reporter + - ./cc-test-reporter before-build + script: rake spec -sudo: false \ No newline at end of file +after_script: + - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT + +sudo: false diff --git a/Gemfile b/Gemfile index 871ad07..3ab04a9 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ group :development do end group :test do - gem "codeclimate-test-reporter", group: :test, require: nil + gem 'simplecov', require: false end gemspec diff --git a/lib/greenhouse_io/api/client.rb b/lib/greenhouse_io/api/client.rb index 453d52d..7326a19 100644 --- a/lib/greenhouse_io/api/client.rb +++ b/lib/greenhouse_io/api/client.rb @@ -3,7 +3,10 @@ class Client include HTTMultiParty include GreenhouseIo::API - PERMITTED_OPTIONS = [:page, :per_page, :job_id] + PERMITTED_OPTIONS = [ + :page, :per_page, :job_id, :created_after, :created_before, :last_activity_after, + :updated_after, :updated_before, :live, :active + ] attr_accessor :api_token, :rate_limit, :rate_limit_remaining, :link base_uri 'https://harvest.greenhouse.io/v1' @@ -76,6 +79,10 @@ def job_post(id, options = {}) get_from_harvest_api "/jobs/#{id}/job_post", options end + def job_posts(options = {}) + get_from_harvest_api "/job_posts", options + end + def users(id = nil, options = {}) get_from_harvest_api "/users#{path_id(id)}", options end @@ -96,7 +103,7 @@ def permitted_options(options) def get_from_harvest_api(url, options = {}) response = get_response(url, { - :query => permitted_options(options), + :query => permitted_options(options), :basic_auth => basic_auth }) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 35e5c6b..b210488 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,5 @@ -require "codeclimate-test-reporter" -CodeClimate::TestReporter.start +require 'simplecov' +SimpleCov.start require 'rubygems' require 'bundler'