td-client 0.8.22 → 0.8.23

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ == 2012-08-30 version 0.8.23
3
+
4
+ * Supports HTTP_PROXY environment variable
5
+
6
+
2
7
  == 2012-08-20 version 0.8.22
3
8
 
4
9
  * Top-level resource models support org_name parameter
@@ -137,7 +137,7 @@ class Client
137
137
 
138
138
  # => result:String
139
139
  def job_result_format(job_id, format, io=nil)
140
- @api.job_result_format(job_id, format, io=nil)
140
+ @api.job_result_format(job_id, format, io)
141
141
  end
142
142
 
143
143
  # => nil
@@ -1195,7 +1195,18 @@ class API
1195
1195
  require 'net/https'
1196
1196
  require 'time'
1197
1197
 
1198
- http = Net::HTTP.new(@host, @port)
1198
+ if proxy = ENV['HTTP_PROXY']
1199
+ if proxy =~ /\Ahttp:\/\/(.*)\z/
1200
+ proxy = $~[1]
1201
+ end
1202
+ proxy_host, proxy_port = proxy.split(':',2)
1203
+ proxy_port = (proxy_port ? proxy_port.to_i : 80)
1204
+ http_class = Net::HTTP::Proxy(proxy_host, proxy_port)
1205
+ else
1206
+ http_class = Net::HTTP
1207
+ end
1208
+
1209
+ http = http_class.new(@host, @port)
1199
1210
  if @ssl
1200
1211
  http.use_ssl = true
1201
1212
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.8.22'
3
+ VERSION = '0.8.23'
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.22
4
+ version: 0.8.23
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-08-20 00:00:00.000000000 Z
12
+ date: 2012-08-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack