3scale_client 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/3scale/client.rb +7 -7
- data/lib/3scale/client/version.rb +1 -1
- data/test/client_test.rb +9 -9
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 593092ff29ce5dffe0c5d1394c0f879d04b5c0b9
|
4
|
+
data.tar.gz: 93907838adc4147c174bb648748fa9e2469db24a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef225fb8331fcdac33b2b63ba27d93c760e3b621316b06169795e7dc8866fd401ae01f25cfe77175b4197badba6aac166d768e8d55ed5ddd5c9c5dc782ae36eb
|
7
|
+
data.tar.gz: ae2145f23b2edc3bc9ff1e177a130190b8b10daa7cb762f2d3b623dac2f74d0888a917757ad541e9f27196b3524c950a9f154af72c53c9d54a7351a91fa33a3e
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
### Fixed
|
6
6
|
### Added
|
7
7
|
|
8
|
+
## [2.6.1] - 2016-01-04
|
9
|
+
### Fixed
|
10
|
+
- Fixed double escaping of post parameters (https://github.com/3scale/3scale_ws_api_for_ruby/pull/24)
|
11
|
+
|
8
12
|
## [2.6.0] - 2015-12-28
|
9
13
|
|
10
14
|
### Added
|
data/lib/3scale/client.rb
CHANGED
@@ -268,24 +268,24 @@ module ThreeScale
|
|
268
268
|
result = {}
|
269
269
|
|
270
270
|
transactions.each_with_index do |transaction, index|
|
271
|
-
|
272
|
-
|
273
|
-
|
271
|
+
append_value(result, index, [:app_id], transaction[:app_id])
|
272
|
+
append_value(result, index, [:timestamp], transaction[:timestamp])
|
273
|
+
append_value(result, index, [:client_ip], transaction[:client_ip])
|
274
274
|
|
275
275
|
transaction[:usage].each do |name, value|
|
276
|
-
|
276
|
+
append_value(result, index, [:usage, name], value)
|
277
277
|
end
|
278
278
|
|
279
279
|
transaction.fetch(:log, {}).each do |name, value|
|
280
|
-
|
280
|
+
append_value(result, index, [:log, name], value)
|
281
281
|
end
|
282
282
|
end
|
283
283
|
|
284
284
|
result
|
285
285
|
end
|
286
286
|
|
287
|
-
def
|
288
|
-
result["transactions[#{index}][#{names.join('][')}]"] =
|
287
|
+
def append_value(result, index, names, value)
|
288
|
+
result["transactions[#{index}][#{names.join('][')}]"] = value if value
|
289
289
|
end
|
290
290
|
|
291
291
|
def build_report_response
|
data/test/client_test.rb
CHANGED
@@ -335,25 +335,21 @@ class ThreeScale::ClientTest < MiniTest::Test
|
|
335
335
|
end
|
336
336
|
|
337
337
|
def test_report_encodes_transactions
|
338
|
-
http_response = stub
|
339
|
-
Net::HTTPSuccess.stubs(:===).with(http_response).returns(true)
|
340
|
-
|
341
338
|
payload = {
|
342
339
|
'transactions[0][app_id]' => 'foo',
|
343
|
-
'transactions[0][timestamp]' =>
|
340
|
+
'transactions[0][timestamp]' => '2010-04-27 15:42:17 0200',
|
344
341
|
'transactions[0][usage][hits]' => '1',
|
345
342
|
'transactions[0][log][request]' => 'foo',
|
346
343
|
'transactions[0][log][response]' => 'bar',
|
347
344
|
'transactions[0][log][code]' => '200',
|
348
345
|
'transactions[1][app_id]' => 'bar',
|
349
|
-
'transactions[1][timestamp]' =>
|
346
|
+
'transactions[1][timestamp]' => Time.local(2010, 4, 27, 15, 00).to_s,
|
350
347
|
'transactions[1][usage][hits]' => '1',
|
351
348
|
'provider_key' => '1234abcd'
|
352
349
|
}
|
353
350
|
|
354
|
-
|
355
|
-
|
356
|
-
.returns(http_response)
|
351
|
+
FakeWeb.register_uri(:post, "http://#{@host}/transactions.xml",
|
352
|
+
:status => ['200', 'OK'])
|
357
353
|
|
358
354
|
@client.report({:app_id => 'foo',
|
359
355
|
:usage => {'hits' => 1},
|
@@ -367,7 +363,11 @@ class ThreeScale::ClientTest < MiniTest::Test
|
|
367
363
|
|
368
364
|
{:app_id => 'bar',
|
369
365
|
:usage => {'hits' => 1},
|
370
|
-
:timestamp =>
|
366
|
+
:timestamp => Time.local(2010, 4, 27, 15, 00)})
|
367
|
+
|
368
|
+
request = FakeWeb.last_request
|
369
|
+
|
370
|
+
assert_equal URI.encode_www_form(payload), request.body
|
371
371
|
end
|
372
372
|
|
373
373
|
def test_failed_report
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 3scale_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Cichra
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2016-01-04 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
version: '0'
|
191
191
|
requirements: []
|
192
192
|
rubyforge_project:
|
193
|
-
rubygems_version: 2.
|
193
|
+
rubygems_version: 2.5.1
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: Client for 3scale Web Service Management System API
|