active_import 0.1.4 → 0.1.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.
- data/lib/active_import/import_csv.rb +5 -5
- data/lib/active_import/version.rb +1 -1
- metadata +4 -4
@@ -42,11 +42,6 @@ module ActiveImport
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def parse(&block)
|
45
|
-
# Get an estimate of the number of rows in the file
|
46
|
-
f = File.open(data_file)
|
47
|
-
@estimated_rows = f.readlines.size - 1
|
48
|
-
f.close
|
49
|
-
|
50
45
|
column_mappings = @converter.columns
|
51
46
|
|
52
47
|
headers = {}
|
@@ -62,6 +57,11 @@ module ActiveImport
|
|
62
57
|
puts "Using FasterCSV parser".cyan
|
63
58
|
end
|
64
59
|
|
60
|
+
# Get an estimate of the number of rows in the file
|
61
|
+
puts @data_file.to_s.yellow
|
62
|
+
@estimated_rows = csv_class.read(@data_file).length - 1
|
63
|
+
puts "Estimated Rows: #{@estimated_rows}".magenta
|
64
|
+
|
65
65
|
csv_class.foreach(@data_file, {:encoding => 'windows-1251:utf-8'}) do |row|
|
66
66
|
row_number += 1
|
67
67
|
if (header)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -141,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
segments:
|
143
143
|
- 0
|
144
|
-
hash:
|
144
|
+
hash: 588961723164472700
|
145
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
146
|
none: false
|
147
147
|
requirements:
|
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
version: '0'
|
151
151
|
segments:
|
152
152
|
- 0
|
153
|
-
hash:
|
153
|
+
hash: 588961723164472700
|
154
154
|
requirements: []
|
155
155
|
rubyforge_project:
|
156
156
|
rubygems_version: 1.8.24
|