fec_results 0.5 → 0.6
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.
- checksums.yaml +15 -0
- data/lib/fec_results/congress.rb +26 -6
- data/lib/fec_results/version.rb +1 -1
- metadata +5 -21
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
M2ExMjZlOWZjNDIyY2E0NTBhMzkwYWQ3Zjg4NTM3ZTYzZTY0MGE1Yg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZWM5MGQ4NDQ3YTI3YzRiMTk2MzYyNWE1MGZmYzU5MTIyMTRkMzIxOA==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZmU0ZThjMjU5YTdhMzk3YzQxMDIzZTUxM2YyNTU5MDJiZTJkODc4ZWMzNzA0
|
10
|
+
YjVhMjZhYjdiNjVmNGE5Mzg2ZDIzMWM0NjIxZTcxYzIzMDY5MGEzZjgwYzZh
|
11
|
+
M2E4ZjgxNWM3Yjg0MTcxZjQ2ZmEzZDI1NjZjNWU2OWY3NWFkYTM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NTlkNDI0YzI0NDlmMzVlZjFiOGJkODkyZDAxNzRlYWJkYmFmOGMzM2Y3ZTVh
|
14
|
+
NmJiNDMwNWJhM2NiMTMzMDhjOTNmNGVmNDM4N2QyZDRmMWMwNDRjMzc5Yjlm
|
15
|
+
YmQyZjAxMWU1MjFjMzU2MjZhOTg0ODViYmQ0M2E5MGYyNTY5M2Y=
|
data/lib/fec_results/congress.rb
CHANGED
@@ -250,7 +250,7 @@ module FecResults
|
|
250
250
|
c[:district] = candidate['DISTRICT']
|
251
251
|
c[:party] = candidate['PARTY']
|
252
252
|
c[:incumbent] = candidate['INCUMBENT INDICATOR'] == '(I)' ? true : false
|
253
|
-
c[:
|
253
|
+
c[:candidate_last], c[:candidate_first] = candidate['NAME'].split(', ')
|
254
254
|
c[:candidate_name] = candidate['NAME']
|
255
255
|
|
256
256
|
c = update_vote_tallies(c, candidate, 'PRIMARY RESULTS', 'PRIMARY %', 'RUNOFF RESULTS', 'RUNOFF %', 'GENERAL RESULTS', 'GENERAL %')
|
@@ -276,7 +276,11 @@ module FecResults
|
|
276
276
|
else
|
277
277
|
c[:primary_unopposed] = false
|
278
278
|
c[:primary_votes] = candidate[primary_votes].to_i
|
279
|
-
c[:
|
279
|
+
if c[:year] == 2000
|
280
|
+
c[:primary_pct] = candidate[primary_pct].to_f
|
281
|
+
else
|
282
|
+
c[:primary_pct] = candidate[primary_pct].to_f*100.0
|
283
|
+
end
|
280
284
|
end
|
281
285
|
|
282
286
|
if candidate[runoff_votes].blank?
|
@@ -284,7 +288,11 @@ module FecResults
|
|
284
288
|
c[:runoff_pct] = nil
|
285
289
|
else
|
286
290
|
c[:runoff_votes] = candidate[runoff_votes].to_i
|
287
|
-
c[:
|
291
|
+
if c[:year] == 2000
|
292
|
+
c[:runoff_pct] = candidate[runoff_pct].to_f
|
293
|
+
else
|
294
|
+
c[:runoff_pct] = candidate[runoff_pct].to_f*100.0
|
295
|
+
end
|
288
296
|
end
|
289
297
|
|
290
298
|
if candidate[general_votes] == 'Unopposed'
|
@@ -298,7 +306,11 @@ module FecResults
|
|
298
306
|
else
|
299
307
|
c[:general_unopposed] = false
|
300
308
|
c[:general_votes] = candidate[general_votes].to_i
|
301
|
-
c[:
|
309
|
+
if c[:year] == 2000
|
310
|
+
c[:general_pct] = candidate[general_pct].to_f
|
311
|
+
else
|
312
|
+
c[:general_pct] = candidate[general_pct].to_f*100.0
|
313
|
+
end
|
302
314
|
end
|
303
315
|
c
|
304
316
|
end
|
@@ -306,7 +318,11 @@ module FecResults
|
|
306
318
|
def update_general_runoff(c, candidate, general_runoff_votes, general_runoff_pct)
|
307
319
|
unless candidate[general_runoff_votes].blank?
|
308
320
|
c[:general_runoff_votes] = candidate[general_runoff_votes].to_i
|
309
|
-
c[:
|
321
|
+
if c[:year] == 2000
|
322
|
+
c[:general_runoff_pct] = candidate[general_runoff_pct].to_f
|
323
|
+
else
|
324
|
+
c[:general_runoff_pct] = candidate[general_runoff_pct].to_f*100.0
|
325
|
+
end
|
310
326
|
end
|
311
327
|
c
|
312
328
|
end
|
@@ -314,7 +330,11 @@ module FecResults
|
|
314
330
|
def update_combined_totals(c, candidate, general_combined_party_votes, general_combined_party_pct)
|
315
331
|
unless candidate[general_combined_party_votes].blank?
|
316
332
|
c[:general_combined_party_votes] = candidate[general_combined_party_votes].to_i
|
317
|
-
c[:
|
333
|
+
if c[:year] == 2000
|
334
|
+
c[:general_combined_party_pct] = candidate[general_combined_party_pct].to_f
|
335
|
+
else
|
336
|
+
c[:general_combined_party_pct] = candidate[general_combined_party_pct].to_f*100.0
|
337
|
+
end
|
318
338
|
end
|
319
339
|
c
|
320
340
|
end
|
data/lib/fec_results/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fec_results
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
5
|
-
prerelease:
|
4
|
+
version: '0.6'
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Derek Willis
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-02-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bundler
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: remote_table
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: american_date
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -98,32 +89,25 @@ files:
|
|
98
89
|
homepage: ''
|
99
90
|
licenses:
|
100
91
|
- Apache
|
92
|
+
metadata: {}
|
101
93
|
post_install_message:
|
102
94
|
rdoc_options: []
|
103
95
|
require_paths:
|
104
96
|
- lib
|
105
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
98
|
requirements:
|
108
99
|
- - ! '>='
|
109
100
|
- !ruby/object:Gem::Version
|
110
101
|
version: '0'
|
111
|
-
segments:
|
112
|
-
- 0
|
113
|
-
hash: 3045175943861585558
|
114
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
-
none: false
|
116
103
|
requirements:
|
117
104
|
- - ! '>='
|
118
105
|
- !ruby/object:Gem::Version
|
119
106
|
version: '0'
|
120
|
-
segments:
|
121
|
-
- 0
|
122
|
-
hash: 3045175943861585558
|
123
107
|
requirements: []
|
124
108
|
rubyforge_project:
|
125
|
-
rubygems_version:
|
109
|
+
rubygems_version: 2.2.1
|
126
110
|
signing_key:
|
127
|
-
specification_version:
|
111
|
+
specification_version: 4
|
128
112
|
summary: House, Senate, Presidential results
|
129
113
|
test_files: []
|