fech 1.6.2 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG +6 -0
- data/Gemfile.lock +9 -16
- data/README.rdoc +2 -1
- data/lib/fech/filing.rb +10 -1
- data/lib/fech/version.rb +1 -1
- data/spec/filing_spec.rb +32 -0
- metadata +28 -72
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: eeb8ba7a377f487339b41dba6db889b92542c50a
|
4
|
+
data.tar.gz: c01002418f6c40f1cb1395a95255a65427203b94
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fec198b138fbf08d2fdc37547e1d5e373373e454360ea9ceea8cc6f49c7aa629da0332316629344e6a0a36406d48bb14ad1f919822b0de90e87915314e73cd7b
|
7
|
+
data.tar.gz: 79b4771fd4cf30b9cdb4c3b20ce36a01a65a8a6089ffcd2666b86350515d8dfc96755a11d5c9bac1d3e8ee8e2da343a0a9753017ad2382db9801033a4327d57e
|
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fech (1.6.
|
4
|
+
fech (1.6.3)
|
5
5
|
ensure-encoding
|
6
6
|
fastercsv
|
7
7
|
people
|
@@ -9,13 +9,17 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
archive-tar-minitar (0.5.2)
|
13
12
|
columnize (0.3.6)
|
13
|
+
debugger (1.4.0)
|
14
|
+
columnize (>= 0.3.1)
|
15
|
+
debugger-linecache (~> 1.1.1)
|
16
|
+
debugger-ruby_core_source (~> 1.2.0)
|
17
|
+
debugger-linecache (1.1.2)
|
18
|
+
debugger-ruby_core_source (>= 1.1.1)
|
19
|
+
debugger-ruby_core_source (1.2.4)
|
14
20
|
diff-lcs (1.1.2)
|
15
21
|
ensure-encoding (0.1)
|
16
22
|
fastercsv (1.5.5)
|
17
|
-
linecache19 (0.5.12)
|
18
|
-
ruby_core_source (>= 0.1.4)
|
19
23
|
mocha (0.9.12)
|
20
24
|
people (0.2.1)
|
21
25
|
rake (0.8.7)
|
@@ -28,16 +32,6 @@ GEM
|
|
28
32
|
rspec-expectations (2.6.0)
|
29
33
|
diff-lcs (~> 1.1.2)
|
30
34
|
rspec-mocks (2.6.0)
|
31
|
-
ruby-debug-base19 (0.11.25)
|
32
|
-
columnize (>= 0.3.1)
|
33
|
-
linecache19 (>= 0.5.11)
|
34
|
-
ruby_core_source (>= 0.1.4)
|
35
|
-
ruby-debug19 (0.11.6)
|
36
|
-
columnize (>= 0.3.1)
|
37
|
-
linecache19 (>= 0.5.11)
|
38
|
-
ruby-debug-base19 (>= 0.11.19)
|
39
|
-
ruby_core_source (0.1.5)
|
40
|
-
archive-tar-minitar (>= 0.5.2)
|
41
35
|
yard (0.7.2)
|
42
36
|
|
43
37
|
PLATFORMS
|
@@ -45,11 +39,10 @@ PLATFORMS
|
|
45
39
|
|
46
40
|
DEPENDENCIES
|
47
41
|
bundler
|
42
|
+
debugger (= 1.4.0)
|
48
43
|
fech!
|
49
|
-
linecache19
|
50
44
|
mocha
|
51
45
|
rake
|
52
46
|
rdoc
|
53
47
|
rspec (~> 2.6)
|
54
|
-
ruby-debug19
|
55
48
|
yard
|
data/README.rdoc
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
Fech makes it easy to parse electronic campaign finance filings[http://www.fec.gov/finance/disclosure/efile_search.shtml] by candidates, parties and political action committees from the Federal Election Commission. It lets you access filing attributes the same way regardless of filing version, and works as a framework for cleaning and filing data. Fech is an open source project of The New York Times, but contributions from anyone interested in working with F.E.C. filings are greatly appreciated.
|
8
8
|
|
9
|
-
Latest version: 1.6.
|
9
|
+
Latest version: 1.6.3. For details see the CHANGELOG.
|
10
10
|
|
11
11
|
Fech is tested under Ruby versions 1.8.7, 1.9.2, 1.9.3 and 2.0.0.
|
12
12
|
|
@@ -16,6 +16,7 @@ Can be found at Fech's Github page[http://nytimes.github.com/Fech/].
|
|
16
16
|
|
17
17
|
== News
|
18
18
|
|
19
|
+
* Jan. 22, 2014: Version 1.6.3 released. Bugfix to ensure Translator object is available to any Filing object. Thanks to @abstrctn for fix.
|
19
20
|
* Jan. 15, 2014: Version 1.6.2 released. Bugfix to add dissemination date to SE mappings.
|
20
21
|
* Jan. 15, 2014: Version 1.6.1 released. Bugfix to add FEC version 8.1 mappings for F13 and F24 forms.
|
21
22
|
* Jan. 14, 2014: Version 1.6.0 released. Added support for FEC electronic filing version 8.1 headers and mappings.
|
data/lib/fech/filing.rb
CHANGED
@@ -13,7 +13,7 @@ module Fech
|
|
13
13
|
# note that there are plenty of <v3 filings after this, so readable? still needs to be checked
|
14
14
|
FIRST_V3_FILING = 11850
|
15
15
|
|
16
|
-
attr_accessor :filing_id, :download_dir
|
16
|
+
attr_accessor :filing_id, :download_dir
|
17
17
|
|
18
18
|
# Create a new Filing object, assign the download directory to system's
|
19
19
|
# temp folder by default.
|
@@ -172,6 +172,15 @@ module Fech
|
|
172
172
|
Fech::Mappings.for_row(row_type, opts)
|
173
173
|
end
|
174
174
|
|
175
|
+
# Accessor for @translator. Will return the Translator initialized in
|
176
|
+
# Filing's initializer if built-in translations were passed to Filing's
|
177
|
+
# initializer ({:translate => [:foo, :bar]}).
|
178
|
+
# Otherwise, will create and memoize a new Translator without any default
|
179
|
+
# translations.
|
180
|
+
def translator
|
181
|
+
@translator ||= Fech::Translator.new
|
182
|
+
end
|
183
|
+
|
175
184
|
# @yield [t] returns a reference to the filing's Translator
|
176
185
|
# @yieldparam [Translator] the filing's Translator
|
177
186
|
def translate(&block)
|
data/lib/fech/version.rb
CHANGED
data/spec/filing_spec.rb
CHANGED
@@ -212,6 +212,38 @@ describe Fech::Filing do
|
|
212
212
|
end
|
213
213
|
|
214
214
|
end
|
215
|
+
|
216
|
+
describe "#translator" do
|
217
|
+
|
218
|
+
describe "when Filing was initialized with built-in translations" do
|
219
|
+
|
220
|
+
before do
|
221
|
+
@translated_filing = Fech::Filing.new(723604, :translate => [:names])
|
222
|
+
@translator = @translated_filing.translator
|
223
|
+
end
|
224
|
+
|
225
|
+
it "returns the Translator created in Filing's initializer" do
|
226
|
+
@translated_filing.translator.should == @translator
|
227
|
+
@translated_filing.translator.translations.size.should > 0
|
228
|
+
end
|
229
|
+
|
230
|
+
end
|
231
|
+
|
232
|
+
describe "when Filing was not initialized with built-in translation" do
|
233
|
+
|
234
|
+
before do
|
235
|
+
@untranslated_filing = Fech::Filing.new(723604)
|
236
|
+
end
|
237
|
+
|
238
|
+
it "creates a new Translator with no default ranslations" do
|
239
|
+
@untranslated_filing.translator.should_not be_nil
|
240
|
+
@untranslated_filing.translator.class.should == Fech::Translator
|
241
|
+
@untranslated_filing.translator.translations.should be_empty
|
242
|
+
end
|
243
|
+
|
244
|
+
end
|
245
|
+
|
246
|
+
end
|
215
247
|
|
216
248
|
describe "#map" do
|
217
249
|
|
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fech
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
5
|
-
prerelease:
|
4
|
+
version: 1.6.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Michael Strickland
|
@@ -12,108 +11,81 @@ authors:
|
|
12
11
|
autorequire:
|
13
12
|
bindir: bin
|
14
13
|
cert_chain: []
|
15
|
-
date: 2014-01-
|
14
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
17
16
|
- !ruby/object:Gem::Dependency
|
18
17
|
name: fastercsv
|
19
18
|
requirement: !ruby/object:Gem::Requirement
|
20
|
-
none: false
|
21
19
|
requirements:
|
22
|
-
- -
|
20
|
+
- - '>='
|
23
21
|
- !ruby/object:Gem::Version
|
24
22
|
version: '0'
|
25
23
|
type: :runtime
|
26
24
|
prerelease: false
|
27
25
|
version_requirements: !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
26
|
requirements:
|
30
|
-
- -
|
27
|
+
- - '>='
|
31
28
|
- !ruby/object:Gem::Version
|
32
29
|
version: '0'
|
33
30
|
- !ruby/object:Gem::Dependency
|
34
31
|
name: people
|
35
32
|
requirement: !ruby/object:Gem::Requirement
|
36
|
-
none: false
|
37
33
|
requirements:
|
38
|
-
- -
|
34
|
+
- - '>='
|
39
35
|
- !ruby/object:Gem::Version
|
40
36
|
version: '0'
|
41
37
|
type: :runtime
|
42
38
|
prerelease: false
|
43
39
|
version_requirements: !ruby/object:Gem::Requirement
|
44
|
-
none: false
|
45
40
|
requirements:
|
46
|
-
- -
|
41
|
+
- - '>='
|
47
42
|
- !ruby/object:Gem::Version
|
48
43
|
version: '0'
|
49
44
|
- !ruby/object:Gem::Dependency
|
50
45
|
name: ensure-encoding
|
51
46
|
requirement: !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
47
|
requirements:
|
54
|
-
- -
|
48
|
+
- - '>='
|
55
49
|
- !ruby/object:Gem::Version
|
56
50
|
version: '0'
|
57
51
|
type: :runtime
|
58
52
|
prerelease: false
|
59
53
|
version_requirements: !ruby/object:Gem::Requirement
|
60
|
-
none: false
|
61
54
|
requirements:
|
62
|
-
- -
|
55
|
+
- - '>='
|
63
56
|
- !ruby/object:Gem::Version
|
64
57
|
version: '0'
|
65
58
|
- !ruby/object:Gem::Dependency
|
66
|
-
name:
|
59
|
+
name: debugger
|
67
60
|
requirement: !ruby/object:Gem::Requirement
|
68
|
-
none: false
|
69
61
|
requirements:
|
70
|
-
- -
|
62
|
+
- - '='
|
71
63
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
64
|
+
version: 1.4.0
|
73
65
|
type: :development
|
74
66
|
prerelease: false
|
75
67
|
version_requirements: !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
68
|
requirements:
|
78
|
-
- -
|
69
|
+
- - '='
|
79
70
|
- !ruby/object:Gem::Version
|
80
|
-
version:
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: linecache19
|
83
|
-
requirement: !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: !ruby/object:Gem::Requirement
|
92
|
-
none: false
|
93
|
-
requirements:
|
94
|
-
- - ! '>='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
71
|
+
version: 1.4.0
|
97
72
|
- !ruby/object:Gem::Dependency
|
98
73
|
name: rake
|
99
74
|
requirement: !ruby/object:Gem::Requirement
|
100
|
-
none: false
|
101
75
|
requirements:
|
102
|
-
- -
|
76
|
+
- - '>='
|
103
77
|
- !ruby/object:Gem::Version
|
104
78
|
version: '0'
|
105
79
|
type: :development
|
106
80
|
prerelease: false
|
107
81
|
version_requirements: !ruby/object:Gem::Requirement
|
108
|
-
none: false
|
109
82
|
requirements:
|
110
|
-
- -
|
83
|
+
- - '>='
|
111
84
|
- !ruby/object:Gem::Version
|
112
85
|
version: '0'
|
113
86
|
- !ruby/object:Gem::Dependency
|
114
87
|
name: rspec
|
115
88
|
requirement: !ruby/object:Gem::Requirement
|
116
|
-
none: false
|
117
89
|
requirements:
|
118
90
|
- - ~>
|
119
91
|
- !ruby/object:Gem::Version
|
@@ -121,7 +93,6 @@ dependencies:
|
|
121
93
|
type: :development
|
122
94
|
prerelease: false
|
123
95
|
version_requirements: !ruby/object:Gem::Requirement
|
124
|
-
none: false
|
125
96
|
requirements:
|
126
97
|
- - ~>
|
127
98
|
- !ruby/object:Gem::Version
|
@@ -129,65 +100,57 @@ dependencies:
|
|
129
100
|
- !ruby/object:Gem::Dependency
|
130
101
|
name: mocha
|
131
102
|
requirement: !ruby/object:Gem::Requirement
|
132
|
-
none: false
|
133
103
|
requirements:
|
134
|
-
- -
|
104
|
+
- - '>='
|
135
105
|
- !ruby/object:Gem::Version
|
136
106
|
version: '0'
|
137
107
|
type: :development
|
138
108
|
prerelease: false
|
139
109
|
version_requirements: !ruby/object:Gem::Requirement
|
140
|
-
none: false
|
141
110
|
requirements:
|
142
|
-
- -
|
111
|
+
- - '>='
|
143
112
|
- !ruby/object:Gem::Version
|
144
113
|
version: '0'
|
145
114
|
- !ruby/object:Gem::Dependency
|
146
115
|
name: bundler
|
147
116
|
requirement: !ruby/object:Gem::Requirement
|
148
|
-
none: false
|
149
117
|
requirements:
|
150
|
-
- -
|
118
|
+
- - '>='
|
151
119
|
- !ruby/object:Gem::Version
|
152
120
|
version: '0'
|
153
121
|
type: :development
|
154
122
|
prerelease: false
|
155
123
|
version_requirements: !ruby/object:Gem::Requirement
|
156
|
-
none: false
|
157
124
|
requirements:
|
158
|
-
- -
|
125
|
+
- - '>='
|
159
126
|
- !ruby/object:Gem::Version
|
160
127
|
version: '0'
|
161
128
|
- !ruby/object:Gem::Dependency
|
162
129
|
name: rdoc
|
163
130
|
requirement: !ruby/object:Gem::Requirement
|
164
|
-
none: false
|
165
131
|
requirements:
|
166
|
-
- -
|
132
|
+
- - '>='
|
167
133
|
- !ruby/object:Gem::Version
|
168
134
|
version: '0'
|
169
135
|
type: :development
|
170
136
|
prerelease: false
|
171
137
|
version_requirements: !ruby/object:Gem::Requirement
|
172
|
-
none: false
|
173
138
|
requirements:
|
174
|
-
- -
|
139
|
+
- - '>='
|
175
140
|
- !ruby/object:Gem::Version
|
176
141
|
version: '0'
|
177
142
|
- !ruby/object:Gem::Dependency
|
178
143
|
name: yard
|
179
144
|
requirement: !ruby/object:Gem::Requirement
|
180
|
-
none: false
|
181
145
|
requirements:
|
182
|
-
- -
|
146
|
+
- - '>='
|
183
147
|
- !ruby/object:Gem::Version
|
184
148
|
version: '0'
|
185
149
|
type: :development
|
186
150
|
prerelease: false
|
187
151
|
version_requirements: !ruby/object:Gem::Requirement
|
188
|
-
none: false
|
189
152
|
requirements:
|
190
|
-
- -
|
153
|
+
- - '>='
|
191
154
|
- !ruby/object:Gem::Version
|
192
155
|
version: '0'
|
193
156
|
description: A Ruby library for interacting with electronic filings from the Federal
|
@@ -328,32 +291,25 @@ files:
|
|
328
291
|
homepage: http://github.com/nytimes/fech
|
329
292
|
licenses:
|
330
293
|
- Apache-2.0
|
294
|
+
metadata: {}
|
331
295
|
post_install_message:
|
332
296
|
rdoc_options: []
|
333
297
|
require_paths:
|
334
298
|
- lib
|
335
299
|
required_ruby_version: !ruby/object:Gem::Requirement
|
336
|
-
none: false
|
337
300
|
requirements:
|
338
|
-
- -
|
301
|
+
- - '>='
|
339
302
|
- !ruby/object:Gem::Version
|
340
303
|
version: '0'
|
341
|
-
segments:
|
342
|
-
- 0
|
343
|
-
hash: -4379222883206279012
|
344
304
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
345
|
-
none: false
|
346
305
|
requirements:
|
347
|
-
- -
|
306
|
+
- - '>='
|
348
307
|
- !ruby/object:Gem::Version
|
349
308
|
version: '0'
|
350
|
-
segments:
|
351
|
-
- 0
|
352
|
-
hash: -4379222883206279012
|
353
309
|
requirements: []
|
354
310
|
rubyforge_project: fech
|
355
|
-
rubygems_version:
|
311
|
+
rubygems_version: 2.2.1
|
356
312
|
signing_key:
|
357
|
-
specification_version:
|
313
|
+
specification_version: 4
|
358
314
|
summary: Ruby library for parsing FEC filings.
|
359
315
|
test_files: []
|