govkit 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +3 -3
- data/VERSION +1 -1
- data/govkit.gemspec +4 -2
- data/lib/generators/govkit/govkit_generator.rb +17 -0
- data/lib/generators/govkit/templates/govkit.rb +19 -0
- metadata +5 -3
data/README.markdown
CHANGED
@@ -17,12 +17,12 @@ From gemcutter:
|
|
17
17
|
|
18
18
|
Add govkit to your environment.rb or Gemfile
|
19
19
|
|
20
|
-
Run <code
|
20
|
+
Run <code>rails generate govkit</code> to copy a config file into <code>config/initializers/govkit.rb</code>. You will need to add your API keys to this config file.
|
21
21
|
|
22
22
|
# Examples
|
23
23
|
|
24
|
-
>>
|
25
|
-
>>
|
24
|
+
>> GovKit::OpenStates::State.find_by_abbreviation('CA')
|
25
|
+
>> GovKit::VoteSmart::Address.find(votesmart_candidate_id)
|
26
26
|
>> GovKit::OpenCongress::Bill.find(:number => 5479, :type => 'h', :congress => '111')
|
27
27
|
|
28
28
|
# Bugs? Questions?
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/govkit.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{govkit}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Participatory Politics Foundation", "Srinivas Aki", "Carl Tashian"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-11}
|
13
13
|
s.description = %q{Govkit lets you quickly get encapsulated Ruby objects for common open government APIs. We're starting with Sunlight's Open States API and the Project Vote Smart API.}
|
14
14
|
s.email = %q{carl@ppolitics.org}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -28,6 +28,8 @@ Gem::Specification.new do |s|
|
|
28
28
|
"generators/govkit/templates/govkit.rb",
|
29
29
|
"govkit.gemspec",
|
30
30
|
"init.rb",
|
31
|
+
"lib/generators/govkit/govkit_generator.rb",
|
32
|
+
"lib/generators/govkit/templates/govkit.rb",
|
31
33
|
"lib/gov_kit.rb",
|
32
34
|
"lib/gov_kit/acts_as_citeable.rb",
|
33
35
|
"lib/gov_kit/configuration.rb",
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
class GovkitGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
def initialize(*runtime_args)
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Copies a config initializer to config/initializers/govkit.rb"
|
10
|
+
|
11
|
+
source_root File.join(File.dirname(__FILE__), 'templates')
|
12
|
+
|
13
|
+
def copy_initializer_file
|
14
|
+
copy_file 'govkit.rb', File.join('config', 'initializers', 'govkit.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
if defined? GovKit
|
2
|
+
GovKit.configure do |config|
|
3
|
+
# Get an API key for Sunlight's Open States project here:
|
4
|
+
# http://services.sunlightlabs.com/accounts/register/
|
5
|
+
config.openstates_apikey = 'YOUR_OPENSTATES_API_KEY'
|
6
|
+
|
7
|
+
##API key for Votesmart
|
8
|
+
# http://votesmart.org/services_api.php
|
9
|
+
config.votesmart_apikey = 'YOUR_VOTESMART_API_KEY'
|
10
|
+
|
11
|
+
# API key for NIMSP. Request one here:
|
12
|
+
# http://www.followthemoney.org/membership/settings.phtml
|
13
|
+
config.ftm_apikey = 'YOUR_FTM_API_KEY'
|
14
|
+
|
15
|
+
# Api key for OpenCongress
|
16
|
+
# http://www.opencongress.org/api
|
17
|
+
config.opencongress_apikey = 'YOUR_OPENCONGRESS_API_KEY'
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Participatory Politics Foundation
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-09-
|
19
|
+
date: 2010-09-11 00:00:00 -07:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -85,6 +85,8 @@ files:
|
|
85
85
|
- generators/govkit/templates/govkit.rb
|
86
86
|
- govkit.gemspec
|
87
87
|
- init.rb
|
88
|
+
- lib/generators/govkit/govkit_generator.rb
|
89
|
+
- lib/generators/govkit/templates/govkit.rb
|
88
90
|
- lib/gov_kit.rb
|
89
91
|
- lib/gov_kit/acts_as_citeable.rb
|
90
92
|
- lib/gov_kit/configuration.rb
|