picasa 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -40,6 +40,10 @@ Or by setting custom authorization header, i.e. taken from OAuth authentication:
40
40
  client = Picasa::Client.new(user_id: "some.user@gmail.com", authorization_header: "OAuth token")
41
41
  ```
42
42
 
43
+ ### Proxy
44
+
45
+ You can connect via proxy server setting `https_proxy` or `HTTPS_PROXY` environment variable to valid URL.
46
+
43
47
  ## Extra
44
48
 
45
49
  You can install thor script for uploading all photos from given directory:
@@ -97,6 +101,7 @@ MultiXml.parser = :libxml
97
101
  * [jsaak](https://github.com/jsaak)
98
102
  * [Javier Guerra](https://github.com/javierg)
99
103
  * [Eiichi Takebuchi](https://github.com/GRGSIBERIA)
104
+ * [TADA Tadashi](https://github.com/tdtds)
100
105
 
101
106
  ## Copyright
102
107
 
@@ -55,7 +55,12 @@ module Picasa
55
55
 
56
56
  def http(url = API_URL)
57
57
  uri = URI.parse(url)
58
- http = Net::HTTP.new(uri.host, uri.port)
58
+
59
+ if proxy?
60
+ http = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port, proxy_uri.user, proxy_uri.password).new(uri.host, uri.port)
61
+ else
62
+ http = Net::HTTP.new(uri.host, uri.port)
63
+ end
59
64
  http.use_ssl = true
60
65
  http
61
66
  end
@@ -82,5 +87,13 @@ module Picasa
82
87
  "Content-Type" => "application/atom+xml"
83
88
  }
84
89
  end
90
+
91
+ def proxy_uri
92
+ @proxy_uri ||= URI.parse(ENV["https_proxy"] || ENV["HTTPS_PROXY"])
93
+ end
94
+
95
+ def proxy?
96
+ ENV.has_key?("https_proxy") || ENV.has_key?("HTTPS_PROXY")
97
+ end
85
98
  end
86
99
  end
@@ -1,3 +1,3 @@
1
1
  module Picasa
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picasa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
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-09-30 00:00:00.000000000 Z
12
+ date: 2012-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_xml