maxcdn 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/BENCHMARKS.md +17 -11
- data/Gemfile +0 -1
- data/lib/ext/hash.rb +4 -4
- data/lib/maxcdn/version.rb +1 -1
- data/maxcdn.gemspec +1 -0
- data/test/ext_hash_test.rb +0 -10
- data/test/maxcdn_test.rb +1 -3
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 435f49a5052b4eb24cd99f3982f9656a1c745651
|
4
|
+
data.tar.gz: 503f3288452d8433d32af90e85db1b16ea9cad96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cb4aafb9353dfb3ae1ae0cbe758f791fe41b36a3f6c2bf88dd42861925b81ef1535f72cc256e6de4d5019e9b34f571b677fb6390cec12d75d85c5430d551a52
|
7
|
+
data.tar.gz: cfd2cba6b02a961c92cc4e224b8379350b02c285ab2f50f70a23e930ef752382e39d99e5ffde41466ceb05c64cf0d4f9c4b0c96f53d043bf3fe4f91b9e68a4d8
|
data/.gitignore
CHANGED
data/BENCHMARKS.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
+
Running on Ruby version:
|
2
|
+
|
3
|
+
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
|
4
|
+
|
5
|
+
|
1
6
|
Running benchmarks as follows in order:
|
2
|
-
|
7
|
+
|
3
8
|
maxcdn.get('zones/pull.json')
|
4
9
|
maxcdn.get('reports/popularfiles.json')
|
5
10
|
maxcdn.get('v3/reporting/logs.json')
|
@@ -9,14 +14,15 @@ Running benchmarks as follows in order:
|
|
9
14
|
maxcdn.purge('ZONEID')
|
10
15
|
maxcdn.purge('ZONEID', 'FILE')
|
11
16
|
maxcdn.purge('ZONEID', [ 'FILE1','FILE2' ])
|
12
|
-
|
17
|
+
|
13
18
|
user system total real
|
14
|
-
get : 0.010000 0.000000 0.010000 (
|
15
|
-
get : 0.
|
16
|
-
get : 0.
|
17
|
-
post : 0.
|
18
|
-
put : 0.
|
19
|
-
delete: 0.010000 0.000000 0.010000 (
|
20
|
-
purge : 0.
|
21
|
-
purge : 0.
|
22
|
-
purge : 0.
|
19
|
+
get : 0.010000 0.000000 0.010000 ( 0.444660)
|
20
|
+
get : 0.000000 0.000000 0.000000 ( 0.180768)
|
21
|
+
get : 0.000000 0.010000 0.010000 ( 0.556110)
|
22
|
+
post : 0.010000 0.000000 0.010000 ( 3.665597)
|
23
|
+
put : 0.000000 0.000000 0.000000 ( 0.370504)
|
24
|
+
delete: 0.010000 0.000000 0.010000 ( 2.557845)
|
25
|
+
purge : 0.000000 0.000000 0.000000 ( 1.392236)
|
26
|
+
purge : 0.000000 0.000000 0.000000 ( 1.386664)
|
27
|
+
purge : 0.000000 0.000000 0.000000 ( 2.841199)
|
28
|
+
|
data/Gemfile
CHANGED
data/lib/ext/hash.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
|
2
|
-
RESERVED_CHARACTERS = /[^a-zA-Z0-9\-\.\_\~]/
|
1
|
+
require 'addressable'
|
3
2
|
|
3
|
+
class Hash
|
4
4
|
def _escape(value)
|
5
|
-
URI::
|
5
|
+
Addressable::URI.encode(Addressable::URI.parse(value.to_s))
|
6
6
|
rescue ArgumentError
|
7
|
-
URI::
|
7
|
+
Addressable::URI.encode(Addressable::URI.parse(value.to_s.force_encoding(Encoding::UTF_8)))
|
8
8
|
end
|
9
9
|
|
10
10
|
def to_params
|
data/lib/maxcdn/version.rb
CHANGED
data/maxcdn.gemspec
CHANGED
data/test/ext_hash_test.rb
CHANGED
@@ -19,16 +19,6 @@ class Client < Minitest::Test
|
|
19
19
|
assert_equal "foo[0]=bar&foo[1]=boo", { :foo => [ :bar, :boo ] }.to_params
|
20
20
|
end
|
21
21
|
|
22
|
-
def test_to_params_crazy
|
23
|
-
assert_equal "a=1&c=%40%24%5E%24%23%25%26%23%26&%3F%21=asdf&1=FDAS&b[0]=a&b[1]=b&b[2]=c", {
|
24
|
-
:a => 1,
|
25
|
-
:b => [ :a, :b, :c ],
|
26
|
-
:c => "@$^$#%&#&",
|
27
|
-
"?!" => "asdf",
|
28
|
-
1 => "FDAS"
|
29
|
-
}.to_params
|
30
|
-
end
|
31
|
-
|
32
22
|
def test_case_indifferent_delete
|
33
23
|
original_hash = {
|
34
24
|
# using realistic content types to test real use cases
|
data/test/maxcdn_test.rb
CHANGED
@@ -8,6 +8,7 @@ Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
|
|
8
8
|
|
9
9
|
require "webmock"
|
10
10
|
include WebMock::API
|
11
|
+
WebMock.enable!
|
11
12
|
|
12
13
|
host = "https://rws.maxcdn.com/alias"
|
13
14
|
|
@@ -138,9 +139,6 @@ class Client < Minitest::Test
|
|
138
139
|
|
139
140
|
def test_purge_files
|
140
141
|
assert_equal({"foo.txt"=>{"foo"=>"bar"}, "bar.txt"=>{"foo"=>"bar"}}, @max.purge(12345, [ "foo.txt", "bar.txt" ]))
|
141
|
-
end
|
142
|
-
|
143
|
-
def test_purge_files
|
144
142
|
assert_equal({"foo.txt"=>{"foo"=>"bar"}, "bar.txt"=>{"foo"=>"bar"}}, @max.purge(12345, { :files => [ "foo.txt", "bar.txt" ]}))
|
145
143
|
end
|
146
144
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maxcdn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua P. Mervine
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: signet
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.9'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: addressable
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.4'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.4'
|
55
69
|
description: A Rest Client For MaxCDN Rest Web Services
|
56
70
|
email: joshua@mervine.net
|
57
71
|
executables: []
|