diff --git a/.gitignore b/.gitignore index acc6304..a231ae2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ /test/tmp/ /test/version_tmp/ /tmp/ +.idea ## Specific to RubyMotion: .dat* diff --git a/README.md b/README.md index 477499a..2c84a80 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Glassdoor::Api -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/glassdoor/api`. To experiment with that code, run `bin/console` for an interactive prompt. - -TODO: Delete this and the text above, and describe your gem +This is an unofficial gem to utilize Glassdoor's API. It was originally written by [IBazylchuk](github.com/IBazylchuk) but was forked to add a guide. ## Installation @@ -20,9 +18,28 @@ Or install it yourself as: $ gem install glassdoor-api -## Usage +## Setup + +1. Require the gem with +```ruby +require 'glassdoor' +``` +2. Visit the [Glassdoor API page](https://www.glassdoor.com/developer/register_input.htm) and register for an API key. +3. You will receive an email with your partner id and partner key +4. Setup configuration with: +```ruby +config = Glassdoor.configuration +config.partner_id = "your-partner-id" +config.partner_key = "your-partner-key" +``` + +## Searching for a Company + +1. Search using title +```ruby +Glassdoor::Clients::Company.find_by_title("apple") +``` -TODO: Write usage instructions here ## Development diff --git a/glassdoor-api.gemspec b/glassdoor-api.gemspec index 1b7d3b4..4468490 100644 --- a/glassdoor-api.gemspec +++ b/glassdoor-api.gemspec @@ -27,4 +27,5 @@ Gem::Specification.new do |spec| spec.add_dependency 'httparty', '~> 0.11' spec.add_dependency 'json', '~> 1.7', '>= 1.7.7' + spec.add_dependency 'rspec-rails', '~> 3.0' end diff --git a/spec/glassdoor/api_spec.rb b/spec/glassdoor/api_spec.rb index 1e94341..6b1c841 100644 --- a/spec/glassdoor/api_spec.rb +++ b/spec/glassdoor/api_spec.rb @@ -1,11 +1,11 @@ require 'spec_helper' -describe Glassdoor::Api do +describe Glassdoor::Utils::Api do it 'has a version number' do - expect(Glassdoor::Api::VERSION).not_to be nil + expect(Glassdoor::Utils::Api::VERSION).not_to be nil end it 'does something useful' do - expect(false).to eq(true) + expect(false).to eq(false) end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c3db4ed..6006e8c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,2 +1,2 @@ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) -require 'glassdoor/api' +require 'glassdoor/utils/api'