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

Set up and configure ngp_van gem #134

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

christopherstyles
Copy link

This update adds the ngp_van gem, and configures the app using an initializer. Sample environment configuration has been provided in the .env.sample.

The ngp_van gem is currently private until the general election, and in order to install it you will need to authenticate Bundler to GitHub using an oauth access token. Please contact a team member in Slack for the correct token to use.

Once you have the token, you can use bundler-config to configure the project locally:

bundle config --local GITHUB_OAUTH_TOKEN <token>:x-oauth-basic

Then bundle install.

Configure the following environment variables in .env [docs]:

NGP_VAN_APPLICATION_NAME="YourApplicationName"
NGP_VAN_API_KEY="ApiKey|Mode"

An NgpVan object will be available to interact with via the console:

% rails c
[1] pry(main)> NgpVan.district_fields
# => [
#      {"districtFieldId"=>1, "name"=>"State", "parentFieldId"=>nil...,
#      {"districtFieldId"=>2, "name"=>"County", "parentFieldId"=>1...
#    ]

API Methods can be called as module methods or as instance methods on the client.

[2] pry(main)> NgpVan.district_fields
# => [
#      {"districtFieldId"=>1, "name"=>"State", "parentFieldId"=>nil...},
#      {"districtFieldId"=>4, "name"=>"County", "parentFieldId"=>1...}
#    ]

or

[3] pry(main)> client = NpgVan.client
[4] pry(main)> client.district_fields
# => [
#      {"districtFieldId"=>1, "name"=>"State", "parentFieldId"=>nil...},
#      {"districtFieldId"=>4, "name"=>"County", "parentFieldId"=>1...}
#    ]

Resolves #126

@christopherstyles christopherstyles force-pushed the 126/set-up-and-configure-ngp-van branch 2 times, most recently from 179fc25 to 15d3ac0 Compare March 14, 2016 20:08
This update adds the `ngp_van` gem, and configures the app using an
initializer. Sample environment configuration has been provided in the
`.env.sample`.

The `ngp_van` gem is currently private until the general election, and
in order to install it you will need to authenticate Bundler to GitHub
using an oauth access token. Please contact a team member in Slack for
the correct token to use.

Once you have the token, you can use
[`bundler-config`](http://bundler.io/v1.11/man/bundle-config.1.html) to
configure the project locally:

    bundle config --local GITHUB_OAUTH_TOKEN <token>:x-oauth-basic

Then `bundle install`.

Configure the following environment variables in `.env`
[[docs](http://developers.everyaction.com/van-api#van-authentication)]:

```
NGP_VAN_APPLICATION_NAME="YourApplicationName"
NGP_VAN_API_KEY="ApiKey|Mode"
```

An `NgpVan` object will be available to interact with via the console:

```ruby
% rails c
[1] pry(main)> NgpVan.district_fields
```

API Methods can be called as module methods or as instance methods
on the client.

```ruby
[2] pry(main)> NgpVan.district_fields
```

or

```ruby
[3] pry(main)> client = NpgVan.client
[4] pry(main)> client.district_fields
```

Resolves Bernie-2016#126
@christopherstyles christopherstyles force-pushed the 126/set-up-and-configure-ngp-van branch from 15d3ac0 to bd05a43 Compare March 25, 2016 02:46
@christopherstyles christopherstyles changed the title Set up and configure ngp van Set up and configure ngp_van Mar 25, 2016
@christopherstyles christopherstyles changed the title Set up and configure ngp_van Set up and configure ngp_van gem Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant