fech 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fech (1.3)
4
+ fech (1.3.2)
5
5
  fastercsv
6
6
  people
7
7
 
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.3.1
9
+ Latest version: 1.3.2
10
10
 
11
11
  Fech is tested under Ruby versions 1.8.7, 1.9.2 and 1.9.3.
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
+ * March 26, 2013: Version 1.3.2 released. Bugfix for F99 filing encoding issues. Thanks for the patch, @jgillum.
19
20
  * Dec. 11, 2012: Versions 1.3, 1.3.1 released. Adds support for F13 filings from inaugural committees and fixes an encoding bug.
20
21
  * Dec. 3, 2012: Version 1.2 released. Fixes encoding errors under Ruby 1.9.3 for ASCII-encoded filings. Thanks to Sanjiv for the bug report.
21
22
  * Nov. 13, 2012: Version 1.1 released. CSVDoctor skips rows that don't match row type being searched for, which provides a performance boost, and smaller bugfixes for Form 99 handling and date-field conversions. Thanks to Sai for several patches.
@@ -76,6 +77,8 @@ Daniel Pritchett, daniel@sharingatwork.com
76
77
 
77
78
  Sai, home@saizai.com
78
79
 
80
+ Jack Gillum, jgillum@ap.org
81
+
79
82
  == Copyright
80
83
 
81
- Copyright (c) 2012 The New York Times Company. See LICENSE for details.
84
+ Copyright (c) 2013 The New York Times Company. See LICENSE for details.
data/lib/fech/filing.rb CHANGED
@@ -245,6 +245,15 @@ module Fech
245
245
  def fix_f99_contents
246
246
  @customized = true
247
247
  content = file_contents.read
248
+
249
+ if RUBY_VERSION > "1.9.2"
250
+ content.encode!('UTF-8', 'UTF-8', :invalid => :replace)
251
+ else
252
+ require 'iconv'
253
+ ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
254
+ content = ic.iconv(content + ' ')[0..-2] # add valid byte before converting, then remove it
255
+ end
256
+
248
257
  regex = /\n\[BEGINTEXT\]\n(.*?)\[ENDTEXT\]\n/mi # some use eg [EndText]
249
258
  match = content.match(regex)
250
259
  if match
data/lib/fech/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fech
2
- VERSION = "1.3.1"
2
+ VERSION = "1.3.2"
3
3
  end
@@ -0,0 +1,30 @@
1
+ HDRFEC8.0Vocus PAC Management8.00.58250
2
+ F99C00053553National Rifle Association of America Political Victory Fund11250 Waples Mill RoadFairfaxVA22030AdkinsMary Rose20130321MST
3
+ [BEGINTEXT]
4
+ March 21, 2013
5
+
6
+
7
+ Federal Election Commission
8
+ Reports Analysis Division
9
+ Attn: Paul Stoetzer
10
+ 999 E Street, NW
11
+ Washington, DC 20463
12
+
13
+ ID# C00053553
14
+ RE: Amended 12 Day Pre-General Report (10/01/2012 - 10/17/2012)
15
+
16
+ Dear Mr. Stoetzer:
17
+
18
+ This letter is in response to your letter dated February 15, 2013 regarding the NRA Political Victory Fund�s Amended 12 Day Pre-General Report (10/01/2012 - 10/17/2012) concerning receipts for Line 11(a) that increased from the original report.
19
+
20
+ When preparing in-house financial statements for the month of October, reconciliations showed that some contributions were not posted to our system by our lockbox service company. The contributions in question should have been posted with a date of October 16th and 17th but were not deposited into our account until October 19th, 22nd and 23rd. These deposits in transit were not discovered until a full analysis of our activity for the month of October was performed.
21
+
22
+ Once the error was found, corrective action was taken. The missing items were posted and an amendment showing the additional contributions were reported on Line 11 (a)(iii) of our 12 Day Pre-General Report.
23
+
24
+ I can be reached at 703-267-1155 should you have any additional questions.
25
+
26
+ Sincerely,
27
+
28
+ Mary Rose Adkins
29
+ Treasurer
30
+ [ENDTEXT]
data/spec/filing_spec.rb CHANGED
@@ -25,6 +25,8 @@ describe Fech::Filing do
25
25
  @filing_f13.stubs(:file_path).returns(File.join(File.dirname(__FILE__), 'data', '425925.fec'))
26
26
  @filing_special_character = Fech::Filing.new(771694)
27
27
  @filing_special_character.stubs(:file_path).returns(File.join(File.dirname(__FILE__), 'data', '771694.fec'))
28
+ @filing_f99 = Fech::Filing.new(862554)
29
+ @filing_f99.stubs(:file_path).returns(File.join(File.dirname(__FILE__), 'data', '862554.fec'))
28
30
  end
29
31
 
30
32
  describe "#filing_version" do
@@ -99,6 +101,12 @@ describe Fech::Filing do
99
101
 
100
102
  end
101
103
 
104
+ describe 'miscelleanous filings' do
105
+ it "should handle invalid encoding" do
106
+ @filing_f99.rows_like(/f99/).first.should_not raise_error
107
+ end
108
+ end
109
+
102
110
  describe "#rows_like" do
103
111
 
104
112
  it "should return only rows matching the specified regex" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fech
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 1
10
- version: 1.3.1
9
+ - 2
10
+ version: 1.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Strickland
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2012-12-11 00:00:00 Z
21
+ date: 2013-03-26 00:00:00 Z
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
24
24
  name: fastercsv
@@ -295,6 +295,7 @@ files:
295
295
  - spec/data/767339.fec
296
296
  - spec/data/771694.fec
297
297
  - spec/data/82094.fec
298
+ - spec/data/862554.fec
298
299
  - spec/data/97405.fec
299
300
  - spec/default_translations_spec.rb
300
301
  - spec/fech_utils_spec.rb