carrierwave_ucloud 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 0371f9bcb1e2f3c5e7685999182e20c83d96106a
4
- data.tar.gz: c016bf40f6bf941a076a35530c209839941e9714
3
+ metadata.gz: a6be2782a99f538e0d03b3e06fdeb34d2e533584
4
+ data.tar.gz: 997acce65e48a97f6d1d67839917958f26b1b234
5
5
  SHA512:
6
- metadata.gz: 75d639800e68ae9fbdda57ecdb924202711794a4a59ca6eb0bf00c2cf91efc70e792042d117dc60b7c9b13ad226a247a0a6676906e7e9246074b2fb5759288c1
7
- data.tar.gz: 07faae1fa67dc46db26f3037345ed4f50edcf83042eb87672769f02e3ed2c4269f58a920ef06c432dcb445226e9928a09ef0820c3c953f539d94321883914296
6
+ metadata.gz: 014f0ea89cebf7a3f03f91f3b82a3628e847de95272db0a92c809ec3a6031c3cb992309b79ca5273813db8d2f64bb34c0d09811df32388e203ad544df72f208c
7
+ data.tar.gz: 4934b144cfc8d0a4c191b8ca3d003342e286f67ecee76156c57fe9be41d8a8226b10a731b33e828d6fb5540e9670b58d32dcdc4c09236980ca37a280e6ff3222
data/README.md CHANGED
@@ -46,6 +46,8 @@ end
46
46
  全局配置ucloud_public_read,默认使用对应bucket配置,个别uploader如要用另外一种bucket配置,添加如下方法:
47
47
  ```ruby
48
48
  class XxxUploader < CarrierWave::Uploader::Base
49
+ storage :ucloud
50
+
49
51
  def ucloud_public_read
50
52
  # true or false,XxxUploader以此配置选择bucket配置及逻辑
51
53
  end
@@ -20,8 +20,8 @@ module CarrierWave
20
20
  bucket.delete(path)
21
21
  end
22
22
 
23
- def url(opts = {})
24
- bucket.url(path, opts)
23
+ def url
24
+ bucket.url(path)
25
25
  end
26
26
 
27
27
  def store(file, headers = {})
@@ -63,29 +63,23 @@ module CarrierWave
63
63
  end
64
64
  end
65
65
 
66
- def url(path, opts = {})
66
+ def url(path)
67
67
  if @ucloud_public_read
68
- public_get_url(path, opts)
68
+ public_get_url(path)
69
69
  else
70
- private_get_url(path, opts)
70
+ private_get_url(path)
71
71
  end
72
72
  end
73
73
 
74
74
  # 公开的访问地址
75
- def public_get_url(path, opts = {})
75
+ def public_get_url(path)
76
76
  path.sub!(PATH_PREFIX, '')
77
- url = ''
78
- if opts[:thumb]
79
- # TODO
80
- else
81
- url = [@ucloud_cdn_host, path].join('/')
82
- end
83
- url
77
+ [@ucloud_cdn_host, path].join('/')
84
78
  end
85
79
 
86
80
  # 私有空间访问地址
87
- def private_get_url(path, opts = {})
88
- public_get_url(path, opts) + privite_get_url_auth(path)
81
+ def private_get_url(path)
82
+ public_get_url(path) + privite_get_url_auth(path)
89
83
  end
90
84
 
91
85
  private
@@ -1,3 +1,3 @@
1
1
  module CarrierwaveUcloud
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave_ucloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - zhchsf
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-30 00:00:00.000000000 Z
11
+ date: 2018-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave