qiniu-rs 3.4.0 → 3.4.1
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.
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/docs/README.md +5 -1
- data/lib/qiniu/rs/version.rb +1 -1
- data/lib/qiniu/rs.rb +1 -0
- data/lib/qiniu/tokens/upload_token.rb +3 -1
- data/spec/qiniu/rs/image_spec.rb +6 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/docs/README.md
CHANGED
@@ -125,7 +125,8 @@ title: Ruby SDK 使用指南 | 七牛云存储
|
|
125
125
|
:callback_url => callback_url,
|
126
126
|
:callback_body_type => callback_body_type,
|
127
127
|
:customer => end_user_id,
|
128
|
-
:escape => allow_upload_callback_api
|
128
|
+
:escape => allow_upload_callback_api,
|
129
|
+
:async_options => async_callback_api_commands
|
129
130
|
|
130
131
|
**参数**
|
131
132
|
|
@@ -157,6 +158,9 @@ title: Ruby SDK 使用指南 | 七牛云存储
|
|
157
158
|
|
158
159
|
`foo=bar&w=$(imageInfo.width)&h=$(imageInfo.height)&exif=$(exif)`
|
159
160
|
|
161
|
+
:async_options
|
162
|
+
: 可选,字符串类型(String),用于设置文件上传成功后,执行指定的预转指令。参见 [uploadToken 之 asyncOps 说明](http://docs.qiniutek.com/v3/api/io/#uploadToken-asyncOps)
|
163
|
+
|
160
164
|
**返回值**
|
161
165
|
|
162
166
|
返回一个字符串类型(String)的用于上传文件用的临时授权 `upload_token`。
|
data/lib/qiniu/rs/version.rb
CHANGED
data/lib/qiniu/rs.rb
CHANGED
@@ -10,7 +10,7 @@ module Qiniu
|
|
10
10
|
|
11
11
|
include Utils
|
12
12
|
|
13
|
-
attr_accessor :scope, :expires_in, :callback_url, :callback_body_type, :customer, :escape
|
13
|
+
attr_accessor :scope, :expires_in, :callback_url, :callback_body_type, :customer, :escape, :async_options
|
14
14
|
|
15
15
|
def initialize(opts = {})
|
16
16
|
@scope = opts[:scope]
|
@@ -19,6 +19,7 @@ module Qiniu
|
|
19
19
|
@callback_body_type = opts[:callback_body_type]
|
20
20
|
@customer = opts[:customer]
|
21
21
|
@escape = opts[:escape]
|
22
|
+
@async_options = opts[:async_options]
|
22
23
|
end
|
23
24
|
|
24
25
|
def generate_signature
|
@@ -27,6 +28,7 @@ module Qiniu
|
|
27
28
|
params[:callbackBodyType] = @callback_body_type if !@callback_body_type.nil? && !@callback_body_type.empty?
|
28
29
|
params[:customer] = @customer if !@customer.nil? && !@customer.empty?
|
29
30
|
params[:escape] = 1 if @escape == 1 || @escape == true
|
31
|
+
params[:asyncOps] = @async_options if !@async_options.nil? && !@async_options.empty?
|
30
32
|
Utils.urlsafe_base64_encode(params.to_json)
|
31
33
|
end
|
32
34
|
|
data/spec/qiniu/rs/image_spec.rb
CHANGED
@@ -20,7 +20,12 @@ module Qiniu
|
|
20
20
|
|
21
21
|
local_file = File.expand_path('../' + @key, __FILE__)
|
22
22
|
|
23
|
-
upopts = {
|
23
|
+
upopts = {
|
24
|
+
:scope => @bucket,
|
25
|
+
:expires_in => 3600,
|
26
|
+
:customer => "why404@gmail.com",
|
27
|
+
:async_options => "imageView/1/w/120/h/120"
|
28
|
+
}
|
24
29
|
uptoken = Qiniu::RS.generate_upload_token(upopts)
|
25
30
|
data = Qiniu::RS.upload_file :uptoken => uptoken, :file => local_file, :bucket => @bucket, :key => @key
|
26
31
|
puts data.inspect
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qiniu-rs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -188,7 +188,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
188
188
|
version: '0'
|
189
189
|
segments:
|
190
190
|
- 0
|
191
|
-
hash: -
|
191
|
+
hash: -607371140838855446
|
192
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
193
|
none: false
|
194
194
|
requirements:
|
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
197
|
version: '0'
|
198
198
|
segments:
|
199
199
|
- 0
|
200
|
-
hash: -
|
200
|
+
hash: -607371140838855446
|
201
201
|
requirements: []
|
202
202
|
rubyforge_project:
|
203
203
|
rubygems_version: 1.8.24
|