samidare 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e667f045b627932973bb7818c2c3fc6a3f7450a1
4
- data.tar.gz: 9bc577d40f8abe15dc27136b7add5b3813b93e8c
3
+ metadata.gz: aa6eff2457ffc6b011ac5964a02aee5808f22178
4
+ data.tar.gz: 2c9a55067831fad943ad9900894deaacd8f0dc71
5
5
  SHA512:
6
- metadata.gz: 0e52080a119b57b13a4badf68056ffe6e92c31b7e67e9d240b8891cad7f3583d0463e790ef1d9e5dbef26f700247b3468c9ed160d86bb9b854ac8ae0738e43b1
7
- data.tar.gz: b22a32d057449f8688228c33148475049d2219e2a02d7ce9399ba682fd6481ee7c93a8e8444b4471fa4aa988f1b5a3e4b7038bfce40718f1f9d22e7a4b462db1
6
+ metadata.gz: 4cb4b1a5ab045538a6b936e11820c53df438d356528e0ca79c4b220b7997de560e0b35cf071b7bdb3f31a18f584f0810d9d83e8ecf17a6572abf1c2e5fdefc4a
7
+ data.tar.gz: 622a00ae3eb3f3566d99a3415bccbfe2f67ed83d33068519d97aefe5eca591d92dc0d674748acc9716a6b4c8691328238ae09bddaf93348688cd3b97b1e2331b
@@ -32,7 +32,7 @@ module Samidare
32
32
  log "table: #{table.name} - does not exist"
33
33
  end
34
34
 
35
- cmd = "embulk run #{ENV['EMBULK_CONFIG_DIR']}/#{db_name}/#{table.name}.yml"
35
+ cmd = "embulk run #{config['config_dir']}/#{db_name}/#{table.name}.yml"
36
36
  log "cmd: #{cmd}"
37
37
  result = system(cmd) ? 'success' : 'error'
38
38
 
@@ -54,7 +54,7 @@ module Samidare
54
54
  password = db_info['password']
55
55
  database = db_info['database']
56
56
  query = Samidare::BigQueryUtility.generate_sql(table_info.name, column_infos)
57
- project = @config['project_name']
57
+ project = @config['project_id']
58
58
  p12_keyfile_path = @config['key']
59
59
  service_account_email = @config['service_email']
60
60
  dataset = db_info['bq_dataset']
@@ -117,10 +117,15 @@ module Samidare
117
117
  TYPE_MAPPINGS = {
118
118
  'int' => 'integer',
119
119
  'tinyint' => 'integer',
120
+ 'smallint' => 'integer',
121
+ 'mediumint' => 'integer',
120
122
  'bigint' => 'integer',
123
+ 'float' => 'float',
121
124
  'double' => 'float',
122
125
  'decimal' => 'float',
126
+ 'char' => 'string',
123
127
  'varchar' => 'string',
128
+ 'tinytext' => 'string',
124
129
  'text' => 'string',
125
130
  'date' => 'timestamp',
126
131
  'datetime' => 'timestamp',
@@ -1,3 +1,3 @@
1
1
  module Samidare
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -21,11 +21,26 @@ describe Samidare::EmbulkUtility::ColumnInfo do
21
21
  it { expect(subject).to eq 'integer' }
22
22
  end
23
23
 
24
+ context 'smallint' do
25
+ let(:data_type) { 'smallint' }
26
+ it { expect(subject).to eq 'integer' }
27
+ end
28
+
29
+ context 'mediumint' do
30
+ let(:data_type) { 'mediumint' }
31
+ it { expect(subject).to eq 'integer' }
32
+ end
33
+
24
34
  context 'bigint' do
25
35
  let(:data_type) { 'bigint' }
26
36
  it { expect(subject).to eq 'integer' }
27
37
  end
28
38
 
39
+ context 'float' do
40
+ let(:data_type) { 'float' }
41
+ it { expect(subject).to eq 'float' }
42
+ end
43
+
29
44
  context 'double' do
30
45
  let(:data_type) { 'double' }
31
46
  it { expect(subject).to eq 'float' }
@@ -36,11 +51,21 @@ describe Samidare::EmbulkUtility::ColumnInfo do
36
51
  it { expect(subject).to eq 'float' }
37
52
  end
38
53
 
54
+ context 'char' do
55
+ let(:data_type) { 'char' }
56
+ it { expect(subject).to eq 'string' }
57
+ end
58
+
39
59
  context 'varchar' do
40
60
  let(:data_type) { 'varchar' }
41
61
  it { expect(subject).to eq 'string' }
42
62
  end
43
63
 
64
+ context 'tinytext' do
65
+ let(:data_type) { 'tinytext' }
66
+ it { expect(subject).to eq 'string' }
67
+ end
68
+
44
69
  context 'text' do
45
70
  let(:data_type) { 'text' }
46
71
  it { expect(subject).to eq 'string' }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: samidare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryoji Kobori
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-20 00:00:00.000000000 Z
11
+ date: 2015-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -201,3 +201,4 @@ test_files:
201
201
  - spec/samidare/embulk_utility_spec.rb
202
202
  - spec/samidare_spec.rb
203
203
  - spec/spec_helper.rb
204
+ has_rdoc: