ecfs 0.3.4 → 0.3.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d734b350311ab24f4cf5d15932bf509a0e5fcaee
4
- data.tar.gz: ae95b801d4f078fef7a80fb77b532fb9788d2e71
3
+ metadata.gz: c08bb2a43f4344571816d8fb05cf966526ec72c6
4
+ data.tar.gz: d82aa4e5cee3a3f8cae3112b6af79f5d5a3ef139
5
5
  SHA512:
6
- metadata.gz: 609dcef6c142f3f95246b070484135ad9cd4e94546a7f2740848bb8b878574ff5b7d8b1f40333bd550b95959899b245c6231cbf7ef9179be8aa71a338055fc8d
7
- data.tar.gz: 4061fae97e0820e509dfc70c38023e1be42fd2a9f871a4726eaed1fff3942aa15ebc9a88da651513e9728a33ce45f3c6d87ba8897cfdbd61a8200ce68c23e717
6
+ metadata.gz: 841852ed074e68f27784e77d386ec6bc9f774547846bd892b8ecc4628f6b6478f83496c7241a0c7b4df6dcfab0ba6948fbb1b96ba0032115130493dd1540cd57
7
+ data.tar.gz: 89c133a984efddf1d04f65b2bc1a603b5d1ff8bd16f71af7640ef7dac1fa34002e1d07ac5b0cb75142d2a0606933afce7ded7a8439717d96ddb761c4386dd220
@@ -47,7 +47,26 @@ module ECFS
47
47
  return filings, total
48
48
  end
49
49
 
50
- def get(fetch_document_urls=false)
50
+ def filing_to_citation(filing)
51
+ patterns = {
52
+ "COMMENT" => "Comments",
53
+ "REPLY TO COMMENTS" => "Reply Comments",
54
+ "NOTICE OF EXPARTE" => "Ex Parte Letter"
55
+ }
56
+
57
+ case filing["type_of_filing"]
58
+ when "COMMENT"
59
+ return "Comments of #{filing['name_of_filer']}"
60
+ when "REPLY TO COMMENTS"
61
+ return "Reply Comments of #{filing['name_of_filer']}"
62
+ when "NOTICE OF EXPARTE"
63
+ return "#{filing['name_of_filer']} Ex Parte Letter"
64
+ else
65
+ return "#{filing["type_of_filing"].downcase.capitalize} of #{filing['name_of_filer']}"
66
+ end
67
+ end
68
+
69
+ def get
51
70
  url = "http://apps.fcc.gov/ecfs/solr/search?sort=dateRcpt&proceeding=#{@docket_number}&dir=asc&start=0"
52
71
  filings = []
53
72
 
@@ -62,8 +81,8 @@ module ECFS
62
81
  filings.concat filings_from_docket_number(@docket_number, page)[0]
63
82
  end
64
83
 
65
- if fetch_document_urls
66
- p "pretending to fetch some urls"
84
+ filings.each do |filing|
85
+ filing['citation'] = filing_to_citation(filing)
67
86
  end
68
87
 
69
88
  filings
data/lib/ecfs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ECFS
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -12,6 +12,7 @@ class TestSolrScrape < MiniTest::Unit::TestCase
12
12
 
13
13
  assert filings.first.is_a?(Hash)
14
14
  assert filings.first.has_key?('docket_number')
15
+ assert filings.first.has_key?('citation')
15
16
  end
16
17
  end
17
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan deLevie