get_your_rep 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c16d91fa3356cbf8023016ff512e0aa0eea194fd
4
- data.tar.gz: 3e55d1025abf18ba15c704484edec851bb57be41
3
+ metadata.gz: b04541a6dc52698adf6cf3c5845c14e8b4439a34
4
+ data.tar.gz: ba0d7bacbc3c874e75691498917b27a81b96a44e
5
5
  SHA512:
6
- metadata.gz: 0222b6b22f44fc6464544595dc25f171a858a0f4698eb3666b641b61d895b3bbd3c9aabf82cd5fcae3122784d833813736c15a4254af0056b24172fc1dc41ec4
7
- data.tar.gz: e6ea659e4bc3c1261885d74d83d40392bb91ab95b9416568c7e2faa117e07f6410feb297fef05f9d276bc04529c0e7b591b250179879a35a7c6cececb82f3d97
6
+ metadata.gz: 8bb41c03e7575fb1ee3511102f689efcc6ef55116164f75aea0cc548d41f7a563e1400365059ea66124a32bcc7caa4d13f2a6ef64211805048996428abdfe328
7
+ data.tar.gz: df25182496f23887dcb28cbca5a5bce5fef20589929709b0a754cb030c3e9345c09e1636c1ff841808c7204aa60d1aae9a1807db7d7563de31868a3dfcf05b9a
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Get yo' rep!
2
2
 
3
- This is the companion [gem](https://rubygems.org/gems/get_your_rep) for the [Phone Your Rep API] (https://github.com/thecristen/phone-your-rep-api)
3
+ This is the companion [gem](https://rubygems.org/gems/get_your_rep) for the [Phone Your Rep API] (https://github.com/msimonborg/phone-your-rep-api)
4
4
 
5
5
  This gem sends requests to the Google Civic Information API and the OpenStates.org API for info on your representatives and parses the JSON responses into Ruby objects.
6
6
 
@@ -27,8 +27,9 @@ Add this line to your ~/.bashrc or ~/.bash_profile
27
27
 
28
28
  ## Usage
29
29
 
30
+ Execute `reps` from the command line for a Command Line Interface.
30
31
 
31
- Send queries like this `reps = GetYourRep.all_reps(address)` to gather a Delegation of Representatives. This will get federal legislators from Google and state legislators form OpenStates.org
32
+ In your app, send queries like this `reps = GetYourRep.all_reps(address)` to gather a Delegation of Representatives. This will get federal legislators from Google and state legislators form OpenStates.org
32
33
 
33
34
  `address` is your address. You can use just a zip code, but use a full address for the best results. Don't worry about commas, spaces, character case, or `.`s (`"123 1/2 main St., anywhere CA 12345"` is A-OK)
34
35
 
@@ -40,7 +41,7 @@ You can iterate over a Delegation's reps like so: `delegetion.reps.each { |rep|
40
41
 
41
42
  There is also a shortcut for that: `delegation.each { |rep| rep.name }`.
42
43
 
43
- There is also a shortcut for that: `delegation.names`. Also works with `#first_names`, `#last_names`, and `#office_locations`.
44
+ There's a shortcut for that, too: `delegation.names`. Also works with `#first_names`, `#last_names`, and `#office_locations`.
44
45
 
45
46
  Get Federal and State executives and legislators with `GetYourRep::Google.all_reps(address)`.
46
47
 
@@ -50,7 +51,7 @@ Get state legislators only with `GetYourRep::OpenStates.all_reps(address)`.
50
51
 
51
52
  ## Development
52
53
 
53
- After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Add `export GOOGLE_API_KEY="<YOUR_API_KEY>"` to your `.bashrc` or `.bash_profile` and then `bundle exec rake_test`.
54
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Add `export GOOGLE_API_KEY="<YOUR_API_KEY>"` to your `.bashrc` or `.bash_profile` and then `bundle exec rake test`.
54
55
 
55
56
  ## Contributing
56
57
 
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/testtask'
6
6
  Rake::TestTask.new do |t|
7
7
  t.libs << 'test'
8
8
  t.test_files = FileList['test/**/*test.rb']
9
- t.verbose = true
9
+ t.verbose = false
10
10
  end
11
11
 
12
12
  task default: :test
@@ -7,6 +7,8 @@ module GetYourRep
7
7
  # Taken with gratitude from davidbella https://gist.github.com/davidbella/6918455
8
8
  def initialize(options = {})
9
9
  options.each do |attr, value|
10
+ # Recent responses from OpenStates have had '+' appended to some keys. Trim that off or it throws an error.
11
+ attr = attr.gsub('+', '')
10
12
  create_setters_from_opts(attr)
11
13
  create_getters_from_opts(attr)
12
14
  add_value_to_attr(attr, value)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GetYourRep
3
- VERSION = '1.0.5' # :nodoc:
3
+ VERSION = '1.0.6' # :nodoc:
4
4
  end
data/spec.md ADDED
@@ -0,0 +1,7 @@
1
+ # Specifications for the CLI Assessment
2
+
3
+ Specs:
4
+ - [x] Have a CLI for interfacing with the application # Can call `reps` from the command line to explore the CLI.
5
+ - [x] Pull data from an external source # Uses HTTParty to parse JSON responses from two API sources.
6
+ - [x] Implement both list and detail views # Reps are displayed in the CLI in a numbered list, and detail can be viewed by typing the corresponding number.
7
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: get_your_rep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - msimonborg
@@ -161,6 +161,7 @@ files:
161
161
  - lib/get_your_rep/responses/open_states_office.rb
162
162
  - lib/get_your_rep/responses/open_states_rep.rb
163
163
  - lib/get_your_rep/version.rb
164
+ - spec.md
164
165
  homepage: https://github.com/msimonborg/get-your-rep
165
166
  licenses:
166
167
  - MIT