idata 1.1.5 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/iload +7 -3
- data/idata.gemspec +1 -1
- data/lib/idata/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ce49ef4962ee5264c4166e4d524eb6d4306eff1
|
4
|
+
data.tar.gz: 16db8ce51ed766793d62d9d1fb3163e71d7e0d25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d0928426d94b28d6d564e778f9e89884c37a068502f45e03bb45144704d82422f68d35c955ab715d9af535e0fb91e9346af16a742182358e7bce9be31b385a0
|
7
|
+
data.tar.gz: f52c6a24554d1757d6c97d22a3cac240a7455ad49e768d39de605e57fc00291d1aaa2dc47ec1ceda47674e767d6019cfdc28d49d3ef0095b75ece24515e26cee
|
data/bin/iload
CHANGED
@@ -296,7 +296,7 @@ class MyParser
|
|
296
296
|
# Serialize array into a new CSV (with standard delimiter, quote) for later use with PostgreSQL
|
297
297
|
CSV.open($tmpfile, "wb", :col_sep => CSV_DEFAULT_DELIMITER, :quote_char => CSV_DEFAULT_QUOTE) do |writer|
|
298
298
|
csv_data.each do |csv|
|
299
|
-
writer << csv
|
299
|
+
writer << csv unless csv.empty? # performance caveat here
|
300
300
|
end
|
301
301
|
end
|
302
302
|
|
@@ -363,9 +363,13 @@ class MyParser
|
|
363
363
|
else
|
364
364
|
drop_table_sql = ""
|
365
365
|
end
|
366
|
-
|
366
|
+
|
367
367
|
create_table_sql = headers.map{|e| "\"#{e}\" text"}.join(",")
|
368
|
-
|
368
|
+
if headers.include? 'id'
|
369
|
+
create_table_sql = "create table if not exists #{$options[:table]}( #{create_table_sql} );"
|
370
|
+
else
|
371
|
+
create_table_sql = "create table if not exists #{$options[:table]}( id serial not null, #{create_table_sql} );"
|
372
|
+
end
|
369
373
|
query(drop_table_sql, create_table_sql)
|
370
374
|
|
371
375
|
insert_data_sql = headers.map{|e| "\"#{e}\""}.join(",")
|
data/idata.gemspec
CHANGED
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.3"
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
|
25
|
-
spec.add_dependency "rails", "
|
25
|
+
spec.add_dependency "rails", "~> 4.2"
|
26
26
|
spec.add_dependency "pg", "~> 0.16"
|
27
27
|
end
|
data/lib/idata/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nghi Pham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '4.
|
47
|
+
version: '4.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '4.
|
54
|
+
version: '4.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: pg
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|