carrierwave-aliyun 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 876c53c7233505f4afc350bbf46e91c8a488d1842a74f4ee5802259d96468846
4
- data.tar.gz: b32c6cc04411c9f5c3115e78b91a7902f3d2a4068cbb325316631363c709de34
3
+ metadata.gz: 83e7828d8abba5ebf25ae01f845bf0695e596c432b9b867a42034454f5862058
4
+ data.tar.gz: 106b6e3372acfe88f89cf0c00346ba5d8ec33f97deb10077d07ee943d7b514ee
5
5
  SHA512:
6
- metadata.gz: 8b5211cab35612c46cb22c50816bc9846682cac9aaf14ce293229201550df03c773fde7b843c3fcf6ab0eb1500a14cf7cd0866183be525c10d12dbb26ae4c08b
7
- data.tar.gz: a3c1233546856b1fcc834810753bf4390f49dce8c8d9301b77e6096bc77a932280b83c386cf107c981053fefcefb5c1c103e069e1993362cd3937a18d33ef505
6
+ metadata.gz: ed4defc5158003da256b08bf9c13d798abab8f684fa8ccec4363438840f2ba12ab603115103396634764a127acece35779ba18e6704525ce24f6a98bf81bc33d
7
+ data.tar.gz: d23cb3be191b8feb7e9906589bdbe3833a204402e7961fc9f14f672de3e52cf1273a1cff05fae5136339aff2ec1a40946354acce402cb1f828d803628e5b4b4a
@@ -1,3 +1,7 @@
1
+ ## 1.1.2
2
+
3
+ - 修正废弃调用方式,避免在 Ruby 2.7 里面出现 warning.
4
+
1
5
  ## 1.1.1
2
6
 
3
7
  - 对于 CarrierWave 的 cache 机制正确支持;
@@ -2,6 +2,6 @@
2
2
 
3
3
  module CarrierWave
4
4
  module Aliyun
5
- VERSION = "1.1.1"
5
+ VERSION = "1.1.2"
6
6
  end
7
7
  end
@@ -9,7 +9,11 @@ module CarrierWave
9
9
  alias_method :identifier, :filename
10
10
 
11
11
  def initialize(uploader, base, path)
12
- @uploader, @path, @base = uploader, URI.encode(path), base
12
+ @uploader, @path, @base = uploader, escape(path), base
13
+ end
14
+
15
+ def escape(path)
16
+ CGI.escape(path).gsub("%2F", "/")
13
17
  end
14
18
 
15
19
  def read
@@ -34,9 +38,9 @@ module CarrierWave
34
38
  #
35
39
  def url(opts = {})
36
40
  if bucket.mode == :private
37
- bucket.private_get_url(path, opts)
41
+ bucket.private_get_url(path, **opts)
38
42
  else
39
- bucket.path_to_url(path, opts)
43
+ bucket.path_to_url(path, **opts)
40
44
  end
41
45
  end
42
46
 
@@ -53,7 +57,7 @@ module CarrierWave
53
57
  new_file.copy_to(path)
54
58
  else
55
59
  fog_file = new_file.to_file
56
- bucket.put(path, fog_file, headers)
60
+ bucket.put(path, fog_file, **headers)
57
61
  fog_file.close if fog_file && !fog_file.closed?
58
62
  end
59
63
  true
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.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-12 00:00:00.000000000 Z
11
+ date: 2019-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
@@ -72,7 +72,7 @@ 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
75
+ rubygems_version: 3.1.2
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Aliyun OSS support for Carrierwave