td 0.11.11.2 → 0.11.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +10 -1
- data/lib/td/command/job.rb +1 -1
- data/lib/td/command/options.rb +12 -6
- data/lib/td/command/query.rb +5 -6
- data/lib/td/version.rb +1 -1
- data/spec/td/command/job_spec.rb +8 -1
- data/td.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36266b9c823ecc10de37fafc29ed07458a50a728
|
4
|
+
data.tar.gz: 92ec61eb2983e7b284565252729aaedadf1483f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 545c05fd90e3577b175d732742182fca1bdd02dd9bf58666213006e89c0033e6ded3410cd610cc4f503b67db1f6e0f630d75249f33cd4f1ab56c326f0106b380
|
7
|
+
data.tar.gz: 92ff25f768e6a82dceb87fddb41e395624a2de9b0e8bd64160b584f709cf28bfaaa7790f8cd5bfc3fe2de7169cf3d7305d99024eaafc2afec7a2735d51eb70ae
|
data/ChangeLog
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
-
== 2015-07-
|
1
|
+
== 2015-07-27 version 0.11.12
|
2
|
+
|
3
|
+
* query command support msgpack.gz format save
|
4
|
+
* fix `--format msgpack.gz` save gz format.
|
5
|
+
If you want the operation up to this, please use `--format msgpack`.
|
6
|
+
* update td-client version.
|
7
|
+
This update is required in order to be able to save in gz format.
|
8
|
+
And, include update httpclient dependency version.
|
9
|
+
|
10
|
+
== 2015-07-23 version 0.11.11.2
|
2
11
|
|
3
12
|
* downgrade bundle ruby version for windows(2.2.2 -> 1.9.3).
|
4
13
|
* downgrade dependency td-client version (0.8.71 -> 0.8.70).
|
data/lib/td/command/job.rb
CHANGED
@@ -415,7 +415,7 @@ private
|
|
415
415
|
indicator = Command::SizeBasedDownloadProgressIndicator.new(
|
416
416
|
"NOTE: the job result is being written to #{output} in msgpack.gz format",
|
417
417
|
job.result_size, 0.1, 1)
|
418
|
-
job.
|
418
|
+
job.result_raw('msgpack.gz', f) {|compr_size|
|
419
419
|
indicator.update(compr_size)
|
420
420
|
}
|
421
421
|
indicator.finish
|
data/lib/td/command/options.rb
CHANGED
@@ -28,12 +28,6 @@ module Options
|
|
28
28
|
opts[:output] = s
|
29
29
|
opts[:format] ||= 'tsv'
|
30
30
|
}
|
31
|
-
op.on('-f', '--format FORMAT', 'format of the result to write to the file (tsv, csv, json, msgpack, and msgpack.gz)') {|s|
|
32
|
-
unless ['tsv', 'csv', 'json', 'msgpack', 'msgpack.gz'].include?(s)
|
33
|
-
raise "Unknown format #{s.dump}. Supported formats are: tsv, csv, json, msgpack, and msgpack.gz"
|
34
|
-
end
|
35
|
-
opts[:format] = s
|
36
|
-
}
|
37
31
|
op.on('-l', '--limit ROWS', 'limit the number of result rows shown when not outputting to file') {|s|
|
38
32
|
unless s.to_i > 0
|
39
33
|
raise "Invalid limit number. Must be a positive integer"
|
@@ -52,10 +46,22 @@ module Options
|
|
52
46
|
opts[:render_opts][:null_expr] = s.to_s
|
53
47
|
}
|
54
48
|
|
49
|
+
write_format_option(op) {|s| opts[:format] = s }
|
50
|
+
|
55
51
|
# CAUTION: this opts is filled by op.cmd_parse
|
56
52
|
opts
|
57
53
|
end
|
58
54
|
|
55
|
+
def write_format_option(op)
|
56
|
+
op.on('-f', '--format FORMAT', 'format of the result to write to the file (tsv, csv, json, msgpack, and msgpack.gz)') {|s|
|
57
|
+
unless ['tsv', 'csv', 'json', 'msgpack', 'msgpack.gz'].include?(s)
|
58
|
+
raise "Unknown format #{s.dump}. Supported formats are: tsv, csv, json, msgpack, and msgpack.gz"
|
59
|
+
end
|
60
|
+
|
61
|
+
yield(s)
|
62
|
+
}
|
63
|
+
end
|
64
|
+
module_function :write_format_option
|
59
65
|
end # module Options
|
60
66
|
end # module Command
|
61
67
|
end # module TreasureData
|
data/lib/td/command/query.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'td/command/options'
|
2
|
+
|
1
3
|
module TreasureData
|
2
4
|
module Command
|
3
5
|
|
@@ -34,12 +36,9 @@ module Command
|
|
34
36
|
output = s
|
35
37
|
format = 'tsv' if format.nil?
|
36
38
|
}
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
41
|
-
format = s
|
42
|
-
}
|
39
|
+
|
40
|
+
TreasureData::Command::Options.write_format_option(op) {|s| format = s }
|
41
|
+
|
43
42
|
op.on('-r', '--result RESULT_URL', 'write result to the URL (see also result:create subcommand)',
|
44
43
|
' It is suggested for this option to be used with the -x / --exclude option to suppress printing',
|
45
44
|
' of the query result to stdout or -o / --output to dump the query result into a file.') {|s|
|
data/lib/td/version.rb
CHANGED
data/spec/td/command/job_spec.rb
CHANGED
@@ -22,7 +22,6 @@ module TreasureData::Command
|
|
22
22
|
@result_size = 3
|
23
23
|
@status = 'success'
|
24
24
|
end
|
25
|
-
job.stub(:result_format) # for msgpack, msgpack.gz
|
26
25
|
job
|
27
26
|
end
|
28
27
|
|
@@ -73,6 +72,10 @@ module TreasureData::Command
|
|
73
72
|
context "format: msgpack" do
|
74
73
|
let(:format) { "msgpack" }
|
75
74
|
|
75
|
+
before do
|
76
|
+
job.stub(:result_format) # for msgpack
|
77
|
+
end
|
78
|
+
|
76
79
|
it do
|
77
80
|
FileUtils.should_receive(:mv).with(tempfile, file.path)
|
78
81
|
subject
|
@@ -86,6 +89,10 @@ module TreasureData::Command
|
|
86
89
|
context "format: msgpack.gz" do
|
87
90
|
let(:format) { "msgpack.gz" }
|
88
91
|
|
92
|
+
before do
|
93
|
+
job.stub(:result_raw) # for msgpack.gz
|
94
|
+
end
|
95
|
+
|
89
96
|
it do
|
90
97
|
FileUtils.should_receive(:mv).with(tempfile, file.path)
|
91
98
|
subject
|
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.72"
|
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.11.
|
4
|
+
version: 0.11.12
|
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-07-
|
11
|
+
date: 2015-07-27 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.72
|
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.72
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: td-logger
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
@@ -330,3 +330,4 @@ test_files:
|
|
330
330
|
- spec/td/helpers_spec.rb
|
331
331
|
- spec/td/updater_spec.rb
|
332
332
|
- spec/td/version_spec.rb
|
333
|
+
has_rdoc: false
|