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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b4c3e25cff05a222bea176fd00d93bca1f0a1b8d
4
- data.tar.gz: d3944b5799e7a265a412069638dac44299a4d5f5
3
+ metadata.gz: 53decd06c8f555306944151549e3dcf77aba121c
4
+ data.tar.gz: d2b63cbc759d87580f6063ca5cac95c677e68730
5
5
  SHA512:
6
- metadata.gz: d2e42fba4c36c234f5f7b95332993a1834fd82de3bde29694aa7a5b5a4043db9afa8341fff27b229b03eaeaa9ae6bdee9c338095ddc0505647a2521ba08a93ff
7
- data.tar.gz: 5a9d5b8ff8433ced9b1ad46ae3be257a814880eee978399ca748daa91d15e43f279e88c0ba92b6b944a177fcb90b7adde3839caeb51f0e1a3a1639c8a45a365a
6
+ metadata.gz: e9a8edaa67c65cc46081a2f7148e88a12baa11a6f8a10511cbec1852bef4ce4a2aaccd5a82d192cdde3692f3b127354d2ea281bc3abe6c1b5773021ba15304df
7
+ data.tar.gz: 49db38d01fc589d6f3308f7e8e7d53e335defbbfca080504ffbe80d1a7a1ffe243d73bfafcf0a33091710f867674096f28f6d1b9ecbec3675ed1c1c0ca0c8edd
@@ -1,3 +1,7 @@
1
+ ## 0.9.0
2
+
3
+ - 修正 `AliyunFile#read` 方法会报错的问题。(#53)
4
+
1
5
  ## 0.8.1
2
6
 
3
7
  - 去掉 `aliyun_img_host` 的配置项,不再需要了,Aliyun OSS 的 Bucket 域名以及默认执行图片处理协议,详见:[图片处理指南](https://help.aliyun.com/document_detail/44688.html).
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
- # 自定于域名请 CNAME 到 you_bucket_name.oss-cn-hangzhou.aliyuncs.com (you_bucket_name 是你的 bucket 的名称)
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
@@ -55,7 +55,7 @@ module CarrierWave
55
55
  path.sub!(PATH_PREFIX, '')
56
56
  res = oss_upload_client.bucket_get_object(path)
57
57
  if res.success?
58
- return res.parsed_response
58
+ return res
59
59
  else
60
60
  raise 'Get content faild'
61
61
  end
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module Aliyun
3
- VERSION = '0.8.1'
3
+ VERSION = '0.9.0'
4
4
  end
5
5
  end
@@ -10,9 +10,9 @@ module CarrierWave
10
10
  end
11
11
 
12
12
  def read
13
- object = bucket.get(@path)
14
- @headers = object.headers
15
- object
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.8.1
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-01-04 00:00:00.000000000 Z
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.5.2
146
+ rubygems_version: 2.6.13
147
147
  signing_key:
148
148
  specification_version: 4
149
149
  summary: Aliyun OSS support for Carrierwave