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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8bad4c75d2ab3ebb6d1c841e9a98a179921c3615
4
- data.tar.gz: 2a1e3fed0a215606b09f274da154ae393ee87edd
3
+ metadata.gz: 93ed29055600a3cc7f50860cb13b84568e93f59c
4
+ data.tar.gz: c99cd2a790de9b9f3efd3062ac208ae85db8bf9c
5
5
  SHA512:
6
- metadata.gz: bfdb0c9acbc8dcc2cb8f8c5225bf17347008567de9e348d86b7b9bf812d270e5b73d1501cb3eb743473b2471727078e6b147335f03b62784d5c2a8748c9930a0
7
- data.tar.gz: deebaf0d34d9d813b8d2334d6d23a131c9a18469351485dafcefa669283ad5086e29be4ac0bc145f175aea135b94ef96aae1764c4914a3622653507734498af2
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
- # See also:
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 or see the spec test on https://github.com/huobazi/carrierwave-qiniu/blob/master/spec/upload_spec.rb
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
 
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Carrierwave
3
3
  module Qiniu
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
6
6
  end
@@ -22,15 +22,16 @@ module CarrierWave
22
22
  end
23
23
 
24
24
  def store(file, key)
25
- qiniu_upload_scope = @qiniu_bucket
26
- qiniu_upload_scope = @qiniu_bucket + ':' + key if @qiniu_can_overwrite
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
- key,
30
+ overwrite_file,
31
31
  @qiniu_expires_in,
32
- 1
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
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-28 00:00:00.000000000 Z
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave