aliyunoss-activestorage-adapter 0.1.1 → 0.1.3

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: b7757febf237bc442aba6646fabf093c891422b5252f343c8d6d90cfe6c4fc1f
4
- data.tar.gz: a25d1df2f441e883795119f9961df5d6ba004ebaa4ac1782840d41a7ad5fe2ce
3
+ metadata.gz: bd76d52a0c4816f63b3e4a4c251a05be0da4e06e9fc2dc0c6ee3a654c9c05c70
4
+ data.tar.gz: a623a85b2587665da294d6855ddc2999fb60fffff4a973aacdf32653eb755024
5
5
  SHA512:
6
- metadata.gz: 7d6a9976e6133bd972088b730b19e15aa5330fdad96dbae6a60159d76315e2d8c5377b593f11380862f6e324f1254dae28113c554a3bbf1a675482024dc8ed56
7
- data.tar.gz: 3b720d6374c8eef6dd35c0b8dc34d3d5b576a9f011796ce4c6aa434e73792494a2b6f60a683d0a1db62029001cd0b763a7d2ea492e1d79e162965aafbd50aa4a
6
+ metadata.gz: 9d67f0d8f7269d79f3127991e85dc0a6ca2a7899fc9e1d951257f4d96927b2f37212efd749f7e9de0c98e508664a5996cad0d5095f34135dca4be56cdf9112a3
7
+ data.tar.gz: df364fa395aab4ea9db7bb1b39c6d3c3140f43ba60e9837ca14dbbda81e90f137693d528420e2faa663953e7cc9f472d92c782991a4a0c5507eb6d82874597b6
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aliyunoss-activestorage-adapter (0.1.1)
4
+ aliyunoss-activestorage-adapter (0.1.3)
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.2)
43
+ aliyunoss (0.2.3)
44
44
  nokogiri (~> 1.13)
45
45
  ast (2.4.2)
46
46
  builder (3.2.4)
@@ -104,12 +104,13 @@ module ActiveStorage
104
104
  # You must also provide the +content_type+, +content_length+, and +checksum+ of the file
105
105
  # that will be uploaded. All these attributes will be validated by the service upon upload.
106
106
  def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:, custom_metadata: {})
107
- raise NotImplementedError
107
+ public_url(key)
108
108
  end
109
109
 
110
110
  # Returns a Hash of headers for +url_for_direct_upload+ requests.
111
111
  def headers_for_direct_upload(key, filename:, content_type:, content_length:, checksum:, custom_metadata: {})
112
- {}
112
+ @bucket.direct_upload_headers(path_for(key), filename:,
113
+ content_type:, content_length:, checksum:, custom_metadata: {})
113
114
  end
114
115
 
115
116
  def public?
@@ -126,7 +127,7 @@ module ActiveStorage
126
127
  end
127
128
 
128
129
  def public_url(key, **)
129
- "https://#{@bucket}.#{@location}.aliyuncs.com#{path_for(key)}"
130
+ "https://#{@bucket.name}.#{@bucket.location}.aliyuncs.com#{path_for(key)}"
130
131
  end
131
132
 
132
133
  def custom_metadata_headers(metadata)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveStorage
4
4
  module AliyunossService
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyunoss-activestorage-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - yiiecc
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-18 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aliyunoss