carrierwave-aliyun 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/carrierwave/aliyun/version.rb +1 -1
- data/lib/carrierwave/storage/aliyun.rb +23 -0
- data/lib/carrierwave/storage/aliyun_file.rb +6 -2
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6d5d5c0acc30b46d90292f4a90c05e90667bdbf40ec97b279342aa215a4f2ff
|
4
|
+
data.tar.gz: f3b67cdf10f5800c250dafce535a6df95951c6c967e825f18fc3a656fa35268f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d0ba7b297d56905fdb8d24697e02e7ba56f89c0ea91ea7f73784746f404d2a7de2d0161c1a9b9b70c6e66050247ecc0828ce2396bccfa25ab24bd49ba11499c
|
7
|
+
data.tar.gz: 9a6ee10ee4fb3299e9ef3170f1b4e41bc32d5137ee601295b2fed394cc060148f371835519db6af16bc5e6bf0f3be6164b4462b7fba202929505fe0d21562bf6
|
data/CHANGELOG.md
CHANGED
@@ -17,6 +17,29 @@ module CarrierWave
|
|
17
17
|
def retrieve!(identifier)
|
18
18
|
AliyunFile.new(uploader, self, uploader.store_path(identifier))
|
19
19
|
end
|
20
|
+
|
21
|
+
def cache!(file)
|
22
|
+
f = AliyunFile.new(uploader, self, uploader.store_path)
|
23
|
+
headers = {
|
24
|
+
content_type: file.content_type,
|
25
|
+
content_disposition: uploader.try(:content_disposition)
|
26
|
+
}
|
27
|
+
|
28
|
+
f.store(::File.open(file.file), headers)
|
29
|
+
f
|
30
|
+
end
|
31
|
+
|
32
|
+
def retrieve_from_cache!(identifier)
|
33
|
+
AliyunFile.new(uploader, self, uploader.store_path(identifier))
|
34
|
+
end
|
35
|
+
|
36
|
+
def delete_dir!(path)
|
37
|
+
# do nothing, because there's no such things as 'empty directory'
|
38
|
+
end
|
39
|
+
|
40
|
+
def clean_cache!(_seconds)
|
41
|
+
raise 'use Object Lifecycle Management to clean the cache'
|
42
|
+
end
|
20
43
|
end
|
21
44
|
end
|
22
45
|
end
|
@@ -47,8 +47,12 @@ module CarrierWave
|
|
47
47
|
headers[:content_type] = new_content_type
|
48
48
|
end
|
49
49
|
|
50
|
-
def store(
|
51
|
-
|
50
|
+
def store(new_file, headers = {})
|
51
|
+
if new_file.is_a?(self.class)
|
52
|
+
new_file.move_to(path)
|
53
|
+
else
|
54
|
+
bucket.put(@path, new_file, headers)
|
55
|
+
end
|
52
56
|
end
|
53
57
|
|
54
58
|
def headers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-aliyun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aliyun-sdk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,8 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
|
76
|
-
rubygems_version: 2.7.9
|
75
|
+
rubygems_version: 3.0.3
|
77
76
|
signing_key:
|
78
77
|
specification_version: 4
|
79
78
|
summary: Aliyun OSS support for Carrierwave
|