carrierwave-aliyun 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{Changelogs.md → CHANGELOG.md} +4 -0
- data/README.md +2 -0
- data/lib/carrierwave/aliyun/configuration.rb +1 -0
- data/lib/carrierwave/aliyun/version.rb +1 -1
- data/lib/carrierwave/storage/aliyun.rb +10 -6
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44f8c4c57b183fdc5bab9da03770fbb6452743d4
|
4
|
+
data.tar.gz: aa0cef55223b90429fb3928d87e687104d27fcc5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7692eeb1bf7f5ed272a2b981f99c2eaf394168cdf7762b297553c6508073661e3ad3de3a349a43ff2d1a4fb20f262f35537e1e0fbb4bd3d599b2999f0ae05242
|
7
|
+
data.tar.gz: 21ef8f4d3f2b06f335280c688c016bd8e37f0c2cd528584caa1daebc8f5bca6e864b2b857a6dbf950333c5b45589dee0540d6c673288c869e7fa393a883964f6
|
data/README.md
CHANGED
@@ -35,6 +35,8 @@ CarrierWave.configure do |config|
|
|
35
35
|
# 使用自定义域名,设定此项,carrierwave 返回的 URL 将会用自定义域名
|
36
36
|
# 自定于域名请 CNAME 到 you_bucket_name.oss.aliyuncs.com (you_bucket_name 是你的 bucket 的名称)
|
37
37
|
config.aliyun_host = "http://foo.bar.com"
|
38
|
+
# 如果有需要,你可以自己定义上传 host, 比如阿里内部的上传地址和 Aliyun OSS 对外的不同,可以在这里定义,没有需要可以不用配置
|
39
|
+
# config.aliyun_upload_host = "http://you_bucket_name.oss.aliyun-inc.com"
|
38
40
|
end
|
39
41
|
```
|
40
42
|
|
@@ -15,14 +15,17 @@ module CarrierWave
|
|
15
15
|
@aliyun_access_key = options[:aliyun_access_key]
|
16
16
|
@aliyun_bucket = options[:aliyun_bucket]
|
17
17
|
@aliyun_area = options[:aliyun_area] || 'cn-hangzhou'
|
18
|
+
@aliyun_upload_host = options[:aliyun_upload_host]
|
18
19
|
|
19
20
|
# Host for upload
|
20
|
-
if
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
if @aliyun_upload_host.nil?
|
22
|
+
if options[:aliyun_internal] == true
|
23
|
+
@aliyun_upload_host = "http://#{@aliyun_bucket}.oss-#{@aliyun_area}-internal.aliyuncs.com"
|
24
|
+
else
|
25
|
+
@aliyun_upload_host = "http://#{@aliyun_bucket}.oss-#{@aliyun_area}.aliyuncs.com"
|
26
|
+
end
|
24
27
|
end
|
25
|
-
|
28
|
+
|
26
29
|
# Host for get request
|
27
30
|
@aliyun_host = options[:aliyun_host] || "http://#{@aliyun_bucket}.oss-#{@aliyun_area}.aliyuncs.com"
|
28
31
|
|
@@ -216,7 +219,8 @@ module CarrierWave
|
|
216
219
|
:aliyun_area => @uploader.aliyun_area,
|
217
220
|
:aliyun_bucket => @uploader.aliyun_bucket,
|
218
221
|
:aliyun_internal => @uploader.aliyun_internal,
|
219
|
-
:aliyun_host => @uploader.aliyun_host
|
222
|
+
:aliyun_host => @uploader.aliyun_host,
|
223
|
+
:aliyun_upload_host => @uploader.aliyun_upload_host
|
220
224
|
}
|
221
225
|
@oss_connection ||= CarrierWave::Storage::Aliyun::Connection.new(config)
|
222
226
|
end
|
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.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
@@ -48,7 +48,7 @@ files:
|
|
48
48
|
- ".gitignore"
|
49
49
|
- ".rspec"
|
50
50
|
- ".travis.yml"
|
51
|
-
-
|
51
|
+
- CHANGELOG.md
|
52
52
|
- Gemfile
|
53
53
|
- README.md
|
54
54
|
- carrierwave-aliyun.gemspec
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.4.
|
85
|
+
rubygems_version: 2.4.5
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Aliyun OSS support for Carrierwave
|
@@ -93,4 +93,3 @@ test_files:
|
|
93
93
|
- spec/foo.zip
|
94
94
|
- spec/spec_helper.rb
|
95
95
|
- spec/upload_spec.rb
|
96
|
-
has_rdoc:
|