maxcdn 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/BENCHMARKS.md +8 -8
- data/README.md +4 -0
- data/lib/maxcdn.rb +7 -4
- data/lib/maxcdn/version.rb +1 -1
- data/test/ext_hash_test.rb +0 -0
- data/test/integration.rb +2 -2
- data/test/maxcdn_test.rb +5 -1
- metadata +4 -4
data/BENCHMARKS.md
CHANGED
@@ -10,11 +10,11 @@ Running benchmarks as follows in order:
|
|
10
10
|
maxcdn.purge('ZONEID', [ 'FILE1','FILE2' ])
|
11
11
|
|
12
12
|
user system total real
|
13
|
-
get : 0.
|
14
|
-
get : 0.010000 0.000000 0.010000 ( 0.
|
15
|
-
post : 0.020000 0.
|
16
|
-
put : 0.
|
17
|
-
delete: 0.
|
18
|
-
purge : 0.
|
19
|
-
purge : 0.
|
20
|
-
purge : 0.030000 0.000000 0.030000 (
|
13
|
+
get : 0.060000 0.060000 0.120000 ( 1.014527)
|
14
|
+
get : 0.010000 0.000000 0.010000 ( 0.613805)
|
15
|
+
post : 0.020000 0.000000 0.020000 ( 19.011447)
|
16
|
+
put : 0.020000 0.000000 0.020000 ( 0.670025)
|
17
|
+
delete: 0.010000 0.000000 0.010000 ( 1.076173)
|
18
|
+
purge : 0.020000 0.000000 0.020000 ( 11.109962)
|
19
|
+
purge : 0.010000 0.010000 0.020000 ( 0.813984)
|
20
|
+
purge : 0.030000 0.000000 0.030000 ( 6.704786)
|
data/README.md
CHANGED
@@ -98,6 +98,10 @@ bundle exec ruby ./test/integration.rb # requires host's IP be whitelisted
|
|
98
98
|
|
99
99
|
# Change Log
|
100
100
|
|
101
|
+
##### 0.1.5
|
102
|
+
|
103
|
+
* Issue #4: Fixing purge files by array to return a hash of status results.
|
104
|
+
|
101
105
|
##### 0.1.4
|
102
106
|
|
103
107
|
* Fixing bug where purging files purges entire zone.
|
data/lib/maxcdn.rb
CHANGED
@@ -123,13 +123,16 @@ module MaxCDN
|
|
123
123
|
end
|
124
124
|
|
125
125
|
if file_or_files.is_a?(Array)
|
126
|
-
|
127
|
-
|
126
|
+
result = {}
|
127
|
+
file_or_files.each do |file|
|
128
|
+
result[file] = self.delete("/zones/pull.json/#{zone_id}/cache", { "files" => file }, options)
|
128
129
|
end
|
130
|
+
return result
|
129
131
|
end
|
130
132
|
|
131
|
-
if file_or_files.is_a?(Hash)
|
132
|
-
|
133
|
+
if file_or_files.is_a?(Hash)
|
134
|
+
return self.purge(zone_id, file_or_files[:files]) if file_or_files.has_key?("files")
|
135
|
+
return self.purge(zone_id, file_or_files[:files]) if file_or_files.has_key?(:files)
|
133
136
|
end
|
134
137
|
|
135
138
|
raise MaxCDN::APIException.new("Invalid file_or_files argument for delete method.")
|
data/lib/maxcdn/version.rb
CHANGED
data/test/ext_hash_test.rb
CHANGED
File without changes
|
data/test/integration.rb
CHANGED
@@ -57,7 +57,7 @@ class Client < Minitest::Test
|
|
57
57
|
assert_equal 200, @max.purge(zone, popularfiles[0]["uri"])["code"], "purge file"
|
58
58
|
|
59
59
|
files = [popularfiles[0]["uri"], popularfiles[1]["uri"]]
|
60
|
-
|
60
|
+
expected = {files[0]=>{"code"=>200},files[1]=>{"code"=>200}}
|
61
|
+
assert_equal expected, @max.purge(zone, files), "purge files"
|
61
62
|
end
|
62
63
|
end
|
63
|
-
|
data/test/maxcdn_test.rb
CHANGED
@@ -138,7 +138,11 @@ class Client < Minitest::Test
|
|
138
138
|
end
|
139
139
|
|
140
140
|
def test_purge_files
|
141
|
-
assert_equal(
|
141
|
+
assert_equal({"foo.txt"=>{"foo"=>"bar"}, "bar.txt"=>{"foo"=>"bar"}}, @max.purge(12345, [ "foo.txt", "bar.txt" ]))
|
142
|
+
end
|
143
|
+
|
144
|
+
def test_purge_files
|
145
|
+
assert_equal({"foo.txt"=>{"foo"=>"bar"}, "bar.txt"=>{"foo"=>"bar"}}, @max.purge(12345, { :files => [ "foo.txt", "bar.txt" ]}))
|
142
146
|
end
|
143
147
|
end
|
144
148
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maxcdn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
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: 2014-
|
12
|
+
date: 2014-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: signet
|
@@ -83,7 +83,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
segments:
|
85
85
|
- 0
|
86
|
-
hash:
|
86
|
+
hash: 1791789411021085395
|
87
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
88
|
none: false
|
89
89
|
requirements:
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
segments:
|
94
94
|
- 0
|
95
|
-
hash:
|
95
|
+
hash: 1791789411021085395
|
96
96
|
requirements: []
|
97
97
|
rubyforge_project:
|
98
98
|
rubygems_version: 1.8.23
|