votesmart 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +16 -0
- data/Rakefile +21 -28
- data/VERSION.yml +2 -2
- data/lib/vote_smart.rb +0 -2
- data/lib/vote_smart/office.rb +2 -2
- data/lib/vote_smart/official.rb +1 -1
- data/spec/spec_helper.rb +1 -2
- data/spec/vote_smart/district_spec.rb +1 -1
- data/spec/vote_smart/office/type_spec.rb +49 -0
- data/spec/vote_smart/office_spec.rb +1 -47
- data/spec/vote_smart/official_spec.rb +4 -1
- data/spec/vote_smart/rating_spec.rb +3 -3
- data/spec/vote_smart/state_spec.rb +1 -1
- data/votesmart.gemspec +93 -88
- metadata +97 -59
- data/lib/mcll4r/MIT-LICENSE +0 -20
- data/lib/mcll4r/README +0 -19
- data/lib/mcll4r/mcll4r.rb +0 -24
- data/lib/mcll4r/mcll4r_test.rb +0 -35
data/Gemfile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
source "http://www.rubygems.org"
|
2
|
+
|
3
|
+
gem 'patron', '>=0.4.6'
|
4
|
+
|
5
|
+
# Add dependencies to develop your gem here.
|
6
|
+
# Include everything needed to run rake, tests, features, etc.
|
7
|
+
group :development do
|
8
|
+
gem "rspec", "< 2"
|
9
|
+
gem "rdoc", "~> 3.12"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.8.3"
|
12
|
+
|
13
|
+
# optional runtime dependencies, required for tests
|
14
|
+
gem 'ym4r'
|
15
|
+
gem 'mcll4r'
|
16
|
+
end
|
data/Rakefile
CHANGED
@@ -1,41 +1,34 @@
|
|
1
1
|
%w[rubygems rake rake/clean fileutils].each { |f| require f }
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
s.authors = ["Dan Cunning", "Ben Woosley"]
|
12
|
-
s.add_dependency 'patron', '>=0.4.6'
|
13
|
-
end
|
14
|
-
Jeweler::GemcutterTasks.new
|
15
|
-
rescue LoadError
|
16
|
-
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
3
|
+
require 'jeweler'
|
4
|
+
Jeweler::Tasks.new do |s|
|
5
|
+
s.name = "votesmart"
|
6
|
+
s.summary = "A wrapper for the Project Vote Smart API"
|
7
|
+
s.email = "ben.woosley@gmail.com"
|
8
|
+
s.homepage = "http://github.com/Empact/votesmart"
|
9
|
+
s.description = "A wrapper for the Project Vote Smart API"
|
10
|
+
s.authors = ["Dan Cunning", "Ben Woosley"]
|
17
11
|
end
|
12
|
+
Jeweler::GemcutterTasks.new
|
18
13
|
|
19
14
|
Dir['tasks/**/*.rake'].each { |t| load t }
|
20
15
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
#
|
27
|
-
# Spec::Rake::SpecTask.new(:rcov) do |spec|
|
28
|
-
# spec.libs << 'lib' << 'spec'
|
29
|
-
# spec.pattern = 'spec/**/*_spec.rb'
|
30
|
-
# spec.rcov = true
|
31
|
-
# end
|
16
|
+
require 'spec/rake/spectask'
|
17
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
18
|
+
spec.libs << 'lib' << 'spec'
|
19
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
20
|
+
end
|
32
21
|
|
33
|
-
|
22
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
23
|
+
spec.libs << 'lib' << 'spec'
|
24
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
25
|
+
spec.rcov = true
|
26
|
+
end
|
34
27
|
|
35
28
|
task :default => :spec
|
36
29
|
|
37
|
-
require '
|
38
|
-
|
30
|
+
require 'rdoc/task'
|
31
|
+
RDoc::Task.new do |rdoc|
|
39
32
|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
40
33
|
|
41
34
|
rdoc.rdoc_dir = 'rdoc'
|
data/VERSION.yml
CHANGED
data/lib/vote_smart.rb
CHANGED
data/lib/vote_smart/office.rb
CHANGED
@@ -67,7 +67,7 @@ module VoteSmart
|
|
67
67
|
|
68
68
|
# Returns a list of offices by office type
|
69
69
|
def self.get_offices_by_type type_id
|
70
|
-
request("Office.getOfficesByType", "
|
70
|
+
request("Office.getOfficesByType", "officeTypeId" => type_id)
|
71
71
|
end
|
72
72
|
|
73
73
|
# Returns a list of offices by level of government
|
@@ -77,7 +77,7 @@ module VoteSmart
|
|
77
77
|
|
78
78
|
# Returns a list of offices by office type and level of government
|
79
79
|
def self.get_offices_by_type_level type_id, level_id
|
80
|
-
request("Office.
|
80
|
+
request("Office.getOfficesByTypeLevel", "levelId" => level_id, "officeTypeId" => type_id)
|
81
81
|
end
|
82
82
|
|
83
83
|
# Returns a list of offices by branch and level of government
|
data/lib/vote_smart/official.rb
CHANGED
@@ -60,7 +60,7 @@ module VoteSmart
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def self.find_all_by_state_and_latitude_and_longitude state, latitude, longitude
|
63
|
-
require "
|
63
|
+
require "mcll4r"
|
64
64
|
|
65
65
|
response = Mcll4r.new.district_lookup(latitude, longitude)
|
66
66
|
response = response["response"] if response
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'stringio'
|
3
2
|
require 'spec'
|
4
3
|
require "votesmart"
|
@@ -33,7 +32,7 @@ class Spec::Example::ExampleGroup
|
|
33
32
|
VoteSmart::State,
|
34
33
|
VoteSmart::Vote].each do |klazz|
|
35
34
|
|
36
|
-
request_methods = klazz.methods.collect { |method| method if method.
|
35
|
+
request_methods = klazz.methods.collect { |method| method if method.to_s.start_with?("get_") }.compact
|
37
36
|
|
38
37
|
request_methods.each do |request_method|
|
39
38
|
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module VoteSmart
|
4
|
+
describe Office::Type do
|
5
|
+
|
6
|
+
describe "all" do
|
7
|
+
|
8
|
+
def do_find
|
9
|
+
Office::Type.all
|
10
|
+
end
|
11
|
+
|
12
|
+
it_should_find :count => 10, :first => {:name => "Presidential and Cabinet", :id => "P"},
|
13
|
+
:last => {:name => "Local Executive", :id => "M"}
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "find_by_name" do
|
18
|
+
|
19
|
+
def do_find
|
20
|
+
Office::Type.find_by_name("State Legislature")
|
21
|
+
end
|
22
|
+
|
23
|
+
it_should_find :item => {:name => "State Legislature", :id => "L"}
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
describe "offices" do
|
28
|
+
|
29
|
+
def do_find
|
30
|
+
Office::Type.find_by_name("Presidential and Cabinet").offices
|
31
|
+
end
|
32
|
+
|
33
|
+
it_should_find :count => 17, :first => {:name => "President", :id => "1"},
|
34
|
+
:last => {:name => "Vice President", :id => "2"}
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
describe "offices_by_name" do
|
39
|
+
|
40
|
+
def do_find
|
41
|
+
Office::Type.find_by_name("Presidential and Cabinet").offices_by_name(["President", "Vice President"])
|
42
|
+
end
|
43
|
+
|
44
|
+
it_should_find :count => 2, :first => {:name => "President", :id => "1"},
|
45
|
+
:last => {:name => "Vice President", :id => "2"}
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
module VoteSmart
|
4
4
|
describe Office do
|
@@ -47,50 +47,4 @@ module VoteSmart
|
|
47
47
|
end
|
48
48
|
|
49
49
|
end
|
50
|
-
|
51
|
-
describe Office::Type do
|
52
|
-
|
53
|
-
describe "all" do
|
54
|
-
|
55
|
-
def do_find
|
56
|
-
Office::Type.all
|
57
|
-
end
|
58
|
-
|
59
|
-
it_should_find :count => 10, :first => {:name => "Presidential and Cabinet", :id => "P"},
|
60
|
-
:last => {:name => "Local Executive", :id => "M"}
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
describe "find_by_name" do
|
65
|
-
|
66
|
-
def do_find
|
67
|
-
Office::Type.find_by_name("State Legislature")
|
68
|
-
end
|
69
|
-
|
70
|
-
it_should_find :item => {:name => "State Legislature", :id => "L"}
|
71
|
-
|
72
|
-
end
|
73
|
-
|
74
|
-
describe "offices" do
|
75
|
-
|
76
|
-
def do_find
|
77
|
-
Office::Type.find_by_name("Presidential and Cabinet").offices
|
78
|
-
end
|
79
|
-
|
80
|
-
it_should_find :count => 17, :first => {:name => "President", :id => "1"},
|
81
|
-
:last => {:name => "Vice President", :id => "2"}
|
82
|
-
|
83
|
-
end
|
84
|
-
|
85
|
-
describe "offices_by_name" do
|
86
|
-
|
87
|
-
def do_find
|
88
|
-
Office::Type.find_by_name("Presidential and Cabinet").offices_by_name(["President", "Vice President"])
|
89
|
-
end
|
90
|
-
|
91
|
-
it_should_find :count => 2, :first => {:name => "President", :id => "1"},
|
92
|
-
:last => {:name => "Vice President", :id => "2"}
|
93
|
-
|
94
|
-
end
|
95
|
-
end
|
96
50
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
module VoteSmart
|
4
4
|
describe Official do
|
@@ -40,6 +40,9 @@ module VoteSmart
|
|
40
40
|
|
41
41
|
describe "find by address" do
|
42
42
|
before :each do
|
43
|
+
require 'mcll4r'
|
44
|
+
require 'ym4r/google_maps/geocoding'
|
45
|
+
|
43
46
|
mcll4r = {"response" => {"state_lower" => {"district" => "1"}, "state_upper" => {"district" => "2"}}}
|
44
47
|
Ym4r::GoogleMaps::Geocoding.should_receive(:get).once.and_return([mock("placemark", :latitude => 2, :longitude => 10)])
|
45
48
|
Mcll4r.should_receive(:new).once.and_return(mock("mcll4r", :district_lookup => mcll4r))
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require 'spec_helper'
|
2
2
|
|
3
3
|
describe VoteSmart::Rating do
|
4
4
|
describe ".get_sig" do
|
@@ -8,8 +8,8 @@ describe VoteSmart::Rating do
|
|
8
8
|
|
9
9
|
it "shouldn't have a quoted description" do
|
10
10
|
description = VoteSmart::Rating.get_sig('1863')['sig']['description']
|
11
|
-
description.
|
12
|
-
description.
|
11
|
+
description[0].should_not == '"'
|
12
|
+
description[-1].should_not == '"'
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
data/votesmart.gemspec
CHANGED
@@ -1,116 +1,121 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.
|
7
|
+
s.name = "votesmart"
|
8
|
+
s.version = "0.4.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dan Cunning", "Ben Woosley"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
12
|
+
s.date = "2012-03-26"
|
13
|
+
s.description = "A wrapper for the Project Vote Smart API"
|
14
|
+
s.email = "ben.woosley@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"README.rdoc"
|
17
17
|
]
|
18
18
|
s.files = [
|
19
|
-
"
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
"spec/responses/Rating.get_sig.1863.js",
|
77
|
-
"spec/responses/State.get_state.GA.js",
|
78
|
-
"spec/responses/State.get_state_ids.js",
|
79
|
-
"spec/responses/authorization_failed.js",
|
80
|
-
"spec/spec_helper.rb",
|
81
|
-
"spec/vote_smart/district_spec.rb",
|
82
|
-
"spec/vote_smart/office_spec.rb",
|
83
|
-
"spec/vote_smart/official_spec.rb",
|
84
|
-
"spec/vote_smart/rating_spec.rb",
|
85
|
-
"spec/vote_smart/state_spec.rb",
|
86
|
-
"tasks/spec_json.rake",
|
87
|
-
"votesmart.gemspec"
|
88
|
-
]
|
89
|
-
s.homepage = %q{http://github.com/Empact/votesmart}
|
90
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
91
|
-
s.require_paths = ["lib"]
|
92
|
-
s.rubygems_version = %q{1.3.7}
|
93
|
-
s.summary = %q{A wrapper for the Project Vote Smart API}
|
94
|
-
s.test_files = [
|
19
|
+
"Gemfile",
|
20
|
+
"History.txt",
|
21
|
+
"README.rdoc",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION.yml",
|
24
|
+
"lib/vote_smart.rb",
|
25
|
+
"lib/vote_smart/address.rb",
|
26
|
+
"lib/vote_smart/candidate.rb",
|
27
|
+
"lib/vote_smart/candidate_bio.rb",
|
28
|
+
"lib/vote_smart/candidate_office.rb",
|
29
|
+
"lib/vote_smart/committee.rb",
|
30
|
+
"lib/vote_smart/common.rb",
|
31
|
+
"lib/vote_smart/district.rb",
|
32
|
+
"lib/vote_smart/election.rb",
|
33
|
+
"lib/vote_smart/leadership.rb",
|
34
|
+
"lib/vote_smart/local.rb",
|
35
|
+
"lib/vote_smart/measure.rb",
|
36
|
+
"lib/vote_smart/notes.rb",
|
37
|
+
"lib/vote_smart/npat.rb",
|
38
|
+
"lib/vote_smart/office.rb",
|
39
|
+
"lib/vote_smart/official.rb",
|
40
|
+
"lib/vote_smart/phone.rb",
|
41
|
+
"lib/vote_smart/rating.rb",
|
42
|
+
"lib/vote_smart/state.rb",
|
43
|
+
"lib/vote_smart/vote.rb",
|
44
|
+
"lib/votesmart.rb",
|
45
|
+
"script/autospec",
|
46
|
+
"script/console",
|
47
|
+
"script/destroy",
|
48
|
+
"script/generate",
|
49
|
+
"script/is_gem_built",
|
50
|
+
"spec/responses/Address.get_office.106446.js",
|
51
|
+
"spec/responses/Address.get_office.1721.js",
|
52
|
+
"spec/responses/District.get_by_office_state.7.GA.js",
|
53
|
+
"spec/responses/District.get_by_office_state.8.GA.js",
|
54
|
+
"spec/responses/District.get_by_office_state.9.GA.js",
|
55
|
+
"spec/responses/Office.get_offices_by_type.C.js",
|
56
|
+
"spec/responses/Office.get_offices_by_type.L.js",
|
57
|
+
"spec/responses/Office.get_offices_by_type.P.js",
|
58
|
+
"spec/responses/Office.get_offices_by_type.S.js",
|
59
|
+
"spec/responses/Office.get_types.js",
|
60
|
+
"spec/responses/Official.get_by_district.20451.js",
|
61
|
+
"spec/responses/Official.get_by_district.20689.js",
|
62
|
+
"spec/responses/Official.get_by_district.21397.js",
|
63
|
+
"spec/responses/Official.get_by_district.21946.js",
|
64
|
+
"spec/responses/Official.get_by_office_state.12.CO.js",
|
65
|
+
"spec/responses/Official.get_by_office_state.12.GA.js",
|
66
|
+
"spec/responses/Official.get_by_office_state.13.GA.js",
|
67
|
+
"spec/responses/Official.get_by_office_state.33.GA.js",
|
68
|
+
"spec/responses/Official.get_by_office_state.42.GA.js",
|
69
|
+
"spec/responses/Official.get_by_office_state.44.GA.js",
|
70
|
+
"spec/responses/Official.get_by_office_state.45.GA.js",
|
71
|
+
"spec/responses/Official.get_by_office_state.53.GA.js",
|
72
|
+
"spec/responses/Rating.get_sig.1863.js",
|
73
|
+
"spec/responses/State.get_state.GA.js",
|
74
|
+
"spec/responses/State.get_state_ids.js",
|
75
|
+
"spec/responses/authorization_failed.js",
|
95
76
|
"spec/spec_helper.rb",
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
77
|
+
"spec/vote_smart/district_spec.rb",
|
78
|
+
"spec/vote_smart/office/type_spec.rb",
|
79
|
+
"spec/vote_smart/office_spec.rb",
|
80
|
+
"spec/vote_smart/official_spec.rb",
|
81
|
+
"spec/vote_smart/rating_spec.rb",
|
82
|
+
"spec/vote_smart/state_spec.rb",
|
83
|
+
"tasks/spec_json.rake",
|
84
|
+
"votesmart.gemspec"
|
101
85
|
]
|
86
|
+
s.homepage = "http://github.com/Empact/votesmart"
|
87
|
+
s.require_paths = ["lib"]
|
88
|
+
s.rubygems_version = "1.8.11"
|
89
|
+
s.summary = "A wrapper for the Project Vote Smart API"
|
102
90
|
|
103
91
|
if s.respond_to? :specification_version then
|
104
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
105
92
|
s.specification_version = 3
|
106
93
|
|
107
94
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
108
95
|
s.add_runtime_dependency(%q<patron>, [">= 0.4.6"])
|
96
|
+
s.add_development_dependency(%q<rspec>, ["< 2"])
|
97
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
98
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
99
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
|
100
|
+
s.add_development_dependency(%q<ym4r>, [">= 0"])
|
101
|
+
s.add_development_dependency(%q<mcll4r>, [">= 0"])
|
109
102
|
else
|
110
103
|
s.add_dependency(%q<patron>, [">= 0.4.6"])
|
104
|
+
s.add_dependency(%q<rspec>, ["< 2"])
|
105
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
106
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
107
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
108
|
+
s.add_dependency(%q<ym4r>, [">= 0"])
|
109
|
+
s.add_dependency(%q<mcll4r>, [">= 0"])
|
111
110
|
end
|
112
111
|
else
|
113
112
|
s.add_dependency(%q<patron>, [">= 0.4.6"])
|
113
|
+
s.add_dependency(%q<rspec>, ["< 2"])
|
114
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
115
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
116
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
|
117
|
+
s.add_dependency(%q<ym4r>, [">= 0"])
|
118
|
+
s.add_dependency(%q<mcll4r>, [">= 0"])
|
114
119
|
end
|
115
120
|
end
|
116
121
|
|
metadata
CHANGED
@@ -1,55 +1,106 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: votesmart
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 4
|
8
|
-
- 0
|
9
|
-
version: 0.4.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.4.1
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Dan Cunning
|
13
9
|
- Ben Woosley
|
14
10
|
autorequire:
|
15
11
|
bindir: bin
|
16
12
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2012-03-26 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
22
16
|
name: patron
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &70197171183860 !ruby/object:Gem::Requirement
|
25
18
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 4
|
32
|
-
- 6
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
33
22
|
version: 0.4.6
|
34
23
|
type: :runtime
|
35
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *70197171183860
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rspec
|
28
|
+
requirement: &70197171183360 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - <
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *70197171183360
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rdoc
|
39
|
+
requirement: &70197171182860 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '3.12'
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *70197171182860
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: bundler
|
50
|
+
requirement: &70197171182340 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ~>
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.0.0
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *70197171182340
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: jeweler
|
61
|
+
requirement: &70197171181840 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ~>
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 1.8.3
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *70197171181840
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: ym4r
|
72
|
+
requirement: &70197171181320 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *70197171181320
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: mcll4r
|
83
|
+
requirement: &70197171180800 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *70197171180800
|
36
92
|
description: A wrapper for the Project Vote Smart API
|
37
93
|
email: ben.woosley@gmail.com
|
38
94
|
executables: []
|
39
|
-
|
40
95
|
extensions: []
|
41
|
-
|
42
|
-
extra_rdoc_files:
|
96
|
+
extra_rdoc_files:
|
43
97
|
- README.rdoc
|
44
|
-
files:
|
98
|
+
files:
|
99
|
+
- Gemfile
|
45
100
|
- History.txt
|
46
101
|
- README.rdoc
|
47
102
|
- Rakefile
|
48
103
|
- VERSION.yml
|
49
|
-
- lib/mcll4r/MIT-LICENSE
|
50
|
-
- lib/mcll4r/README
|
51
|
-
- lib/mcll4r/mcll4r.rb
|
52
|
-
- lib/mcll4r/mcll4r_test.rb
|
53
104
|
- lib/vote_smart.rb
|
54
105
|
- lib/vote_smart/address.rb
|
55
106
|
- lib/vote_smart/candidate.rb
|
@@ -104,48 +155,35 @@ files:
|
|
104
155
|
- spec/responses/authorization_failed.js
|
105
156
|
- spec/spec_helper.rb
|
106
157
|
- spec/vote_smart/district_spec.rb
|
158
|
+
- spec/vote_smart/office/type_spec.rb
|
107
159
|
- spec/vote_smart/office_spec.rb
|
108
160
|
- spec/vote_smart/official_spec.rb
|
109
161
|
- spec/vote_smart/rating_spec.rb
|
110
162
|
- spec/vote_smart/state_spec.rb
|
111
163
|
- tasks/spec_json.rake
|
112
164
|
- votesmart.gemspec
|
113
|
-
has_rdoc: true
|
114
165
|
homepage: http://github.com/Empact/votesmart
|
115
166
|
licenses: []
|
116
|
-
|
117
167
|
post_install_message:
|
118
168
|
rdoc_options: []
|
119
|
-
|
120
|
-
require_paths:
|
169
|
+
require_paths:
|
121
170
|
- lib
|
122
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
171
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
172
|
none: false
|
124
|
-
requirements:
|
125
|
-
- -
|
126
|
-
- !ruby/object:Gem::Version
|
127
|
-
|
128
|
-
|
129
|
-
version: "0"
|
130
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
|
+
requirements:
|
174
|
+
- - ! '>='
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '0'
|
177
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
178
|
none: false
|
132
|
-
requirements:
|
133
|
-
- -
|
134
|
-
- !ruby/object:Gem::Version
|
135
|
-
|
136
|
-
- 0
|
137
|
-
version: "0"
|
179
|
+
requirements:
|
180
|
+
- - ! '>='
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '0'
|
138
183
|
requirements: []
|
139
|
-
|
140
184
|
rubyforge_project:
|
141
|
-
rubygems_version: 1.
|
185
|
+
rubygems_version: 1.8.11
|
142
186
|
signing_key:
|
143
187
|
specification_version: 3
|
144
188
|
summary: A wrapper for the Project Vote Smart API
|
145
|
-
test_files:
|
146
|
-
- spec/spec_helper.rb
|
147
|
-
- spec/vote_smart/district_spec.rb
|
148
|
-
- spec/vote_smart/office_spec.rb
|
149
|
-
- spec/vote_smart/official_spec.rb
|
150
|
-
- spec/vote_smart/rating_spec.rb
|
151
|
-
- spec/vote_smart/state_spec.rb
|
189
|
+
test_files: []
|
data/lib/mcll4r/MIT-LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2008 Mobile Commons
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
17
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
18
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
19
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/mcll4r/README
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
=== mcll4r
|
2
|
-
|
3
|
-
- [Code on GitHub](http://github.com/mcommons/mcll4r)
|
4
|
-
|
5
|
-
=== Description
|
6
|
-
|
7
|
-
Ruby client for Mobile Commons Legislative Lookup API
|
8
|
-
|
9
|
-
Based on the API described at http://congress.mcommons.com
|
10
|
-
|
11
|
-
|
12
|
-
=== Authors
|
13
|
-
|
14
|
-
- Maintained by [Benjamin Stein](mailto:ben@mcommons.com), [Mal McKay](mailto:mal@mcommons.com) & [Nathan Woodhull](mailto:nathan@mcommons.com)
|
15
|
-
|
16
|
-
=== License
|
17
|
-
|
18
|
-
Copyright (c) 2008 Mobile Commons
|
19
|
-
See MIT-LICENSE in this directory.
|
data/lib/mcll4r/mcll4r.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'httparty'
|
3
|
-
|
4
|
-
class Mcll4r
|
5
|
-
include HTTParty
|
6
|
-
base_uri "http://congress.mcommons.com"
|
7
|
-
format :xml
|
8
|
-
|
9
|
-
def district_lookup(lat, lng)
|
10
|
-
filter_for_errors self.class.get("/districts/lookup.xml", :query=>{:lat=>lat, :lng=>lng})
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def filter_for_errors(hash)
|
16
|
-
if hash['response']['error']
|
17
|
-
raise DistrictNotFound.new(hash['response']['error'])
|
18
|
-
end
|
19
|
-
hash
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
class DistrictNotFound < Exception; end
|
data/lib/mcll4r/mcll4r_test.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'mcll4r'
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
class Mcll4rTest < Test::Unit::TestCase
|
5
|
-
|
6
|
-
def setup
|
7
|
-
@mcll4r = Mcll4r.new
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_assert_we_get_back_correct_district_data
|
11
|
-
expected = {
|
12
|
-
"response" => {
|
13
|
-
"state_upper" => { "district" => "029", "display_name" => "TX 29th", "state" => "TX" },
|
14
|
-
"federal" => { "district" => "16", "display_name" => "TX 16th", "state" => "TX" },
|
15
|
-
"state_lower" => { "district" => "077", "display_name" => "TX 77th", "state" => "TX" },
|
16
|
-
"lng" => "-106.490969",
|
17
|
-
"lat" => "31.76321"
|
18
|
-
}
|
19
|
-
}
|
20
|
-
assert_equal expected, @mcll4r.district_lookup(31.76321, -106.490969)
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_assert_raise_on_error
|
24
|
-
assert_raise DistrictNotFound do
|
25
|
-
@mcll4r.district_lookup(nil,nil)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_assert_raise_on_district_not_found
|
30
|
-
assert_raise DistrictNotFound do
|
31
|
-
@mcll4r.district_lookup( 1.0, 1.0 )
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|