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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd76d52a0c4816f63b3e4a4c251a05be0da4e06e9fc2dc0c6ee3a654c9c05c70
4
- data.tar.gz: a623a85b2587665da294d6855ddc2999fb60fffff4a973aacdf32653eb755024
3
+ metadata.gz: f28955aafcdb58f3756be66b6438a8da17172aadf2a7d7fd3aeb56a4c037f659
4
+ data.tar.gz: '09dfe40031139586d2237ebf9123a48312e3282a4209a3b33c60fddad85505c9'
5
5
  SHA512:
6
- metadata.gz: 9d67f0d8f7269d79f3127991e85dc0a6ca2a7899fc9e1d951257f4d96927b2f37212efd749f7e9de0c98e508664a5996cad0d5095f34135dca4be56cdf9112a3
7
- data.tar.gz: df364fa395aab4ea9db7bb1b39c6d3c3140f43ba60e9837ca14dbbda81e90f137693d528420e2faa663953e7cc9f472d92c782991a4a0c5507eb6d82874597b6
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.3)
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.3)
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
- @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.5"
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.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - yiiecc