activestorage-aliyun 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/README.md +16 -3
- data/lib/active_storage/service/aliyun_service.rb +2 -1
- data/lib/active_storage_aliyun/version.rb +1 -1
- metadata +4 -5
- data/Rakefile +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6de8c6a19e97cc39b456d90df755854de54dd4338b123c37d0276055056514f
|
4
|
+
data.tar.gz: 93f6427de6343b3d65be549c6d88676ed6141c17c66457f2a1848d200a2bfcf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccb3cd37cd09c9dae72ee43fca32b5583900d184f12ea10b774d75f4b3b41df2139f34a308849e28a6820cb9f88e7f4de16a7fd30d4f4eb62dc1f4988ffc8187
|
7
|
+
data.tar.gz: 75de0836b30d849cd90397b0140b7e11ac01d0768effa5046f64d208d2027f32b06e61e3626568461f25aa0e020407866520019683ebd254294d4d6884586d0d
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# ActiveStorage Aliyun Service
|
2
2
|
|
3
|
-
Wraps the Aliyun OSS as an Active Storage service.
|
3
|
+
Wraps the Aliyun OSS as an Active Storage service, use [Aliyun official Ruby SDK](https://github.com/aliyun/aliyun-oss-ruby-sdk) for upload.
|
4
4
|
|
5
5
|
|
6
6
|
[](https://badge.fury.io/rb/activestorage-aliyun) [](https://travis-ci.org/huacnlee/activestorage-aliyun) [](https://codeclimate.com/github/huacnlee/activestorage-aliyun) [](https://codecov.io/github/huacnlee/activestorage-aliyun?branch=master)
|
@@ -24,7 +24,7 @@ $ bundle
|
|
24
24
|
|
25
25
|
config/storage.yml
|
26
26
|
|
27
|
-
```
|
27
|
+
```yml
|
28
28
|
production:
|
29
29
|
service: Aliyun
|
30
30
|
access_key_id: "your-oss-access-key-id"
|
@@ -37,10 +37,23 @@ production:
|
|
37
37
|
mode: "public"
|
38
38
|
```
|
39
39
|
|
40
|
+
### Custom Domain
|
41
|
+
|
42
|
+
```yml
|
43
|
+
production:
|
44
|
+
service: Aliyun
|
45
|
+
access_key_id: "your-oss-access-key-id"
|
46
|
+
access_key_secret: "your-oss-access-key-secret"
|
47
|
+
bucket: "bucket-name"
|
48
|
+
endpoint: "https://file.myhost.com"
|
49
|
+
# Enable cname to use custom domain
|
50
|
+
cname: true
|
51
|
+
```
|
52
|
+
|
40
53
|
### Use for image url
|
41
54
|
|
42
55
|
```erb
|
43
|
-
|
56
|
+
Original File URL:
|
44
57
|
|
45
58
|
<%= image_tag @photo.image.service_url %>
|
46
59
|
```
|
@@ -10,7 +10,8 @@ module ActiveStorage
|
|
10
10
|
|
11
11
|
def upload(key, io, checksum: nil)
|
12
12
|
instrument :upload, key: key, checksum: checksum do
|
13
|
-
|
13
|
+
content_type = Marcel::MimeType.for(io)
|
14
|
+
bucket.put_object(path_for(key), content_type: content_type) do |stream|
|
14
15
|
stream << io.read
|
15
16
|
end
|
16
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activestorage-aliyun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 5.2.0
|
19
|
+
version: 5.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 5.2.0
|
26
|
+
version: 5.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aliyun-sdk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,7 +46,6 @@ extra_rdoc_files: []
|
|
46
46
|
files:
|
47
47
|
- CHANGELOG.md
|
48
48
|
- README.md
|
49
|
-
- Rakefile
|
50
49
|
- lib/active_storage/service/aliyun_service.rb
|
51
50
|
- lib/active_storage_aliyun/railtie.rb
|
52
51
|
- lib/active_storage_aliyun/version.rb
|
@@ -71,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
70
|
version: '0'
|
72
71
|
requirements: []
|
73
72
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.7.
|
73
|
+
rubygems_version: 2.7.8
|
75
74
|
signing_key:
|
76
75
|
specification_version: 4
|
77
76
|
summary: Wraps the Aliyun OSS as an Active Storage service
|
data/Rakefile
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'bundler/setup'
|
3
|
-
rescue LoadError
|
4
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'rdoc/task'
|
8
|
-
|
9
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
rdoc.rdoc_dir = 'rdoc'
|
11
|
-
rdoc.title = 'ActiveStorage Aliyun Service'
|
12
|
-
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.md')
|
14
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
-
end
|
16
|
-
|
17
|
-
require 'bundler/gem_tasks'
|
18
|
-
|
19
|
-
require 'rake/testtask'
|
20
|
-
|
21
|
-
Rake::TestTask.new(:test) do |t|
|
22
|
-
t.libs << 'test'
|
23
|
-
t.pattern = 'test/**/*_test.rb'
|
24
|
-
t.verbose = false
|
25
|
-
end
|
26
|
-
|
27
|
-
task default: :test
|