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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25e4c65f600597e1c2cc8ec0e9f4cf06044b0e60
4
- data.tar.gz: 364f0df6e6f470ec901df437f0831a2f1c473040
3
+ metadata.gz: 44f8c4c57b183fdc5bab9da03770fbb6452743d4
4
+ data.tar.gz: aa0cef55223b90429fb3928d87e687104d27fcc5
5
5
  SHA512:
6
- metadata.gz: 60925c4e88c63a2bc82caf7856c7703cf55b9cd634f855b931d2aee9a2150b915627c1e341cbb9ace24f7d9d303bae67871e118132f51976e81a26c0364ed0c2
7
- data.tar.gz: 4e82ed9ba1c8c212bfc22f9299c778e1ee16b741a271a31408df58ed5230c23abe308a25a75bc34549e3dcceb9c945625acf79c47b8e6a2124b28e384644506b
6
+ metadata.gz: 7692eeb1bf7f5ed272a2b981f99c2eaf394168cdf7762b297553c6508073661e3ad3de3a349a43ff2d1a4fb20f262f35537e1e0fbb4bd3d599b2999f0ae05242
7
+ data.tar.gz: 21ef8f4d3f2b06f335280c688c016bd8e37f0c2cd528584caa1daebc8f5bca6e864b2b857a6dbf950333c5b45589dee0540d6c673288c869e7fa393a883964f6
@@ -1,3 +1,7 @@
1
+ ## 0.3.3
2
+
3
+ * 增加 `config.aliyun_upload_host`, 以便有需要的时候,可以自由修改上传的 host.
4
+
1
5
  ## 0.3.2
2
6
 
3
7
  * 请注意 `config.aliyun_host` 要求修改带 HTTP 协议,以便支持设置 http:// 或 https://.
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
 
@@ -9,6 +9,7 @@ module CarrierWave
9
9
  add_config :aliyun_area
10
10
  add_config :aliyun_internal
11
11
  add_config :aliyun_host
12
+ add_config :aliyun_upload_host
12
13
  end
13
14
  end
14
15
 
@@ -1,7 +1,7 @@
1
1
  module CarrierWave
2
2
  module Aliyun
3
3
  class Version
4
- MAJOR, MINOR, PATCH = 0, 3, 2
4
+ MAJOR, MINOR, PATCH = 0, 3, 3
5
5
 
6
6
  ##
7
7
  # Returns the major version ( big release based off of multiple minor releases )
@@ -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 options[:aliyun_internal] == true
21
- @aliyun_upload_host = "http://#{@aliyun_bucket}.oss-#{@aliyun_area}-internal.aliyuncs.com"
22
- else
23
- @aliyun_upload_host = "http://#{@aliyun_bucket}.oss-#{@aliyun_area}.aliyuncs.com"
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.2
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-15 00:00:00.000000000 Z
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
- - Changelogs.md
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.2
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: