ctoD 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ctoD/cli.rb +6 -0
- data/lib/ctoD/db.rb +2 -1
- data/lib/ctoD/version.rb +1 -1
- data/spec/ctoD_spec.rb +0 -4
- 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: 87b174bf90e50bae5cb6b5238e4d263a6fb2f121
|
4
|
+
data.tar.gz: 1b43e67c04b7a8ac75d280a62d7066fbfe363e6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aada956195632164e777ff056640c97cefa55cfff5fcdb91edc3e14c1858ab0745752e561531c1fe7d97245718a9aec06b62a8b3f694e3a5639b23b33d85a83
|
7
|
+
data.tar.gz: 353302379102133640298d986812b1b82b731f1ce63788f6e441c2315836834d75d780a92b78431603b1a6e6c25b49536589aacf58919c4a4767d2862faa6fad
|
data/lib/ctoD/cli.rb
CHANGED
data/lib/ctoD/db.rb
CHANGED
@@ -4,12 +4,13 @@ require 'active_record'
|
|
4
4
|
|
5
5
|
module CtoD
|
6
6
|
class DB
|
7
|
+
include ActiveSupport::Inflector
|
7
8
|
AR = ActiveRecord::Base
|
8
9
|
attr_accessor :string_size
|
9
10
|
attr_reader :table_name, :class_name, :uri
|
10
11
|
def initialize(csv, uri, string_size:100)
|
11
12
|
@table_name = File.basename(csv, '.csv').intern
|
12
|
-
@class_name = @table_name
|
13
|
+
@class_name = singularize(@table_name).capitalize
|
13
14
|
@csv = CSV.table(csv)
|
14
15
|
@string_size = string_size
|
15
16
|
@uri = DB.connect(uri)
|
data/lib/ctoD/version.rb
CHANGED
data/spec/ctoD_spec.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.2
|
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-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|