td 0.10.56 → 0.10.57

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ == 2012-10-30 version 0.10.57
3
+
4
+ * job:show and query subcommands support --format 'msgpack.gz' option
5
+ * query subcommand reads SQL from STDIN if the first argument is '-'
6
+
7
+
2
8
  == 2012-10-11 version 0.10.56
3
9
 
4
10
  * Updated td-client v0.8.33 which supports deflate and gzip compressed data
data/README.rdoc CHANGED
@@ -33,7 +33,10 @@ You need to authorize the account, before executing any other commands.
33
33
 
34
34
  == Mac OS X
35
35
 
36
- $ gem install bundler
36
+ Disable RVM and enable system ruby (/usr/bin/ruby) first.
37
+ And then run following commands:
38
+
39
+ $ sudo gem install bundler
37
40
  $ rake pkg:build
38
41
 
39
42
  == Windows
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ require 'rubygems'
1
2
  require 'bundler'
2
3
  Bundler::GemHelper.install_tasks
3
4
 
@@ -24,16 +25,15 @@ def install_use_gems(target_dir)
24
25
  puts "**"
25
26
  puts "** WARNING"
26
27
  puts "**"
27
- puts "** GEM_HOME is already set. Created package may be broken."
28
+ puts "** GEM_HOME is already set. Created package might be broken."
28
29
  puts "** RVM surely breaks the package. Use rbenv instead."
29
30
  puts "**"
30
31
  end
31
- env = {
32
- 'GEM_HOME' => target_dir,
33
- 'GEM_PATH' => '',
34
- }
32
+ # system(env, cmd) doesn't work with ruby 1.8
33
+ ENV['GEM_HOME'] = target_dir
34
+ ENV['GEM_PATH'] = ''
35
35
  USE_GEMS.each {|gem|
36
- system env, "gem install '#{gem}' --no-rdoc --no-ri"
36
+ system "gem install '#{gem}' --no-rdoc --no-ri"
37
37
  }
38
38
  end
39
39
 
@@ -52,7 +52,10 @@ def install_erb_resource(resource_name, target_path, mode, variables)
52
52
  erb_raw = File.read resource_path(resource_name)
53
53
 
54
54
  ctx = Object.new
55
- variables.each_pair {|k,v| ctx.define_singleton_method(k) { v } }
55
+ variables.each_pair {|k,v|
56
+ # ctx.define_singleton_method(k) { v } doesn't work with ruby 1.8
57
+ (class<<ctx;self;end).send(:define_method, k) { v }
58
+ }
56
59
  data = ERB.new(erb_raw).result(ctx.instance_eval("binding"))
57
60
 
58
61
  File.open(target_path, "w") do |f|
@@ -91,8 +91,8 @@ module Command
91
91
  output = s
92
92
  }
93
93
  op.on('-f', '--format FORMAT', 'format of the result to write to the file (tsv, csv, json or msgpack)') {|s|
94
- unless ['tsv', 'csv', 'json', 'msgpack'].include?(s)
95
- raise "Unknown format #{s.dump}. Supported format: tsv, csv, json, msgpack"
94
+ unless ['tsv', 'csv', 'json', 'msgpack', 'msgpack.gz'].include?(s)
95
+ raise "Unknown format #{s.dump}. Supported format: tsv, csv, json, msgpack, msgpack.gz"
96
96
  end
97
97
  format = s
98
98
  }
@@ -223,6 +223,11 @@ module Command
223
223
  job.result_format('msgpack', f)
224
224
  }
225
225
 
226
+ when 'msgpack.gz'
227
+ File.open(output, "wb") {|f|
228
+ job.result_format('msgpack.gz', f)
229
+ }
230
+
226
231
  when 'csv'
227
232
  require 'json'
228
233
  require 'csv'
@@ -54,6 +54,10 @@ module Command
54
54
  exit 1
55
55
  end
56
56
 
57
+ if sql == '-'
58
+ sql = STDIN.read
59
+ end
60
+
57
61
  if result_url
58
62
  require 'td/command/result'
59
63
  result_url = build_result_url(result_url, result_user, result_ask_password)
data/lib/td/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.10.56'
3
+ VERSION = '0.10.57'
4
4
 
5
5
  end
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.56
4
+ version: 0.10.57
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: 2012-10-11 00:00:00.000000000 Z
12
+ date: 2012-10-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack