maxcdn 0.1.6 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +2 -4
- data/BENCHMARKS.md +10 -8
- data/Gemfile +1 -3
- data/lib/maxcdn/version.rb +1 -1
- data/maxcdn.gemspec +1 -1
- data/test/benchmark.rb +7 -2
- data/test/integration.rb +6 -1
- metadata +15 -27
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d567c5be45aad2ecdd920d497b14745ec925bec8
|
4
|
+
data.tar.gz: f3dfe98f23eb417f021b3b040f0390683dcfac00
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a11ce6b0f103a2ba7d0ed2922346658dabbc340d16e133c64d42ecc9fea508ac58801660f7f25d6e22d1ddf0d420789b314a9aafc4d7d1614e1e0ca4a8515b0a
|
7
|
+
data.tar.gz: 36d70193078ab28a413f199074958bef2338afb0493ec3221259d1c7d45135c95bef8dad77e2405c104b346d674930ffd8b1f5e901133be379528e68053d3fb5
|
data/.travis.yml
CHANGED
data/BENCHMARKS.md
CHANGED
@@ -2,6 +2,7 @@ Running benchmarks as follows in order:
|
|
2
2
|
|
3
3
|
maxcdn.get('zones/pull.json')
|
4
4
|
maxcdn.get('reports/popularfiles.json')
|
5
|
+
maxcdn.get('v3/reporting/logs.json')
|
5
6
|
maxcdn.post('zones/pull.json', { :name => 'NAM', :url => 'URL' })
|
6
7
|
maxcdn.put('account.json', { :name => 'NAME' })
|
7
8
|
maxcdn.delete('zones/pull.json/ZONEID')
|
@@ -10,11 +11,12 @@ Running benchmarks as follows in order:
|
|
10
11
|
maxcdn.purge('ZONEID', [ 'FILE1','FILE2' ])
|
11
12
|
|
12
13
|
user system total real
|
13
|
-
get : 0.
|
14
|
-
get : 0.010000 0.000000 0.010000 ( 0.
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
purge : 0.010000 0.
|
20
|
-
purge : 0.
|
14
|
+
get : 0.010000 0.000000 0.010000 ( 1.356269)
|
15
|
+
get : 0.010000 0.000000 0.010000 ( 0.911275)
|
16
|
+
get : 0.010000 0.000000 0.010000 ( 1.069133)
|
17
|
+
post : 0.000000 0.000000 0.000000 ( 6.513997)
|
18
|
+
put : 0.010000 0.000000 0.010000 ( 0.831379)
|
19
|
+
delete: 0.010000 0.000000 0.010000 ( 1.248739)
|
20
|
+
purge : 0.010000 0.000000 0.010000 ( 4.019390)
|
21
|
+
purge : 0.010000 0.000000 0.010000 ( 6.221071)
|
22
|
+
purge : 0.010000 0.000000 0.010000 ( 2.496699)
|
data/Gemfile
CHANGED
data/lib/maxcdn/version.rb
CHANGED
data/maxcdn.gemspec
CHANGED
@@ -13,6 +13,6 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.email = "joshua@mervine.net"
|
14
14
|
gem.authors = ["Joshua P. Mervine"]
|
15
15
|
gem.add_dependency 'json' if RUBY_VERSION.start_with? "1.8"
|
16
|
-
gem.add_dependency 'signet', '~> 0.
|
16
|
+
gem.add_dependency 'signet', '~> 0.5.1'
|
17
17
|
gem.add_dependency 'curb-fu', '~> 0.6.2'
|
18
18
|
end
|
data/test/benchmark.rb
CHANGED
@@ -12,6 +12,7 @@ puts "Running benchmarks as follows in order:"
|
|
12
12
|
puts " "
|
13
13
|
puts " maxcdn.get('zones/pull.json')"
|
14
14
|
puts " maxcdn.get('reports/popularfiles.json')"
|
15
|
+
puts " maxcdn.get('v3/reporting/logs.json')"
|
15
16
|
puts " maxcdn.post('zones/pull.json', { :name => 'NAM', :url => 'URL' })"
|
16
17
|
puts " maxcdn.put('account.json', { :name => 'NAME' })"
|
17
18
|
puts " maxcdn.delete('zones/pull.json/ZONEID')"
|
@@ -23,16 +24,20 @@ puts " "
|
|
23
24
|
Benchmark.bm do |mark|
|
24
25
|
|
25
26
|
maxcdn = MaxCDN::Client.new(ENV["ALIAS"], ENV["KEY"], ENV["SECRET"])
|
26
|
-
time = Time.now.to_i.to_s
|
27
27
|
|
28
28
|
mark.report("get :") do
|
29
|
-
|
29
|
+
zones = maxcdn.get("zones/pull.json")["data"]["pullzones"]
|
30
|
+
@pullzone = zones[zones.length-1]["id"]
|
30
31
|
end
|
31
32
|
|
32
33
|
mark.report("get :") do
|
33
34
|
@popularfiles = maxcdn.get("reports/popularfiles.json")["data"]["popularfiles"]
|
34
35
|
end
|
35
36
|
|
37
|
+
mark.report("get :") do
|
38
|
+
@popularfiles = maxcdn.get("v3/reporting/logs.json")["next_page_key"]
|
39
|
+
end
|
40
|
+
|
36
41
|
@zone = {
|
37
42
|
:name => @time,
|
38
43
|
:url => "http://www.example.com"
|
data/test/integration.rb
CHANGED
@@ -31,6 +31,10 @@ class Client < Minitest::Test
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
def test_get_logs
|
35
|
+
assert @max.get("v3/reporting/logs.json")["next_page_key"], "get next_page_key with data"
|
36
|
+
end
|
37
|
+
|
34
38
|
def test_post_and_delete
|
35
39
|
|
36
40
|
zone = {
|
@@ -50,7 +54,8 @@ class Client < Minitest::Test
|
|
50
54
|
end
|
51
55
|
|
52
56
|
def test_purge
|
53
|
-
|
57
|
+
zones = @max.get("zones/pull.json")["data"]["pullzones"]
|
58
|
+
zone = zones[zones.length-1]["id"]
|
54
59
|
assert_equal 200, @max.purge(zone)["code"], "purge"
|
55
60
|
|
56
61
|
popularfiles = @max.get("reports/popularfiles.json")["data"]["popularfiles"]
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maxcdn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Joshua P. Mervine
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: signet
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
19
|
+
version: 0.5.1
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
26
|
+
version: 0.5.1
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: curb-fu
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: 0.6.2
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: 0.6.2
|
46
41
|
description: A Rest Client For MaxCDN Rest Web Services
|
@@ -49,8 +44,8 @@ executables: []
|
|
49
44
|
extensions: []
|
50
45
|
extra_rdoc_files: []
|
51
46
|
files:
|
52
|
-
- .gitignore
|
53
|
-
- .travis.yml
|
47
|
+
- ".gitignore"
|
48
|
+
- ".travis.yml"
|
54
49
|
- BENCHMARKS.md
|
55
50
|
- Gemfile
|
56
51
|
- LICENSE
|
@@ -71,32 +66,25 @@ files:
|
|
71
66
|
homepage: http://www.maxcdn.com
|
72
67
|
licenses:
|
73
68
|
- MIT
|
69
|
+
metadata: {}
|
74
70
|
post_install_message:
|
75
71
|
rdoc_options: []
|
76
72
|
require_paths:
|
77
73
|
- lib
|
78
74
|
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
75
|
requirements:
|
81
|
-
- -
|
76
|
+
- - ">="
|
82
77
|
- !ruby/object:Gem::Version
|
83
78
|
version: '0'
|
84
|
-
segments:
|
85
|
-
- 0
|
86
|
-
hash: 1023780318318559037
|
87
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
80
|
requirements:
|
90
|
-
- -
|
81
|
+
- - ">="
|
91
82
|
- !ruby/object:Gem::Version
|
92
83
|
version: '0'
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
hash: 1023780318318559037
|
96
84
|
requirements: []
|
97
85
|
rubyforge_project:
|
98
|
-
rubygems_version:
|
86
|
+
rubygems_version: 2.2.2
|
99
87
|
signing_key:
|
100
|
-
specification_version:
|
88
|
+
specification_version: 4
|
101
89
|
summary: A Rest Client For MaxCDN Rest Web Services
|
102
90
|
test_files: []
|