fech 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/fech.rb +2 -1
- data/lib/fech/csv.rb +12 -0
- data/lib/fech/filing.rb +4 -5
- data/lib/fech/map_generator.rb +1 -1
- data/lib/fech/version.rb +1 -1
- metadata +4 -3
data/Gemfile.lock
CHANGED
data/lib/fech.rb
CHANGED
data/lib/fech/csv.rb
ADDED
data/lib/fech/filing.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'tmpdir'
|
2
2
|
require 'open-uri'
|
3
|
-
require 'fastercsv'
|
4
3
|
|
5
4
|
module Fech
|
6
5
|
|
@@ -192,9 +191,9 @@ module Fech
|
|
192
191
|
def parse_filing_version
|
193
192
|
first = File.open(file_path).first
|
194
193
|
if first.index("\034").nil?
|
195
|
-
|
194
|
+
Fech::Csv.parse(first).flatten[2]
|
196
195
|
else
|
197
|
-
|
196
|
+
Fech::Csv.parse(first, :col_sep => "\034").flatten[2]
|
198
197
|
end
|
199
198
|
end
|
200
199
|
|
@@ -224,7 +223,7 @@ module Fech
|
|
224
223
|
raise "File #{file_path} does not exist. Try invoking the .download method on this Filing object."
|
225
224
|
end
|
226
225
|
c = 0
|
227
|
-
|
226
|
+
Fech::Csv.foreach(file_path, :col_sep => delimiter, :skip_blanks => true) do |row|
|
228
227
|
if opts[:with_index]
|
229
228
|
yield [row, c]
|
230
229
|
c += 1
|
@@ -245,4 +244,4 @@ module Fech
|
|
245
244
|
end
|
246
245
|
|
247
246
|
end
|
248
|
-
end
|
247
|
+
end
|
data/lib/fech/map_generator.rb
CHANGED
@@ -40,7 +40,7 @@ module Fech
|
|
40
40
|
# exists for it. If maps for two different versions are identical, they
|
41
41
|
# are combined.
|
42
42
|
FILING_VERSIONS.each do |version|
|
43
|
-
|
43
|
+
Fech::Csv.foreach(version_summary_file(source_dir, version)) do |row|
|
44
44
|
# Each row of a version summary file contains the ordered list of
|
45
45
|
# column names.
|
46
46
|
data[row.first] ||= {}
|
data/lib/fech/version.rb
CHANGED
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:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Strickland
|
@@ -180,6 +180,7 @@ files:
|
|
180
180
|
- autotest/discover.rb
|
181
181
|
- fech.gemspec
|
182
182
|
- lib/fech.rb
|
183
|
+
- lib/fech/csv.rb
|
183
184
|
- lib/fech/default_translations.rb
|
184
185
|
- lib/fech/fech_utils.rb
|
185
186
|
- lib/fech/filing.rb
|