td 0.10.69 → 0.10.70

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ == 2013-01-25 version 0.10.70
2
+
3
+ * Add status to job subcommand, td job:status job_id
4
+ * td-client v0.8.45
5
+
6
+
1
7
  == 2013-01-23 version 0.10.69
2
8
 
3
9
  * Fixed the undefined local variable problem of table:list when no databases
@@ -154,6 +154,13 @@ module Command
154
154
  $stderr.puts "Use '-v' option to show detailed messages." unless verbose
155
155
  end
156
156
 
157
+ def job_status(op)
158
+ job_id = op.cmd_parse
159
+ client = get_client
160
+
161
+ puts client.job_status(job_id)
162
+ end
163
+
157
164
  def job_kill(op)
158
165
  job_id = op.cmd_parse
159
166
 
@@ -106,7 +106,7 @@ module List
106
106
  op.summary_indent = " "
107
107
 
108
108
  if msg = @override_message
109
- (class<<op;self;end).module_eval do
109
+ (class << op;self;end).module_eval do
110
110
  define_method(:to_s) { msg }
111
111
  end
112
112
  end
@@ -267,6 +267,7 @@ module List
267
267
  add_list 'query', %w[sql], 'Issue a query', 'query -d example_db -w -r rset1 "select count(*) from table1"'
268
268
 
269
269
  add_list 'job:show', %w[job_id], 'Show status and result of a job', 'job 1461'
270
+ add_list 'job:status', %w[job_id], 'Show status progress of a job', 'job:status 1461'
270
271
  add_list 'job:list', %w[max?], 'Show list of jobs', 'jobs', 'jobs --page 1'
271
272
  add_list 'job:kill', %w[job_id], 'Kill or cancel a job', 'job:kill 1461'
272
273
 
@@ -29,7 +29,7 @@ EOF
29
29
 
30
30
  op.summary_indent = " "
31
31
 
32
- (class<<self;self;end).module_eval do
32
+ (class << self;self;end).module_eval do
33
33
  define_method(:usage) do |errmsg|
34
34
  require 'td/command/list'
35
35
  puts op.to_s
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.10.69'
3
+ VERSION = '0.10.70'
4
4
 
5
5
  end
@@ -14,3 +14,30 @@ if ENV['SIMPLE_COV']
14
14
  add_filter 'vendor/'
15
15
  end
16
16
  end
17
+
18
+ require 'td/command/runner'
19
+
20
+ def execute_td(command_line)
21
+ args = command_line.split(" ")
22
+ original_stdin, original_stderr, original_stdout = $stdin, $stderr, $stdout
23
+
24
+ $stdin = captured_stdin = StringIO.new
25
+ $stderr = captured_stderr = StringIO.new
26
+ $stdout = captured_stdout = StringIO.new
27
+ class << captured_stdout
28
+ def tty?
29
+ true
30
+ end
31
+ end
32
+
33
+ begin
34
+ runner = TreasureData::Command::Runner.new
35
+ $0 = 'td'
36
+ runner.run(args)
37
+ rescue SystemExit
38
+ ensure
39
+ $stdin, $stderr, $stdout = original_stdin, original_stderr, original_stdout
40
+ end
41
+
42
+ [captured_stderr.string, captured_stdout.string]
43
+ end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ module TreasureData::Command
4
+ describe '--version' do
5
+ it "shows version" do
6
+ stderr, stdout = execute_td("--version")
7
+ stderr.should == ""
8
+ stdout.should == <<-STDOUT
9
+ td #{TreasureData::VERSION}
10
+ STDOUT
11
+ end
12
+ end
13
+ end
data/td.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.add_dependency "yajl-ruby", "~> 1.1.0"
21
21
  gem.add_dependency "hirb", ">= 0.4.5"
22
22
  gem.add_dependency "parallel", "~> 0.5.19"
23
- gem.add_dependency "td-client", "~> 0.8.43"
23
+ gem.add_dependency "td-client", "~> 0.8.45"
24
24
  gem.add_dependency "td-logger", "~> 0.3.16"
25
25
  gem.add_development_dependency "rake", "~> 0.9"
26
26
  gem.add_development_dependency "rspec", "~> 2.10.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.69
4
+ version: 0.10.70
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-23 00:00:00.000000000 Z
12
+ date: 2013-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - ~>
84
84
  - !ruby/object:Gem::Version
85
- version: 0.8.43
85
+ version: 0.8.45
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
- version: 0.8.43
93
+ version: 0.8.45
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: td-logger
96
96
  requirement: !ruby/object:Gem::Requirement
@@ -222,6 +222,7 @@ files:
222
222
  - spec/file_reader/shared_context.rb
223
223
  - spec/file_reader_spec.rb
224
224
  - spec/spec_helper.rb
225
+ - spec/td/version_spec.rb
225
226
  - td.gemspec
226
227
  homepage: http://treasure-data.com/
227
228
  licenses: []
@@ -237,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
237
238
  version: '0'
238
239
  segments:
239
240
  - 0
240
- hash: -4306529652895121788
241
+ hash: -3004606412038514569
241
242
  required_rubygems_version: !ruby/object:Gem::Requirement
242
243
  none: false
243
244
  requirements:
@@ -246,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
246
247
  version: '0'
247
248
  segments:
248
249
  - 0
249
- hash: -4306529652895121788
250
+ hash: -3004606412038514569
250
251
  requirements: []
251
252
  rubyforge_project:
252
253
  rubygems_version: 1.8.23
@@ -261,3 +262,4 @@ test_files:
261
262
  - spec/file_reader/shared_context.rb
262
263
  - spec/file_reader_spec.rb
263
264
  - spec/spec_helper.rb
265
+ - spec/td/version_spec.rb