qiniu 6.8.0 → 6.8.1

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: de7295d2117d781da3393be2970a1fe47fc805e7
4
- data.tar.gz: effdc4eeb3869a3cac362d6f23196f3b6a22f20a
3
+ metadata.gz: 82f51989fb126863f36c204186a0d3065d9d240e
4
+ data.tar.gz: d691e53432a0b3cdffc3407cbc4b1f0798b9f194
5
5
  SHA512:
6
- metadata.gz: d6ffe81579309aa77188ead19e97d422176496b1ecb8b32c4d4455d5dbe0b175a7a55ce73112f8fbb0e2338ee6caa3b25a68ae2e3e038f9a1c23fc945cb6e125
7
- data.tar.gz: 302e9930d19d6ecf33d69a8a77adc457b16cbcb08e0f6a641efe80405f61a3c6fac674c3e76b7702f1574fd475b96976f6d1f39da40a01ab36f2b87359bfa438
6
+ metadata.gz: 6457dd9d80b710e52fb52610af683f990460842f131937b477827791ffd202685361097d1126aa15382423d32e7b3037e622e3fb4db0efc2bf131a103dd1efae
7
+ data.tar.gz: bda38a85d3b1dd1f199018bc4c78baf40431027c850faff7e6330238487fa5360a20234d9d61e61a348caf05bc58936c4474394613158301dc2b5919191a6947
@@ -1,5 +1,11 @@
1
1
  ## CHANGE LOG
2
2
 
3
+ ### v6.8.1
4
+
5
+ - 增加delafterdays 策略。[https://github.com/qiniu/ruby-sdk/pull/162](https://github.com/qiniu/ruby-sdk/pull/162)
6
+
7
+ - 调整依赖。[https://github.com/qiniu/ruby-sdk/pull/167](https://github.com/qiniu/ruby-sdk/pull/167)
8
+
3
9
  ### v6.8.0
4
10
 
5
11
  - 支持多存储区域,部分 API 需要额外的 bucket 参数。[https://github.com/qiniu/ruby-sdk/pull/161](https://github.com/qiniu/ruby-sdk/pull/161)
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'qiniu'
4
+ require 'qiniu/utils'
5
+
6
+ # 构建鉴权对象
7
+ Qiniu.establish_connection! :access_key => 'AK',
8
+ :secret_key => 'SK'
9
+
10
+ #要转码的文件所在的空间和文件名。
11
+ bucket = 'Bucket_Name'
12
+ key = '1.mp4'
13
+
14
+ #转码所使用的队列名称。
15
+ pipeline = 'abc'
16
+
17
+ #要进行转码的转码操作。
18
+ fops = "avthumb/mp4/s/640x360/vb/1.25m"
19
+
20
+
21
+ #可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当间。
22
+ saveas_key = Qiniu::Utils.urlsafe_base64_encode(目标Bucket_Name:自定义文件key)
23
+ fops = fops+'|saveas/'+saveas_key
24
+
25
+ pfops = Qiniu::Fop::Persistance::PfopPolicy.new(
26
+ bucket, # 存储空间
27
+ key, # 最终资源名,可省略,即缺省为“创建”语义
28
+ fops,
29
+ 'www.baidu.com'
30
+ )
31
+ pfops.pipeline=pipeline
32
+
33
+ code, result, response_headers = Qiniu::Fop::Persistance.pfop(pfops)
34
+ puts code
35
+ puts result
36
+ puts response_headers
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'qiniu'
4
+ require 'qiniu/utils'
5
+
6
+ # 构建鉴权对象
7
+ Qiniu.establish_connection! :access_key => 'AK',
8
+ :secret_key => 'SK'
9
+
10
+ #要转码的文件所在的空间和文件名。
11
+ bucket = 'Bucket_Name'
12
+ key = '1.mp4'
13
+
14
+ #转码所使用的队列名称。
15
+ pipeline = 'abc'
16
+
17
+ #要进行视频截图操作。
18
+ fops = "vframe/jpg/offset/1/w/480/h/360/rotate/90"
19
+
20
+
21
+ #可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当间。
22
+ saveas_key = Qiniu::Utils.urlsafe_base64_encode(目标Bucket_Name:自定义文件key)
23
+ fops = fops+'|saveas/'+saveas_key
24
+
25
+ pfops = Qiniu::Fop::Persistance::PfopPolicy.new(
26
+ bucket, # 存储空间
27
+ key, # 最终资源名,可省略,即缺省为“创建”语义
28
+ fops,
29
+ 'www.baidu.com'
30
+ )
31
+ pfops.pipeline=pipeline
32
+
33
+ code, result, response_headers = Qiniu::Fop::Persistance.pfop(pfops)
34
+ puts code
35
+ puts result
36
+ puts response_headers
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'qiniu'
4
+ require 'qiniu/utils'
5
+
6
+ # 构建鉴权对象
7
+ Qiniu.establish_connection! :access_key => 'AK',
8
+ :secret_key => 'SK'
9
+
10
+ #要转码的文件所在的空间和文件名。
11
+ bucket = 'Bucket_Name'
12
+ key = '1.mp4'
13
+
14
+ #转码所使用的队列名称。
15
+ pipeline = 'abc'
16
+
17
+ #需要添加水印的图片UrlSafeBase64,可以参考http://developer.qiniu.com/code/v6/api/dora-api/av/video-watermark.html
18
+ base64URL = Qiniu::Utils.urlsafe_base64_encode('http://developer.qiniu.com/resource/logo-2.jpg')
19
+
20
+ #水印参数
21
+ fops = "avthumb/mp4/wmImage"+base64URL
22
+
23
+ #可以对转码后的文件进行使用saveas参数自定义命名,当然也可以不指定文件会默认命名并保存在当间。
24
+ saveas_key = Qiniu::Utils.urlsafe_base64_encode(目标Bucket_Name:自定义文件key)
25
+ fops = fops+'|saveas/'+saveas_key
26
+
27
+ pfops = Qiniu::Fop::Persistance::PfopPolicy.new(
28
+ bucket, # 存储空间
29
+ key, # 最终资源名,可省略,即缺省为“创建”语义
30
+ fops,
31
+ 'www.baidu.com'
32
+ )
33
+ pfops.pipeline=pipeline
34
+
35
+ code, result, response_headers = Qiniu::Fop::Persistance.pfop(pfops)
36
+ puts code
37
+ puts result
38
+ puts response_headers
@@ -76,7 +76,8 @@ module Qiniu
76
76
  :detect_mime => "detectMime" ,
77
77
  :mime_limit => "mimeLimit" ,
78
78
  :uphosts => "uphosts" ,
79
- :global => "global"
79
+ :global => "global" ,
80
+ :delete_after_days => "deleteAfterDays"
80
81
  } # PARAMS
81
82
 
82
83
  public
@@ -11,7 +11,7 @@ module Qiniu
11
11
 
12
12
  include Utils
13
13
 
14
- attr_accessor :scope, :expires_in, :callback_url, :callback_body, :callback_body_type, :customer, :escape, :async_options, :return_body, :return_url
14
+ attr_accessor :scope, :expires_in, :callback_url, :callback_body, :callback_body_type, :customer, :escape, :async_options, :return_body, :return_url, :delete_after_days
15
15
 
16
16
  def initialize(opts = {})
17
17
  @scope = opts[:scope]
@@ -26,6 +26,7 @@ module Qiniu
26
26
  @persistent_pipeline = opts[:persistent_pipeline]
27
27
  @return_body = opts[:return_body]
28
28
  @return_url = opts[:return_url]
29
+ @delete_after_days = opts[:delete_after_days]
29
30
  end
30
31
 
31
32
  def generate_signature
@@ -41,6 +42,7 @@ module Qiniu
41
42
  params[:persistentOps] = @persistent_ops if !@persistent_ops.nil? && !@persistent_ops.empty?
42
43
  params[:persistentNotifyUrl] = @persistent_notify_url if !@persistent_notify_url.nil? && !@persistent_notify_url.empty?
43
44
  params[:persistentPipeline] = @persistent_pipeline if !@persistent_pipeline.nil? && !@persistent_pipeline.empty?
45
+ params[:deleteAfterDays] = @delete_after_days if !@delete_after_days.nil? && !@delete_after_days.empty?
44
46
 
45
47
  Utils.urlsafe_base64_encode(params.to_json)
46
48
  end
@@ -4,7 +4,7 @@ module Qiniu
4
4
  module Version
5
5
  MAJOR = 6
6
6
  MINOR = 8
7
- PATCH = 0
7
+ PATCH = 1
8
8
  # Returns a version string by joining <tt>MAJOR</tt>, <tt>MINOR</tt>, and <tt>PATCH</tt> with <tt>'.'</tt>
9
9
  #
10
10
  # Example
@@ -3,27 +3,27 @@
3
3
  require File.expand_path('../lib/qiniu/version', __FILE__)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
- gem.authors = ["why404","BluntBlade"]
7
- gem.email = ["sdk@qiniu.com"]
6
+ gem.authors = ['why404','BluntBlade']
7
+ gem.email = ['sdk@qiniu.com']
8
8
  gem.description = %q{Qiniu Resource (Cloud) Storage SDK for Ruby. See: http://developer.qiniu.com/docs/v6/sdk/ruby-sdk.html}
9
9
  gem.summary = %q{Qiniu Resource (Cloud) Storage SDK for Ruby}
10
- gem.homepage = "https://github.com/qiniu/ruby-sdk"
10
+ gem.homepage = 'https://github.com/qiniu/ruby-sdk'
11
11
 
12
12
  gem.files = `git ls-files`.split($\)
13
13
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
14
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
15
- gem.name = "qiniu"
16
- gem.require_paths = ["lib"]
14
+ gem.test_files = gem.files.grep(%r{^(test|spec|features|examples)/})
15
+ gem.name = 'qiniu'
16
+ gem.require_paths = ['lib']
17
17
  gem.version = Qiniu::Version.to_s
18
- gem.license = "MIT"
18
+ gem.license = 'MIT'
19
19
 
20
20
  # specify any dependencies here; for example:
21
- gem.add_development_dependency "rake", ">= 0.9"
22
- gem.add_development_dependency "rspec", ">= 2.11"
23
- gem.add_development_dependency "fakeweb", "~> 1.3"
24
- gem.add_runtime_dependency "json", "~> 1.8"
25
- gem.add_runtime_dependency "rest-client", "~> 1.8.0"
26
- gem.add_runtime_dependency "mime-types", ">= 2.4.0"
27
- gem.add_runtime_dependency "ruby-hmac", "~> 0.4"
28
- gem.add_runtime_dependency "jruby-openssl", "~> 0.7" if RUBY_PLATFORM == "java"
21
+ gem.add_development_dependency 'rake', '~> 0.9'
22
+ gem.add_development_dependency 'rspec', '~> 2.11'
23
+ gem.add_development_dependency 'fakeweb', '~> 1.3'
24
+ gem.add_runtime_dependency 'json', '~> 1.8'
25
+ gem.add_runtime_dependency 'rest-client', '~> 2.0', '>= 2.0.0'
26
+ gem.add_runtime_dependency 'mime-types', '~> 2.4', '>= 2.4.0'
27
+ gem.add_runtime_dependency 'ruby-hmac', '~> 0.4'
28
+ gem.add_runtime_dependency 'jruby-openssl', '~> 0.7' if RUBY_PLATFORM == 'java'
29
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qiniu
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.8.0
4
+ version: 6.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - why404
@@ -9,34 +9,34 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-27 00:00:00.000000000 Z
12
+ date: 2016-08-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0.9'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0.9'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
34
  version: '2.11'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ">="
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '2.11'
42
42
  - !ruby/object:Gem::Dependency
@@ -73,18 +73,27 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: 1.8.0
76
+ version: '2.0'
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: 2.0.0
77
80
  type: :runtime
78
81
  prerelease: false
79
82
  version_requirements: !ruby/object:Gem::Requirement
80
83
  requirements:
81
84
  - - "~>"
82
85
  - !ruby/object:Gem::Version
83
- version: 1.8.0
86
+ version: '2.0'
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 2.0.0
84
90
  - !ruby/object:Gem::Dependency
85
91
  name: mime-types
86
92
  requirement: !ruby/object:Gem::Requirement
87
93
  requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '2.4'
88
97
  - - ">="
89
98
  - !ruby/object:Gem::Version
90
99
  version: 2.4.0
@@ -92,6 +101,9 @@ dependencies:
92
101
  prerelease: false
93
102
  version_requirements: !ruby/object:Gem::Requirement
94
103
  requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '2.4'
95
107
  - - ">="
96
108
  - !ruby/object:Gem::Version
97
109
  version: 2.4.0
@@ -132,6 +144,8 @@ files:
132
144
  - examples/fops.rb
133
145
  - examples/list.rb
134
146
  - examples/move.rb
147
+ - examples/pfop_vframe.rb
148
+ - examples/pfop_watermark.rb
135
149
  - examples/stat.rb
136
150
  - examples/upload.rb
137
151
  - examples/upload_callback.rb
@@ -201,6 +215,19 @@ signing_key:
201
215
  specification_version: 4
202
216
  summary: Qiniu Resource (Cloud) Storage SDK for Ruby
203
217
  test_files:
218
+ - examples/copy.rb
219
+ - examples/delete.rb
220
+ - examples/download.rb
221
+ - examples/fetch.rb
222
+ - examples/fops.rb
223
+ - examples/list.rb
224
+ - examples/move.rb
225
+ - examples/pfop_vframe.rb
226
+ - examples/pfop_watermark.rb
227
+ - examples/stat.rb
228
+ - examples/upload.rb
229
+ - examples/upload_callback.rb
230
+ - examples/upload_pfops.rb
204
231
  - spec/qiniu/abstract_spec.rb
205
232
  - spec/qiniu/auth_spec.rb
206
233
  - spec/qiniu/image_logo_for_test.png