aliyunoss-activestorage-adapter 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/active_storage/service/aliyunoss_service.rb +6 -17
- data/lib/active_storage/service/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f28955aafcdb58f3756be66b6438a8da17172aadf2a7d7fd3aeb56a4c037f659
|
4
|
+
data.tar.gz: '09dfe40031139586d2237ebf9123a48312e3282a4209a3b33c60fddad85505c9'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b07547d06145389661c35f5849c837c57ad899685171dac80650beccfbc137f590ac100428e7557bee311c3ba0a649eb8f0f9572edf85e672547ccebfe62a1ac
|
7
|
+
data.tar.gz: 73f1fcd6f89ae76eb33e66fffd5773689f2a8d013f960e1eeb5d508c28735c7f53c7851fec59bdd9f689796595468fde62b382ac4dc3306cb5471421b0bda451
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
aliyunoss-activestorage-adapter (0.1.
|
4
|
+
aliyunoss-activestorage-adapter (0.1.5)
|
5
5
|
aliyunoss (~> 0.2)
|
6
6
|
|
7
7
|
GEM
|
@@ -40,7 +40,7 @@ GEM
|
|
40
40
|
i18n (>= 1.6, < 2)
|
41
41
|
minitest (>= 5.1)
|
42
42
|
tzinfo (~> 2.0)
|
43
|
-
aliyunoss (0.2.
|
43
|
+
aliyunoss (0.2.4)
|
44
44
|
nokogiri (~> 1.13)
|
45
45
|
ast (2.4.2)
|
46
46
|
builder (3.2.4)
|
@@ -40,16 +40,13 @@ module ActiveStorage
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
# Update metadata for the file identified by +key+ in the service.
|
44
|
-
# Override in subclasses only if the service needs to store specific
|
45
|
-
# metadata that has to be updated upon identification.
|
46
|
-
def update_metadata(key, **metadata)
|
47
|
-
raise NotImplementedError
|
48
|
-
end
|
49
|
-
|
50
43
|
# Return the content of the file at the +key+.
|
51
44
|
def download(key)
|
52
|
-
|
45
|
+
if block_given?
|
46
|
+
yield @bucket.download(path_for(key))
|
47
|
+
else
|
48
|
+
@bucket.download(path_for(key))
|
49
|
+
end
|
53
50
|
end
|
54
51
|
|
55
52
|
# Return the partial content in the byte +range+ of the file at the +key+.
|
@@ -57,11 +54,6 @@ module ActiveStorage
|
|
57
54
|
@bucket.download(path_for(key), Range: range)
|
58
55
|
end
|
59
56
|
|
60
|
-
# Concatenate multiple files into a single "composed" file.
|
61
|
-
def compose(source_keys, destination_key, filename: nil, content_type: nil, disposition: nil, custom_metadata: {})
|
62
|
-
raise NotImplementedError
|
63
|
-
end
|
64
|
-
|
65
57
|
# Delete the file at the +key+.
|
66
58
|
def delete(key)
|
67
59
|
@bucket.delete(path_for(key))
|
@@ -108,6 +100,7 @@ module ActiveStorage
|
|
108
100
|
end
|
109
101
|
|
110
102
|
# Returns a Hash of headers for +url_for_direct_upload+ requests.
|
103
|
+
# AliyunOSS API requires 'Date' header
|
111
104
|
def headers_for_direct_upload(key, filename:, content_type:, content_length:, checksum:, custom_metadata: {})
|
112
105
|
@bucket.direct_upload_headers(path_for(key), filename:,
|
113
106
|
content_type:, content_length:, checksum:, custom_metadata: {})
|
@@ -130,10 +123,6 @@ module ActiveStorage
|
|
130
123
|
"https://#{@bucket.name}.#{@bucket.location}.aliyuncs.com#{path_for(key)}"
|
131
124
|
end
|
132
125
|
|
133
|
-
def custom_metadata_headers(metadata)
|
134
|
-
raise NotImplementedError
|
135
|
-
end
|
136
|
-
|
137
126
|
def instrument(operation, payload = {}, &block)
|
138
127
|
ActiveSupport::Notifications.instrument(
|
139
128
|
"service_#{operation}.active_storage",
|