csv_import_magic 0.0.2 → 0.0.3
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 +4 -4
- data/app/controllers/csv_import_magic/importers_controller.rb +6 -0
- data/lib/csv_import_magic/version.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +13 -0
- data/spec/dummy/log/test.log +3146 -0
- data/spec/dummy/public/system/importers/attachment_errors/000/000/001/original/failures20170406-94335-1j4fnr0.csv +2 -0
- data/spec/dummy/public/system/importers/attachment_errors/000/000/001/original/failures20170602-53937-1jv81f1.csv +2 -0
- data/spec/dummy/public/system/importers/attachment_errors/000/000/001/original/failures20170602-54115-m6aill.csv +2 -0
- data/spec/dummy/public/system/importers/attachment_errors/000/000/001/original/failures20170602-54234-sjr6h8.csv +2 -0
- data/spec/examples.txt +49 -48
- metadata +10 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 899541a2d80fab8ed2cbccb20aa7775d83c4aaab
|
|
4
|
+
data.tar.gz: 934058e353289e5dff781e5f090b41bf66b1d462
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e65c9005db327c427a76019ff975e0bda8ba7f22568bbb74d43dc7033da48002baed93bfbbf7aa01f948405793bd2594b9b34c0ee8792a8def23bc1cce792d09
|
|
7
|
+
data.tar.gz: e8a69a3581ad3948cf51acf3756159392291bb517cb79c10b10ef9cee792e8fcc33402d1a17a6e7ff85f30bb68bd1f17d97445bf851ad99aa6e5e6b7adb838a5
|
|
@@ -45,6 +45,12 @@ module CsvImportMagic
|
|
|
45
45
|
@csv ||= begin
|
|
46
46
|
content = Paperclip.io_adapters.for(@importer.attachment).read.force_encoding('UTF-8')
|
|
47
47
|
content = content.encode('UTF-8', content.encoding, invalid: :replace, undef: :replace)
|
|
48
|
+
|
|
49
|
+
if !content.nil?
|
|
50
|
+
content = content.gsub(/\r/, "\n")
|
|
51
|
+
content = content.gsub(/\n\n/, "\n")
|
|
52
|
+
end
|
|
53
|
+
|
|
48
54
|
::CSV.parse(content, headers: true, col_sep: column_separator)
|
|
49
55
|
end
|
|
50
56
|
end
|
|
Binary file
|
data/spec/dummy/db/test.sqlite3
CHANGED
|
Binary file
|
|
@@ -5487,3 +5487,16 @@ Started GET "/assets/application.self-d885a0a66bd595c10edb24f8879f94e334d88be073
|
|
|
5487
5487
|
|
|
5488
5488
|
|
|
5489
5489
|
Started GET "/assets/application.self-8f06a73c35179188914ab50e057157639fce1401c1cdca640ac9cec33746fc5b.js?body=1" for ::1 at 2017-01-25 19:18:32 -0200
|
|
5490
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
|
5491
|
+
Migrating to AddsAdditionalDataToImporters (20170405100034)
|
|
5492
|
+
[1m[35m (0.0ms)[0m begin transaction
|
|
5493
|
+
[1m[36m (0.9ms)[0m [1mALTER TABLE "importers" ADD "additional_data" varchar[0m
|
|
5494
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170405100034"]]
|
|
5495
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
|
5496
|
+
Migrating to AddsAdditionalAttributesToCompany (20170505100034)
|
|
5497
|
+
[1m[35m (0.1ms)[0m begin transaction
|
|
5498
|
+
[1m[36m (0.3ms)[0m [1mALTER TABLE "companies" ADD "one_additional_attribute" varchar[0m
|
|
5499
|
+
[1m[35m (0.1ms)[0m ALTER TABLE "companies" ADD "other_additional_attribute" varchar
|
|
5500
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20170505100034"]]
|
|
5501
|
+
[1m[35m (0.8ms)[0m commit transaction
|
|
5502
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|