better_ross 0.0.4 → 0.1.0
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/ross/client.rb +24 -4
- data/ross.gemspec +2 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8063a3d10f0ef6275b0e7d18fce5c88822726f5e
|
4
|
+
data.tar.gz: 96975a08762a2ad2e0ff756e432adcc7ac2c1e07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90ff25d5a0a1432fbd3a15d7004db28df3cfd9b8634a4a3f8e773c201de7b311252327e7fb6075944d0fb7e69c5d55781da84d2c4fe3427ca6eaeca3ced8dce0
|
7
|
+
data.tar.gz: 012bb2f1757ba97632e3d9b3c4ae3f9642b1401adaf29419d08b26d18d79def22b6386df9d3ab75f670c0421ad777338cf45ade77466de90e67d0482f1b81fdf
|
data/lib/ross/client.rb
CHANGED
@@ -33,14 +33,34 @@ module ROSS
|
|
33
33
|
|
34
34
|
def delete(path)
|
35
35
|
date = Time.now.gmtime.strftime("%a, %d %b %Y %H:%M:%S GMT")
|
36
|
-
content_type = nil
|
37
36
|
headers = {
|
38
|
-
"Authorization" => auth_sign("DELETE", path, date
|
39
|
-
"Content-Type" =>
|
37
|
+
"Authorization" => auth_sign("DELETE", path, date),
|
38
|
+
"Content-Type" => nil,
|
40
39
|
"Date" => date,
|
41
40
|
"Host" => @aliyun_host
|
42
41
|
}
|
43
|
-
RestClient.delete(request_url(path), headers)
|
42
|
+
response = RestClient.delete(request_url(path), headers)
|
43
|
+
end
|
44
|
+
|
45
|
+
def head(path)
|
46
|
+
date = Time.now.gmtime.strftime("%a, %d %b %Y %H:%M:%S GMT")
|
47
|
+
headers = {
|
48
|
+
"Authorization" => auth_sign("HEAD", path, date),
|
49
|
+
"Content-Type" => nil,
|
50
|
+
"Date" => date,
|
51
|
+
"Host" => @aliyun_host
|
52
|
+
}
|
53
|
+
response = RestClient.head(request_url(path), headers)
|
54
|
+
end
|
55
|
+
|
56
|
+
def exists?(path)
|
57
|
+
begin
|
58
|
+
head(path)
|
59
|
+
rescue RestClient::ResourceNotFound
|
60
|
+
false
|
61
|
+
else
|
62
|
+
true
|
63
|
+
end
|
44
64
|
end
|
45
65
|
|
46
66
|
def copy(sour_path, dest_path)
|
data/ross.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'better_ross'
|
4
|
-
s.version = '0.0
|
4
|
+
s.version = '0.1.0'
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.summary = "ROSS is a ruby client for aliyun oss"
|
7
|
-
s.authors = ["Fizz Wu"]
|
7
|
+
s.authors = ["Fizz Wu", "Binz"]
|
8
8
|
s.email = "fizzwu@gmail.com"
|
9
9
|
s.files = `git ls-files`.split("\n")
|
10
10
|
|