hipchat 0.11.0 → 0.12.0
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +0 -2
- data/README.textile +1 -0
- data/Rakefile +6 -0
- data/hipchat.gemspec +1 -0
- data/lib/hipchat.rb +14 -1
- data/lib/hipchat/version.rb +1 -1
- data/spec/hipchat_spec.rb +34 -0
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be4faa179685cdd34630559010e1f4f8433d12d2
|
4
|
+
data.tar.gz: ceb3933c95e331a8735199c0cf3f284bfdad078c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a0d5ce3f382e4ac4a4b04890361e92d7a886570752c21567c6e74c163e67b8873e15be661fc321f4c5267fd203d36dcb29a4815e22feabda17c22308862a871
|
7
|
+
data.tar.gz: 0b75dfbccbff349ca3eab259b458da322a7cc9875d0cba17fcf69183d37549231d175a9302d173083138503d6f4933e4be24ebc2027cc55c2cf1457ba8d61c69
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/README.textile
CHANGED
data/Rakefile
CHANGED
data/hipchat.gemspec
CHANGED
data/lib/hipchat.rb
CHANGED
@@ -16,8 +16,11 @@ module HipChat
|
|
16
16
|
base_uri 'https://api.hipchat.com/v1/rooms'
|
17
17
|
format :json
|
18
18
|
|
19
|
-
def initialize(token)
|
19
|
+
def initialize(token, options={})
|
20
20
|
@token = token
|
21
|
+
|
22
|
+
http_proxy = options[:http_proxy] || ENV['http_proxy']
|
23
|
+
setup_proxy(http_proxy) if http_proxy
|
21
24
|
end
|
22
25
|
|
23
26
|
def rooms
|
@@ -28,6 +31,16 @@ module HipChat
|
|
28
31
|
def [](name)
|
29
32
|
Room.new(@token, :room_id => name)
|
30
33
|
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def setup_proxy(proxy_url)
|
37
|
+
proxy_url = URI.parse(proxy_url)
|
38
|
+
|
39
|
+
self.class.http_proxy(proxy_url.host, proxy_url.port,
|
40
|
+
proxy_url.user, proxy_url.password)
|
41
|
+
HipChat::Room.http_proxy(proxy_url.host, proxy_url.port,
|
42
|
+
proxy_url.user, proxy_url.password)
|
43
|
+
end
|
31
44
|
end
|
32
45
|
|
33
46
|
class Room < OpenStruct
|
data/lib/hipchat/version.rb
CHANGED
data/spec/hipchat_spec.rb
CHANGED
@@ -172,4 +172,38 @@ describe HipChat do
|
|
172
172
|
should raise_error(HipChat::UnknownResponseCode)
|
173
173
|
end
|
174
174
|
end
|
175
|
+
|
176
|
+
describe 'http_proxy' do
|
177
|
+
let(:proxy_user) { 'proxy_user' }
|
178
|
+
let(:proxy_pass) { 'proxy_pass' }
|
179
|
+
let(:proxy_host) { 'proxy.example.com' }
|
180
|
+
let(:proxy_port) { 2649 }
|
181
|
+
let(:proxy_url) { "http://#{proxy_user}:#{proxy_pass}@#{proxy_host}:#{proxy_port}" }
|
182
|
+
|
183
|
+
context 'specified by option of constructor' do
|
184
|
+
before do
|
185
|
+
HipChat::Client.new("blah", :http_proxy => proxy_url)
|
186
|
+
end
|
187
|
+
|
188
|
+
subject { HipChat::Client.default_options }
|
189
|
+
|
190
|
+
specify "Client's proxy settings should be changed" do
|
191
|
+
expect(subject[:http_proxyaddr]).to eql(proxy_host)
|
192
|
+
expect(subject[:http_proxyport]).to eql(proxy_port)
|
193
|
+
expect(subject[:http_proxyuser]).to eql(proxy_user)
|
194
|
+
expect(subject[:http_proxypass]).to eql(proxy_pass)
|
195
|
+
end
|
196
|
+
|
197
|
+
describe "Room class's proxy" do
|
198
|
+
subject { HipChat::Room.default_options }
|
199
|
+
|
200
|
+
specify "proxy settings should be changed" do
|
201
|
+
expect(subject[:http_proxyaddr]).to eql(proxy_host)
|
202
|
+
expect(subject[:http_proxyport]).to eql(proxy_port)
|
203
|
+
expect(subject[:http_proxyuser]).to eql(proxy_user)
|
204
|
+
expect(subject[:http_proxypass]).to eql(proxy_pass)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
175
209
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hipchat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- HipChat/Atlassian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rdoc
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>'
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.4.2
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>'
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.4.2
|
97
111
|
description: Ruby library to interact with HipChat
|
98
112
|
email:
|
99
113
|
- support@hipchat.com
|
@@ -105,7 +119,6 @@ files:
|
|
105
119
|
- .gitignore
|
106
120
|
- .travis.yml
|
107
121
|
- Gemfile
|
108
|
-
- Gemfile.lock
|
109
122
|
- LICENSE
|
110
123
|
- README.textile
|
111
124
|
- Rakefile
|
@@ -140,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
153
|
version: '0'
|
141
154
|
requirements: []
|
142
155
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.0.
|
156
|
+
rubygems_version: 2.0.6
|
144
157
|
signing_key:
|
145
158
|
specification_version: 4
|
146
159
|
summary: Ruby library to interact with HipChat
|