carrierwave-qiniu 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -2
- data/lib/carrierwave-qiniu/version.rb +1 -1
- data/lib/carrierwave/storage/qiniu.rb +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93ed29055600a3cc7f50860cb13b84568e93f59c
|
4
|
+
data.tar.gz: c99cd2a790de9b9f3efd3062ac208ae85db8bf9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9d15a44ff62760e6a878552064332b3424f60dbfbc9e82bcb580dfead90cb3d50eac4e79e1e74c5587fa53e49173256a59711f2378c2edb110a84f51f5b3d55
|
7
|
+
data.tar.gz: b07c0c7f072869a6860dcb2e3cb1d958aa1a9b57a3124bbe96779ac71db9d48aba45c6c1ac5f615730d5aac1fb2f83a987b89f20d574f528a31265192e9f8878
|
data/README.md
CHANGED
@@ -58,10 +58,11 @@ class AvatarUploader < CarrierWave::Uploader::Base
|
|
58
58
|
self.qiniu_can_overwrite = true
|
59
59
|
self.qiniu_bucket_private= true #default is false
|
60
60
|
|
61
|
-
#
|
61
|
+
# 指定预转数据处理命令
|
62
62
|
# https://github.com/qiniu/ruby-sdk/issues/48
|
63
63
|
# http://docs.qiniu.com/api/put.html#uploadToken
|
64
64
|
# http://docs.qiniutek.com/v3/api/io/#uploadToken-asyncOps
|
65
|
+
# http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html#put-policy-persistent-ops-explanation
|
65
66
|
def qiniu_async_ops
|
66
67
|
commands = []
|
67
68
|
%W(small little middle large).each do |style|
|
@@ -72,7 +73,8 @@ class AvatarUploader < CarrierWave::Uploader::Base
|
|
72
73
|
|
73
74
|
end
|
74
75
|
```
|
75
|
-
You can see a example project on: https://github.com/huobazi/carrierwave-qiniu-example
|
76
|
+
You can see a example project on: https://github.com/huobazi/carrierwave-qiniu-example
|
77
|
+
or see the spec test on https://github.com/huobazi/carrierwave-qiniu/blob/master/spec/upload_spec.rb
|
76
78
|
|
77
79
|
## Contributing
|
78
80
|
|
@@ -22,15 +22,16 @@ module CarrierWave
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def store(file, key)
|
25
|
-
|
26
|
-
|
25
|
+
overwrite_file = nil
|
26
|
+
overwrite_file = key if @qiniu_can_overwrite
|
27
27
|
|
28
28
|
put_policy = ::Qiniu::Auth::PutPolicy.new(
|
29
29
|
@qiniu_bucket,
|
30
|
-
|
30
|
+
overwrite_file,
|
31
31
|
@qiniu_expires_in,
|
32
|
-
|
32
|
+
nil
|
33
33
|
)
|
34
|
+
put_policy.persistent_ops = @qiniu_async_ops
|
34
35
|
|
35
36
|
code, result, response_headers = ::Qiniu::Storage.upload_with_put_policy(
|
36
37
|
put_policy,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-qiniu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marble Wu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|