td-client 0.8.40 → 0.8.41

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.
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ == 2012-01-10 version 0.8.41
2
+
3
+ * Fix API#job_result_format to handle Content-Encoding properly
4
+
5
+
1
6
  == 2012-12-27 version 0.8.40
2
7
 
3
8
  * Add Table#last_import to use counter_updated_at column
data/lib/td/client/api.rb CHANGED
@@ -408,18 +408,22 @@ class API
408
408
  end
409
409
 
410
410
  def job_result_format(job_id, format, io=nil)
411
- code, body, res = get("/v3/job/result/#{e job_id}", {'format'=>format}) {|res|
412
- if res.code != "200"
413
- raise_error("Get job result failed", res)
414
- end
415
- if io
411
+ if io
412
+ code, body, res = get("/v3/job/result/#{e job_id}", {'format'=>format}) {|res|
413
+ if res.code != "200"
414
+ raise_error("Get job result failed", res)
415
+ end
416
416
  res.each_fragment {|fragment|
417
417
  io.write(fragment)
418
418
  }
419
+ }
420
+ nil
421
+ else
422
+ code, body, res = get("/v3/job/result/#{e job_id}", {'format'=>format})
423
+ if res.code != "200"
424
+ raise_error("Get job result failed", res)
419
425
  end
420
- }
421
- unless io
422
- return body
426
+ body
423
427
  end
424
428
  end
425
429
 
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.8.40'
3
+ VERSION = '0.8.41'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.40
4
+ version: 0.8.41
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-12-27 00:00:00.000000000 Z
12
+ date: 2013-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack