votesmart 0.3.0 → 0.3.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.
@@ -1,3 +1,9 @@
1
+ == 0.3.1 2010-06-19
2
+
3
+ * 2 major enhancements:
4
+ * Add Candidate.get_by_zip, District.get_by_zip, Election.get_by_zip and Official.get_by_zip (dwillis)
5
+ * Add Official.get_statewide (empact)
6
+
1
7
  == 0.3.0 2010-03-25
2
8
 
3
9
  * 3 major enhancement:
@@ -1,4 +1,5 @@
1
1
  ---
2
+ :patch: 1
3
+ :build:
2
4
  :major: 0
3
5
  :minor: 3
4
- :patch: 0
@@ -26,7 +26,10 @@ module VoteSmart
26
26
  def self.get_by_district district_id, election_year = nil
27
27
  request("Candidates.getByDistrict", "districtId" => district_id, "electionYear" => election_year)
28
28
  end
29
-
29
+
30
+ # Returns candidates in the provided zip code, with optional zip+4 and stage
31
+ def self.get_by_zip zip5, election_year=nil, zip4=nil, stage_id=nil
32
+ request("Candidates.getByZip", "zip5" => zip5, "electionYear" => election_year, "zip4" => zip4, "stageId" => stage_id)
33
+ end
30
34
  end
31
-
32
35
  end
@@ -33,6 +33,10 @@ module VoteSmart
33
33
  def self.get_by_office_state office_id, state_id = 'NA', district_name = ''
34
34
  request("District.getByOfficeState", "officeId" => office_id, "stateId" => state_id, "districtName" => district_name)
35
35
  end
36
-
36
+
37
+ # Returns districts in the provided zip code, with optional zip+4
38
+ def self.get_by_zip zip5, zip4=nil
39
+ request("District.getByZip", "zip5" => zip5, "zip4" => zip4)
40
+ end
37
41
  end
38
42
  end
@@ -17,5 +17,9 @@ module VoteSmart
17
17
  request("Election.getStageCandidates", "electionId" => election_id, "stageId" => stage_id, "party" => party)
18
18
  end
19
19
 
20
+ # Returns elections in the provided zip code, with optional zip+4 and election_year
21
+ def self.get_by_zip zip5, zip4=nil, election_year=nil
22
+ request("Election.getElectionByZip", "zip5" => zip5, "zip4" => zip4, "year" => election_year)
23
+ end
20
24
  end
21
25
  end
@@ -47,8 +47,6 @@ module VoteSmart
47
47
  official
48
48
  end
49
49
 
50
-
51
-
52
50
  def self.find_all_by_address address, city, state, zip
53
51
  placemark = Geocoding.get("#{address} #{city}, #{state} #{zip}").first
54
52
 
@@ -101,6 +99,9 @@ module VoteSmart
101
99
  officials
102
100
  end
103
101
 
102
+ def self.get_statewide(state_id = 'NA')
103
+ request("Officials.getStatewide", "stateId" => state_id)
104
+ end
104
105
 
105
106
  # Returns a list of incumbents that fit the criteria
106
107
  def self.get_by_office_state office_id, state_id = 'NA'
@@ -126,6 +127,10 @@ module VoteSmart
126
127
  def self.get_by_district district_id
127
128
  request("Officials.getByDistrict", "districtId" => district_id)
128
129
  end
129
-
130
+
131
+ # Returns incumbents in the provided zip code, with optional zip+4 and stage
132
+ def self.get_by_zip zip5, election_year=nil, zip4=nil, stage_id=nil
133
+ request("Officials.getByZip", "zip5" => zip5, "electionYear" => election_year, "zip4" => zip4, "stageId" => stage_id)
134
+ end
130
135
  end
131
136
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{votesmart}
8
- s.version = "0.3.0"
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 = ["Dan Cunning", "Ben Woosley"]
12
- s.date = %q{2010-03-25}
12
+ s.date = %q{2010-06-19}
13
13
  s.description = %q{A wrapper for the Project Vote Smart API}
14
14
  s.email = %q{ben.woosley@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -89,7 +89,7 @@ Gem::Specification.new do |s|
89
89
  s.homepage = %q{http://github.com/Empact/votesmart}
90
90
  s.rdoc_options = ["--charset=UTF-8"]
91
91
  s.require_paths = ["lib"]
92
- s.rubygems_version = %q{1.3.6}
92
+ s.rubygems_version = %q{1.3.7}
93
93
  s.summary = %q{A wrapper for the Project Vote Smart API}
94
94
  s.test_files = [
95
95
  "spec/spec_helper.rb",
@@ -104,7 +104,7 @@ Gem::Specification.new do |s|
104
104
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
105
105
  s.specification_version = 3
106
106
 
107
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
107
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
108
108
  s.add_runtime_dependency(%q<patron>, [">= 0.4.6"])
109
109
  else
110
110
  s.add_dependency(%q<patron>, [">= 0.4.6"])
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: votesmart
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 17
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 3
8
- - 0
9
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Dan Cunning
@@ -15,16 +16,18 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2010-03-25 00:00:00 -04:00
19
+ date: 2010-06-19 00:00:00 -04:00
19
20
  default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
22
23
  name: patron
23
24
  prerelease: false
24
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
25
27
  requirements:
26
28
  - - ">="
27
29
  - !ruby/object:Gem::Version
30
+ hash: 3
28
31
  segments:
29
32
  - 0
30
33
  - 4
@@ -120,23 +123,27 @@ rdoc_options:
120
123
  require_paths:
121
124
  - lib
122
125
  required_ruby_version: !ruby/object:Gem::Requirement
126
+ none: false
123
127
  requirements:
124
128
  - - ">="
125
129
  - !ruby/object:Gem::Version
130
+ hash: 3
126
131
  segments:
127
132
  - 0
128
133
  version: "0"
129
134
  required_rubygems_version: !ruby/object:Gem::Requirement
135
+ none: false
130
136
  requirements:
131
137
  - - ">="
132
138
  - !ruby/object:Gem::Version
139
+ hash: 3
133
140
  segments:
134
141
  - 0
135
142
  version: "0"
136
143
  requirements: []
137
144
 
138
145
  rubyforge_project:
139
- rubygems_version: 1.3.6
146
+ rubygems_version: 1.3.7
140
147
  signing_key:
141
148
  specification_version: 3
142
149
  summary: A wrapper for the Project Vote Smart API