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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee8c06be7ed48caab9e76b6e39544b812849ce3f
4
- data.tar.gz: 396a15578b4a4fff1636926b3e71b36fca74f830
3
+ metadata.gz: 0ce49ef4962ee5264c4166e4d524eb6d4306eff1
4
+ data.tar.gz: 16db8ce51ed766793d62d9d1fb3163e71d7e0d25
5
5
  SHA512:
6
- metadata.gz: 8819c2ba1c7e628a287d2f0ed7e753c0e43f685a04446f0e94da9cf7bf7f36ac970391ea2c347eb45bd88e36be8111d53fb345788ea5746587a5565776eb4ea3
7
- data.tar.gz: b0dfe2066c4802aca25639676b1719d8f95c5fcbcdc11a5992e9c1342b81b9b3f11aa367c2557afda79e8b9a8e36c49327dd9b6ee7ba0bd30b36d45d701f193c
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
- create_table_sql = "create table if not exists #{$options[:table]}( id serial not null, #{create_table_sql} );"
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", ">= 4.0"
25
+ spec.add_dependency "rails", "~> 4.2"
26
26
  spec.add_dependency "pg", "~> 0.16"
27
27
  end
data/lib/idata/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Idata
2
- VERSION = "1.1.5"
2
+ VERSION = "1.1.6"
3
3
  end
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.5
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-03-24 00:00:00.000000000 Z
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.0'
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.0'
54
+ version: '4.2'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pg
57
57
  requirement: !ruby/object:Gem::Requirement