Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds application time options to PERMITTED_OPTIONS #29

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT

sudo: false
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 9 additions & 2 deletions lib/greenhouse_io/api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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
})

Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
require 'simplecov'
SimpleCov.start

require 'rubygems'
require 'bundler'
Expand Down