table_importer 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/table_importer/copy_and_paste.rb +5 -0
- data/lib/table_importer/excel.rb +1 -1
- data/lib/table_importer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd84285c3a82fbc6de03c8f3f8e4891ac9587e63
|
4
|
+
data.tar.gz: 9ad7d89998a2f9e98f1501968275ca28c5c8b6c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814a258443231c3b4329cadc44da9d5f1d1c3cdbe365b9c97db0d5bf867d47612ff8e2bc750a445be982f3066d29bba6b7eb6a89201bae03cc318041c883f884
|
7
|
+
data.tar.gz: b53895f0aa9946ba7510fffa33ad356f46dbf5774db0ef134deba95cbdce9b6b407b19ee1476c6f53146a0292c1b33045a89bd37e3d3df2da63562e4705b9c77
|
@@ -24,6 +24,11 @@ module TableImporter
|
|
24
24
|
|
25
25
|
def data_conforms_pattern(col_sep, rec_sep)
|
26
26
|
# Check to see if data is of bcc style
|
27
|
+
first_item = @data.split("\n")[1]
|
28
|
+
if first_item.present? && first_item.match(/\S@\S/) && !first_item.match(/;|,|\s/)
|
29
|
+
rec_sep = "\n"
|
30
|
+
col_sep = " "
|
31
|
+
end
|
27
32
|
first_item = @data.split(",").first
|
28
33
|
if first_item.present? && first_item.match(/\S@\S/)
|
29
34
|
if first_item.match(/<(\S+@\S+)/)
|
data/lib/table_importer/excel.rb
CHANGED
@@ -15,7 +15,7 @@ module TableImporter
|
|
15
15
|
if !data[:headers].nil?
|
16
16
|
@headers = data[:headers]
|
17
17
|
else
|
18
|
-
@headers = @headers_present ? @file.row(1).map { |header| header.to_sym } : default_headers
|
18
|
+
@headers = @headers_present ? @file.row(1).map { |header| header.to_sym unless header.nil?} : default_headers
|
19
19
|
end
|
20
20
|
rescue NoMethodError
|
21
21
|
raise Exceptions::HeaderMismatchError.new
|