td 0.13.0 → 0.13.1

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: f7b9e3d57fd08024e999160fe1678031a293941e
4
- data.tar.gz: 39454d414e3afddb9e83fcf3e3c574c98911536f
3
+ metadata.gz: 578d2e406b4dc27d5b95c15ead295ee6ad177f1d
4
+ data.tar.gz: 35c5f56731a8d9dade9e0992796af12af6a31e27
5
5
  SHA512:
6
- metadata.gz: d4846a9e5e75112f0350cbb4824e5335cb2861fabc927ddcacefe81a9a4894af08da0903920db5d1b4fcfd170b571341e5b41a77293c7a572df92ca4eec487e1
7
- data.tar.gz: 0909c9942d35536d644db19f3ad0c3bf219d78ad59388ef8cee92af5c7f0d3271c4779503d5268dda0bd65cc2bcbaf231c3d5f02369b43dbcef0af50f77c364b
6
+ metadata.gz: ed9cd10e2fd21cf386d40d72b0799e828e812f83c531a92bfe98d8eeced6fd236b9590d89c7c8d6857d26b5d026fa2a4b42634880fe5548a832ddc562ff245ad
7
+ data.tar.gz: 04314077f5d84ce559f975701d027d7762260fc5deccd96cda3bae3f6cb96b744538c4b0a42f62abcfe92db245d2dff73f01f7a2b63685e5c43ab2283ee1a501
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ == 2015-12-14 version 0.13.1
2
+
3
+ * fix table:import with no '-t' or '--time-key' option
4
+ * fix show names on connector:list
5
+ * fix create unnecessary file in spec
6
+
1
7
  == 2015-10-29 version 0.13.0
2
8
 
3
9
  * fix command error when recive 40X errror from server
@@ -5,8 +5,7 @@ install:
5
5
  - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
6
6
  - ruby --version
7
7
  - gem --version
8
- - gem install bundler --quiet --no-ri --no-rdoc
9
- - bundler --version
8
+ - bundle --version
10
9
  - bundle install
11
10
  build_script:
12
11
  - bundle exec rake build
@@ -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', 'config', 'config_diff']
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)
@@ -384,7 +384,7 @@ module Command
384
384
  time_key = 'time'
385
385
  auto_create = false
386
386
 
387
- import_params = {}
387
+ import_params = {time_key: time_key}
388
388
 
389
389
  op.on('--format FORMAT', "file format (default: #{format})") {|s|
390
390
  import_params[:format] = s
@@ -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 td_gem =~ /#{"#{Regexp.escape(path)}\/vendor\/gems\/td-\\d*.\\d*.\\d*"}/
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
  }
@@ -1,3 +1,3 @@
1
1
  module TreasureData
2
- TOOLBELT_VERSION = '0.13.0'
2
+ TOOLBELT_VERSION = '0.13.1'
3
3
  end
@@ -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.76"
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.0
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-04 00:00:00.000000000 Z
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.76
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.76
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