ctoD 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ctoD/db.rb +2 -2
- data/lib/ctoD/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e659f7965bf040105156fef5a58e1ba45cbe0b67
|
4
|
+
data.tar.gz: 4fb16794c736fc8861e8447abf4fd532d95ed28b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba3bb7e0ecf2990306b8e63c671eecdb8d6a6e311f01ef6698f8cacc59486b8d8e1475ae50f34ba40841f282a4624c376d15e550a96d551b395694b30b1dfae0
|
7
|
+
data.tar.gz: b571ad050e1a6288fe93891ff83aae43ce791e301522c6708a4e37f416dcc0451483b01efcbe65c128dd0fe977c67853f025801945d553ca5e72195f793785c4
|
data/lib/ctoD/db.rb
CHANGED
@@ -11,7 +11,7 @@ module CtoD
|
|
11
11
|
def initialize(csv, uri, string_size:100)
|
12
12
|
@table_name = File.basename(csv, '.csv').intern
|
13
13
|
@class_name = singularize(@table_name).capitalize
|
14
|
-
@csv = CSV.table(csv)
|
14
|
+
@csv = CSV.table(csv, header_converters:->h{h.strip})
|
15
15
|
@string_size = string_size
|
16
16
|
@uri = DB.connect(uri)
|
17
17
|
end
|
@@ -58,7 +58,7 @@ module CtoD
|
|
58
58
|
|
59
59
|
private
|
60
60
|
def column_types
|
61
|
-
is_date = /^\s*\d{1,4}(\-|\/)
|
61
|
+
is_date = /^\s*\d{1,4}(\-|\/)\d{1,2}(\-|\/)\d{1,2}\s*$/
|
62
62
|
@csv.first.to_hash.inject([]) do |mem, (k, v)|
|
63
63
|
mem << begin
|
64
64
|
case v
|
data/lib/ctoD/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ctoD
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kyoendo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|