aliyunoss-activestorage-adapter 0.1.0 → 0.1.2

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: be287d0880ab9d18c34e3368599676a18037c029a4e4c69a3988618e185bcb76
4
- data.tar.gz: cd9d6c1011ea9033f41b3dc1e14acf879dabaa9d86b25c35847d6008c3fd6e61
3
+ metadata.gz: 0b4c5915f74e002753e244506301383d21c6ab835dcd884db7965220afd9eddb
4
+ data.tar.gz: fff46b4ccaf3189b2affe15b0490d5411d32f1af7626fc50f32a9843d88be129
5
5
  SHA512:
6
- metadata.gz: 661502c6982f26960218e32091f61718d1a6b3990cb3627cdc531ceb0c8081329ba6677b9eefb2d90191c0f1f34d9ad9755c6964a312af71977d1b457593e095
7
- data.tar.gz: c955f8cec05d2de4bf93c5aa43cd24e57ac703416ea170d9e04a6cb06617587ea2d642d3ed2d45fb5486f683ee1ff486715385552ca610993dc82c0022b08510
6
+ metadata.gz: e3328982b6677f7a9b76cdf9c7bd572fe8ad421d16dc54bc6c06c01a4a344aa907ec6db96e6633889bd3223f01a583e7d362910663162b6566d953c4a2893ca9
7
+ data.tar.gz: 5abfebad239c4f334022283f3f97b3b4474a126fd9b3995a1ef5ec04db8f3b85094f48245e1e4c84e8e9ac567980ed11df5b578db7f2d785807321bdd2cbe003
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aliyunoss-activestorage-adapter (0.1.0)
4
+ aliyunoss-activestorage-adapter (0.1.2)
5
+ aliyunoss (~> 0.2)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
@@ -39,7 +40,7 @@ GEM
39
40
  i18n (>= 1.6, < 2)
40
41
  minitest (>= 5.1)
41
42
  tzinfo (~> 2.0)
42
- aliyunoss (0.2.2)
43
+ aliyunoss (0.2.3)
43
44
  nokogiri (~> 1.13)
44
45
  ast (2.4.2)
45
46
  builder (3.2.4)
data/README.md CHANGED
@@ -39,6 +39,14 @@ Active Storage的配置文件在/config/storage.yml文件中,请添加以下
39
39
 
40
40
  配置完成后,可以按照[Active Storage](https://edgeguides.rubyonrails.org/active_storage_overview.html)手册调用。
41
41
 
42
+ ## 运行测试用例
43
+
44
+ 下载源代码后,可以使用如下方法运行测试用例:
45
+
46
+ ALI_ACCESS_KEY="[阿里云开发者信息]" ALI_ACCESS_SECRET="[阿里云开发者信息]" bundle exec rspec
47
+
48
+ 测试运行前,请手动创建一个名为active-storage-spec的Bucket,Bucket所在地区为oss-cn-beijing。
49
+
42
50
  ## 开发
43
51
 
44
52
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -31,8 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ["lib"]
33
33
 
34
- # Uncomment to register a new dependency of your gem
35
- # spec.add_dependency "example-gem", "~> 1.0"
34
+ spec.add_dependency "aliyunoss", "~> 0.2"
36
35
 
37
36
  # For more information and examples about making a new gem, check out our
38
37
  # guide at: https://bundler.io/guides/creating_gem.html
@@ -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?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveStorage
4
4
  module AliyunossService
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aliyunoss-activestorage-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
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
12
- dependencies: []
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aliyunoss
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.2'
13
27
  description: A plugin that enables Rails App using Aliyun OSS, this gem depends on
14
28
  aliyunoss gem.
15
29
  email: