carrierwave-aliyun 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/carrierwave/aliyun/bucket.rb +1 -1
- data/lib/carrierwave/aliyun/version.rb +1 -1
- data/lib/carrierwave/storage/aliyun_file.rb +6 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53decd06c8f555306944151549e3dcf77aba121c
|
4
|
+
data.tar.gz: d2b63cbc759d87580f6063ca5cac95c677e68730
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9a8edaa67c65cc46081a2f7148e88a12baa11a6f8a10511cbec1852bef4ce4a2aaccd5a82d192cdde3692f3b127354d2ea281bc3abe6c1b5773021ba15304df
|
7
|
+
data.tar.gz: 49db38d01fc589d6f3308f7e8e7d53e335defbbfca080504ffbe80d1a7a1ffe243d73bfafcf0a33091710f867674096f28f6d1b9ecbec3675ed1c1c0ca0c8edd
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -28,7 +28,7 @@ CarrierWave.configure do |config|
|
|
28
28
|
# 配置存储的地区数据中心,默认: cn-hangzhou
|
29
29
|
# config.aliyun_area = "cn-hangzhou"
|
30
30
|
# 使用自定义域名,设定此项,carrierwave 返回的 URL 将会用自定义域名
|
31
|
-
|
31
|
+
# 自定义域名请 CNAME 到 you_bucket_name.oss-cn-hangzhou.aliyuncs.com (you_bucket_name 是你的 bucket 的名称)
|
32
32
|
config.aliyun_host = "https://foo.bar.com"
|
33
33
|
# Bucket 为私有读取请设置 true,默认 false,以便得到的 URL 是能带有 private 空间访问权限的逻辑
|
34
34
|
# config.aliyun_private_read = false
|
@@ -10,9 +10,9 @@ module CarrierWave
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def read
|
13
|
-
|
14
|
-
@headers =
|
15
|
-
|
13
|
+
res = bucket.get(@path)
|
14
|
+
@headers = res.headers.deep_transform_keys { |k| k.underscore.to_sym rescue key }
|
15
|
+
res.body
|
16
16
|
end
|
17
17
|
|
18
18
|
def delete
|
@@ -38,7 +38,7 @@ module CarrierWave
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def content_type
|
41
|
-
headers[:content_type]
|
41
|
+
headers[:content_type].first
|
42
42
|
end
|
43
43
|
|
44
44
|
def content_type=(new_content_type)
|
@@ -49,12 +49,12 @@ module CarrierWave
|
|
49
49
|
bucket.put(@path, file, headers)
|
50
50
|
end
|
51
51
|
|
52
|
-
private
|
53
|
-
|
54
52
|
def headers
|
55
53
|
@headers ||= {}
|
56
54
|
end
|
57
55
|
|
56
|
+
private
|
57
|
+
|
58
58
|
def bucket
|
59
59
|
return @bucket if defined? @bucket
|
60
60
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-aliyun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
145
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.6.13
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: Aliyun OSS support for Carrierwave
|