bunny_cdn 1.0.1 → 1.0.2
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/lib/bunny_cdn/pullzone.rb +2 -0
- data/lib/bunny_cdn/storage.rb +22 -4
- data/lib/bunny_cdn/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb108e1f12583c1483cfe2e9ac3bab53c90ec98e6d1933c203c3329e28418a54
|
|
4
|
+
data.tar.gz: 0b599355d1ae6a01b0b207f83301a4345087b43a58478a3bf907987cddf34d7d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 478a0a610de23c75baa518c53bfcf98d3e4cb2d9218575f84f8c76fb366e1d7dd1a76e5908f9997f3802625c50b547b575ebf37e098bdb8d6d2b31538485dd3d
|
|
7
|
+
data.tar.gz: 5d4ec5ef659b411e6fa63981086393208a0db17aac2ad59495301d5d54ec8ed7b476a1581def4948637b9c0a968ca114873db5be97ff35d5df132faece510f2d
|
data/lib/bunny_cdn/pullzone.rb
CHANGED
data/lib/bunny_cdn/storage.rb
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
module BunnyCdn
|
|
2
2
|
class Storage
|
|
3
|
+
|
|
4
|
+
RestClient.log = STDOUT # enables RestClient logging
|
|
3
5
|
|
|
4
6
|
BASE_URL = 'https://storage.bunnycdn.com'
|
|
5
7
|
|
|
@@ -18,12 +20,20 @@ module BunnyCdn
|
|
|
18
20
|
end
|
|
19
21
|
|
|
20
22
|
def self.getZoneFiles(path= '')
|
|
21
|
-
|
|
23
|
+
begin
|
|
24
|
+
response = RestClient.get("#{BASE_URL}/#{storageZone}/#{path}", headers)
|
|
25
|
+
rescue RestClient::ExceptionWithResponse => exception
|
|
26
|
+
return exception
|
|
27
|
+
end
|
|
22
28
|
return response.body
|
|
23
29
|
end
|
|
24
30
|
|
|
25
31
|
def self.getFile(path= '', file)
|
|
26
|
-
|
|
32
|
+
begin
|
|
33
|
+
response = RestClient.get("#{BASE_URL}/#{storageZone}/#{path}/#{file}", headers)
|
|
34
|
+
rescue RestClient::ExceptionWithResponse => exception
|
|
35
|
+
return exception
|
|
36
|
+
end
|
|
27
37
|
return response.body
|
|
28
38
|
end
|
|
29
39
|
|
|
@@ -33,12 +43,20 @@ module BunnyCdn
|
|
|
33
43
|
:accessKey => apiKey,
|
|
34
44
|
:checksum => ''
|
|
35
45
|
}
|
|
36
|
-
|
|
46
|
+
begin
|
|
47
|
+
response = RestClient.put("#{BASE_URL}/#{storageZone}/#{path}/#{fileName}", File.read(file), headers)
|
|
48
|
+
rescue RestClient::ExceptionWithResponse => exception
|
|
49
|
+
return exception
|
|
50
|
+
end
|
|
37
51
|
return response.body
|
|
38
52
|
end
|
|
39
53
|
|
|
40
54
|
def self.deleteFile(path= '', file)
|
|
41
|
-
|
|
55
|
+
begin
|
|
56
|
+
response = RestClient.delete("#{BASE_URL}/#{storageZone}/#{path}/#{file}", headers)
|
|
57
|
+
rescue RestClient::ExceptionWithResponse => exception
|
|
58
|
+
return exception
|
|
59
|
+
end
|
|
42
60
|
return response.body
|
|
43
61
|
end
|
|
44
62
|
|
data/lib/bunny_cdn/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bunny_cdn
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brandon Meeks
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-04-
|
|
11
|
+
date: 2020-04-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rest-client
|