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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13d9a4dc741cabfcadcfbc989d7237cb178a3b9d
4
- data.tar.gz: abadab6fbb41f6ce0b8427961280d7eb625c6b81
3
+ metadata.gz: 87b174bf90e50bae5cb6b5238e4d263a6fb2f121
4
+ data.tar.gz: 1b43e67c04b7a8ac75d280a62d7066fbfe363e6b
5
5
  SHA512:
6
- metadata.gz: 2b48cbd722d1cfe665ebe585f870859472154e06fcfc306babe0cc144c20631c5f00e7bebce32c5c8a0104313894f6c40864adfd33731e69b8fb8212cef2010a
7
- data.tar.gz: b2b02fa54ddc8b970bac620e2d43341f1e8ec1e73f09841cb4188f0fb064588d6463e928d53911c22f75d9389722019012350b0d12e73bb090a224002d61fa55
6
+ metadata.gz: 9aada956195632164e777ff056640c97cefa55cfff5fcdb91edc3e14c1858ab0745752e561531c1fe7d97245718a9aec06b62a8b3f694e3a5639b23b33d85a83
7
+ data.tar.gz: 353302379102133640298d986812b1b82b731f1ce63788f6e441c2315836834d75d780a92b78431603b1a6e6c25b49536589aacf58919c4a4767d2862faa6fad
@@ -22,5 +22,11 @@ module CtoD
22
22
  end
23
23
  db
24
24
  end
25
+
26
+ desc "version", "Show CtoD version"
27
+ def version
28
+ puts "CtoD #{CtoD::VERSION} (c) 2013 kyoendo"
29
+ end
30
+ map "-v" => :version
25
31
  end
26
32
  end
@@ -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[0..-2].capitalize
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)
@@ -1,3 +1,3 @@
1
1
  module CtoD
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -4,8 +4,4 @@ describe CtoD do
4
4
  it 'should have a version number' do
5
5
  CtoD::VERSION.should_not be_nil
6
6
  end
7
-
8
- it 'should do something useful' do
9
- false.should be_true
10
- end
11
7
  end
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.1
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-10 00:00:00.000000000 Z
11
+ date: 2013-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor