carrierwave-aliyun 1.2.0 → 1.2.1

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
  SHA256:
3
- metadata.gz: 54c88d264e49631dd46a637080fc79b10cb73d487910a1608afd4ac67cf65561
4
- data.tar.gz: 7362e2b9d48547d369994443b105af5f4d57f7a34b64a7c78b51b9ecf940aa8e
3
+ metadata.gz: 03a96d213f40d85c4e9cb135f1e32490fd3dcd2c38e1fe4c5fb866a0c06f8813
4
+ data.tar.gz: 372720e762645aed633542bce67a177b1718a1282ddf0012ca8d52eab554718d
5
5
  SHA512:
6
- metadata.gz: 6589f76ad4cc466e3bd1acb690a0759786cb7ec2517fe2e51c2aeb0ad044053ff1b6d373bc04b51c75db6cb34551f0fe1a9d22c688bb66579a1d8f8303af37c7
7
- data.tar.gz: '00487944ad9d21be007c4f1148ce676e376c621f9d1de6207347d1f621351fda81c48b2f8100801cb6cff18965923447ae1034a396406da93b012280bb34590e'
6
+ metadata.gz: a4957fb8b0998385cd932c142688cfd6dd8a2d9a971822a0fbf345e26382f2b44055e9a68e59a6ebc9c2ffae64a225eac6e30b97e43c4499ba177684982d38c0
7
+ data.tar.gz: 808b8d986b14cf9fcc25fd551c752a81e55bf59cd42db1b08b3c124a0de920254ea1f79fa5ca91a6c45ace1078716c097579f15f824edfa1117f5229a1b0c6db
@@ -1,3 +1,7 @@
1
+ ## 1.2.1
2
+
3
+ - 实现 `size` 方法,修正更新图片数组时,新上传的图片会取代旧图片的问题。(#73)
4
+
1
5
  ## 1.2.0
2
6
 
3
7
  - 整理修复 OSS 文件访问 URL 的生成方式,去掉 img host,保持和最新 OSS API 一样的逻辑。
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CarrierWave
4
4
  module Aliyun
5
- VERSION = "1.2.0"
5
+ VERSION = "1.2.1"
6
6
  end
7
7
  end
@@ -3,6 +3,7 @@
3
3
  module CarrierWave
4
4
  module Storage
5
5
  class AliyunFile
6
+ attr_writer :file
6
7
  attr_reader :uploader, :path
7
8
 
8
9
  alias_method :filename, :path
@@ -12,6 +13,14 @@ module CarrierWave
12
13
  @uploader, @path, @base = uploader, escape(path), base
13
14
  end
14
15
 
16
+ def file
17
+ @file ||= bucket.get(path).try(:first)
18
+ end
19
+
20
+ def size
21
+ file.headers[:content_length].to_i rescue nil
22
+ end
23
+
15
24
  def escape(path)
16
25
  CGI.escape(path).gsub("%2F", "/")
17
26
  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: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-21 00:00:00.000000000 Z
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
@@ -57,7 +57,7 @@ homepage: https://github.com/huacnlee/carrierwave-aliyun
57
57
  licenses:
58
58
  - MIT
59
59
  metadata: {}
60
- post_install_message:
60
+ post_install_message:
61
61
  rdoc_options: []
62
62
  require_paths:
63
63
  - lib
@@ -72,8 +72,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubygems_version: 3.0.3
76
- signing_key:
75
+ rubygems_version: 3.1.4
76
+ signing_key:
77
77
  specification_version: 4
78
78
  summary: Aliyun OSS support for Carrierwave
79
79
  test_files: []