td 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +6 -0
- data/appveyor.yml +1 -2
- data/lib/td/command/connector.rb +2 -2
- data/lib/td/command/table.rb +1 -1
- data/lib/td/updater.rb +1 -1
- data/lib/td/version.rb +1 -1
- data/spec/td/command/import_spec.rb +1 -1
- data/spec/td/command/table_spec.rb +43 -1
- data/td.gemspec +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 578d2e406b4dc27d5b95c15ead295ee6ad177f1d
|
4
|
+
data.tar.gz: 35c5f56731a8d9dade9e0992796af12af6a31e27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed9cd10e2fd21cf386d40d72b0799e828e812f83c531a92bfe98d8eeced6fd236b9590d89c7c8d6857d26b5d026fa2a4b42634880fe5548a832ddc562ff245ad
|
7
|
+
data.tar.gz: 04314077f5d84ce559f975701d027d7762260fc5deccd96cda3bae3f6cb96b744538c4b0a42f62abcfe92db245d2dff73f01f7a2b63685e5c43ab2283ee1a501
|
data/ChangeLog
CHANGED
data/appveyor.yml
CHANGED
data/lib/td/command/connector.rb
CHANGED
@@ -161,7 +161,7 @@ module Command
|
|
161
161
|
|
162
162
|
client = get_client()
|
163
163
|
# TODO database and table is empty at present. Fix API or Client.
|
164
|
-
keys = ['name', 'cron', 'timezone', 'delay', 'database', 'table'
|
164
|
+
keys = ['name', 'cron', 'timezone', 'delay', 'database', 'table']
|
165
165
|
fields = keys.map { |e| e.capitalize.to_sym }
|
166
166
|
rows = client.bulk_load_list().sort_by { |e|
|
167
167
|
e['name']
|
@@ -169,7 +169,7 @@ module Command
|
|
169
169
|
Hash[fields.zip(e.values_at(*keys))]
|
170
170
|
}
|
171
171
|
|
172
|
-
$stdout.puts cmd_render_table(rows, :fields => fields, :render_format => op.render_format)
|
172
|
+
$stdout.puts cmd_render_table(rows, :fields => fields, :render_format => op.render_format, resize: false)
|
173
173
|
end
|
174
174
|
|
175
175
|
def connector_create(op)
|
data/lib/td/command/table.rb
CHANGED
data/lib/td/updater.rb
CHANGED
@@ -53,7 +53,7 @@ module ModuleDefinition
|
|
53
53
|
def get_client_version_file(path)
|
54
54
|
td_gems = Dir[File.join(path, "vendor/gems/td-*")]
|
55
55
|
td_gems.each { |td_gem|
|
56
|
-
if
|
56
|
+
if /[\/\\]td-\d+.\d+.\d+\z/ =~ td_gem
|
57
57
|
return File.join(td_gem, "/lib/td/version.rb")
|
58
58
|
end
|
59
59
|
}
|
data/lib/td/version.rb
CHANGED
@@ -347,7 +347,7 @@ module TreasureData::Command
|
|
347
347
|
%w(--columns --column-header).each do |opt|
|
348
348
|
context "with #{opt}" do
|
349
349
|
let(:args) { ['url'] }
|
350
|
-
let(:arguments) { ["path/to/prefix_*.csv", '--format', 'csv', opt, 'col1,col2'] }
|
350
|
+
let(:arguments) { ["path/to/prefix_*.csv", '--format', 'csv', opt, 'col1,col2', '-o', out_file.path] }
|
351
351
|
|
352
352
|
it "#{opt} is not migrate" do
|
353
353
|
expect { command.import_config(option) }.not_to raise_error
|
@@ -199,7 +199,6 @@ module TreasureData::Command
|
|
199
199
|
|
200
200
|
it 'create table' do
|
201
201
|
command.should_receive(:create_database_and_table_if_not_exist).with(client, db_name, table_name)
|
202
|
-
|
203
202
|
command.table_import(option)
|
204
203
|
end
|
205
204
|
end
|
@@ -211,7 +210,50 @@ module TreasureData::Command
|
|
211
210
|
|
212
211
|
it 'not create table' do
|
213
212
|
command.should_not_receive(:create_database_and_table_if_not_exist)
|
213
|
+
command.table_import(option)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
describe 'time key' do
|
219
|
+
before do
|
220
|
+
command.stub(:get_client) { client }
|
221
|
+
command.stub(:do_table_import)
|
222
|
+
end
|
223
|
+
let(:input_params) {{
|
224
|
+
db_name: "database",
|
225
|
+
table_name: "table",
|
226
|
+
paths: ["path"]
|
227
|
+
}}
|
228
|
+
|
229
|
+
context 'should specify the custom time key' do
|
230
|
+
['-t', '--time-key'].each do |tk_option|
|
231
|
+
let(:option) {
|
232
|
+
List::CommandParser.new('table:import', [], %w(db_name table_name path), false, [db_name, table_name, 'path', tk_option, 'created_at'], true)
|
233
|
+
}
|
234
|
+
|
235
|
+
before do
|
236
|
+
input_params[:time_key] = 'created_at'
|
237
|
+
end
|
238
|
+
|
239
|
+
it "with '#{tk_option}' option" do
|
240
|
+
command.should_receive(:do_table_import).with(client, input_params)
|
241
|
+
command.table_import(option)
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
context 'should use default time key \'time\'' do
|
247
|
+
let(:option) {
|
248
|
+
List::CommandParser.new('table:import', [], %w(db_name table_name path), false, [db_name, table_name, 'path'], true)
|
249
|
+
}
|
250
|
+
|
251
|
+
before do
|
252
|
+
input_params[:time_key] = 'time'
|
253
|
+
end
|
214
254
|
|
255
|
+
it 'without \'-t / --time-key\' option' do
|
256
|
+
command.should_receive(:do_table_import).with(client, input_params)
|
215
257
|
command.table_import(option)
|
216
258
|
end
|
217
259
|
end
|
data/td.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |gem|
|
|
21
21
|
gem.add_dependency "yajl-ruby", "~> 1.1"
|
22
22
|
gem.add_dependency "hirb", ">= 0.4.5"
|
23
23
|
gem.add_dependency "parallel", "~> 0.6.1"
|
24
|
-
gem.add_dependency "td-client", "~> 0.8.
|
24
|
+
gem.add_dependency "td-client", "~> 0.8.77"
|
25
25
|
gem.add_dependency "td-logger", "~> 0.3.21"
|
26
26
|
gem.add_dependency "rubyzip", "~> 1.1.7"
|
27
27
|
gem.add_dependency "zip-zip", "~> 0.3"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: td
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Treasure Data, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -102,14 +102,14 @@ dependencies:
|
|
102
102
|
requirements:
|
103
103
|
- - "~>"
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.8.
|
105
|
+
version: 0.8.77
|
106
106
|
type: :runtime
|
107
107
|
prerelease: false
|
108
108
|
version_requirements: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
110
|
- - "~>"
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.8.
|
112
|
+
version: 0.8.77
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: td-logger
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
@@ -350,4 +350,3 @@ test_files:
|
|
350
350
|
- spec/td/helpers_spec.rb
|
351
351
|
- spec/td/updater_spec.rb
|
352
352
|
- spec/td/version_spec.rb
|
353
|
-
has_rdoc: false
|