fech 1.3.2 → 1.4

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.2)
4
+ fech (1.4)
5
5
  fastercsv
6
6
  people
7
7
 
data/README.rdoc CHANGED
@@ -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
+ * April 18, 2013: Version 1.4 released. Adds support for unofficial Senate electronic filings.
19
20
  * March 26, 2013: Version 1.3.2 released. Bugfix for F99 filing encoding issues. Thanks for the patch, @jgillum.
20
21
  * Dec. 11, 2012: Versions 1.3, 1.3.1 released. Adds support for F13 filings from inaugural committees and fixes an encoding bug.
21
22
  * 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.
data/lib/fech.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'fech/filing'
2
+ require 'fech/senate_filing'
2
3
  require 'fech/rendered_maps'
3
4
  require 'fech/mappings'
4
5
  require 'fech/default_translations'
data/lib/fech/filing.rb CHANGED
@@ -8,6 +8,10 @@ module Fech
8
8
  # is automatically mapped at runtime into a labeled Hash. Additional
9
9
  # Translations may be added to change the way that data is mapped and cleaned.
10
10
  class Filing
11
+ # first filing number using the version >=3.00 format
12
+ # note that there are plenty of <v3 filings after this, so readable? still needs to be checked
13
+ FIRST_V3_FILING = 11850
14
+
11
15
  attr_accessor :filing_id, :download_dir, :translator
12
16
 
13
17
  # Create a new Filing object, assign the download directory to system's
@@ -207,6 +211,11 @@ module Fech
207
211
  end
208
212
  end
209
213
 
214
+ # Only FEC format 3.00 + is supported
215
+ def readable?
216
+ filing_version.to_i >= 3
217
+ end
218
+
210
219
  # Gets or creats the Mappings instance for this filing_version
211
220
  def mappings
212
221
  @mapping ||= Fech::Mappings.new(filing_version)
@@ -0,0 +1,7 @@
1
+ module Fech
2
+ class SenateFiling < Filing
3
+ def filing_url
4
+ "http://query.nictusa.com/senate/posted/#{filing_id}.fec"
5
+ end
6
+ end
7
+ end
data/lib/fech/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fech
2
- VERSION = "1.3.2"
2
+ VERSION = "1.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fech
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 3
9
- - 2
10
- version: 1.3.2
8
+ - 4
9
+ version: "1.4"
11
10
  platform: ruby
12
11
  authors:
13
12
  - Michael Strickland
@@ -18,7 +17,7 @@ autorequire:
18
17
  bindir: bin
19
18
  cert_chain: []
20
19
 
21
- date: 2013-03-26 00:00:00 Z
20
+ date: 2013-04-18 00:00:00 Z
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
24
23
  name: fastercsv
@@ -221,6 +220,7 @@ files:
221
220
  - lib/fech/mapped.rb
222
221
  - lib/fech/mappings.rb
223
222
  - lib/fech/rendered_maps.rb
223
+ - lib/fech/senate_filing.rb
224
224
  - lib/fech/translator.rb
225
225
  - lib/fech/version.rb
226
226
  - sources/F1.csv