aliyunoss-activestorage-adapter 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd76d52a0c4816f63b3e4a4c251a05be0da4e06e9fc2dc0c6ee3a654c9c05c70
4
- data.tar.gz: a623a85b2587665da294d6855ddc2999fb60fffff4a973aacdf32653eb755024
3
+ metadata.gz: da85098760deeaa15abaacbfaea96a8f2cd8a400a0f1a4b7929a6aa18c0a12e2
4
+ data.tar.gz: e4ff1b53aac25dfb3da9aa4dad820c18d46c9a48f47daee88e546146428ee938
5
5
  SHA512:
6
- metadata.gz: 9d67f0d8f7269d79f3127991e85dc0a6ca2a7899fc9e1d951257f4d96927b2f37212efd749f7e9de0c98e508664a5996cad0d5095f34135dca4be56cdf9112a3
7
- data.tar.gz: df364fa395aab4ea9db7bb1b39c6d3c3140f43ba60e9837ca14dbbda81e90f137693d528420e2faa663953e7cc9f472d92c782991a4a0c5507eb6d82874597b6
6
+ metadata.gz: 27d4b70af51f81fd2106b87eff63f4e4ca3f78292641647d8faa96e682311d7ec903195b6490815ab021b34caaaa6dd051f7a348ff2b8a41cd857999506ef0a1
7
+ data.tar.gz: 2db5dbab5e0a78751d8859f639a39228d632bfdd2071c2a4f46f9c75206a2c62d67b6a9db08d189ad7360d1bf529c41eef5cb70db1871c5f991a09368937fc4b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aliyunoss-activestorage-adapter (0.1.3)
4
+ aliyunoss-activestorage-adapter (0.1.4)
5
5
  aliyunoss (~> 0.2)
6
6
 
7
7
  GEM
@@ -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
- @bucket.download(path_for(key))
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",
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveStorage
4
4
  module AliyunossService
5
- VERSION = "0.1.3"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyunoss-activestorage-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - yiiecc