qiniu 6.2.1 → 6.2.4

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: d8305d0d51c6dd65343f634f175edb242bc81733
4
- data.tar.gz: ae6055351cd00d341487bd545aef683ead3ae99f
3
+ metadata.gz: 349b796d9306147e929b2091445051f591cd2df1
4
+ data.tar.gz: 343159ae0e4736a2e7c720d21a8d86535d3acd20
5
5
  SHA512:
6
- metadata.gz: 729967aa45f514f1d9b205c9b8eeabc0d886634dfcfd7b38d3a89326c6e01bdb95966cd19de1e5e0fc7d0a94e5fe76715ff514ca5c2038b1d68c379c5b914f28
7
- data.tar.gz: 490c565dcfed6aca96e917d8228e0634c263ca52b7ed34dfc31d5ffc661dc3d6f82b39db72b1b9e196543b87ddaaabe56bc77cbc45b75f1cb8166617d77e3f66
6
+ metadata.gz: d92d87c525d88f9a598d16dcbc092a8ccf39812bc003d81e66f49382ef2686cf50232c719d6de616194ae77d190ec19a1043d0eac7178723ad09e7cfb2de5277
7
+ data.tar.gz: b71fdc23e374c5e69ba1fe6884a6a54d6e044d0ea1dccda4ac93d28e45f2f7207e98eee7a50b3da37e6d252157bfe1e5617421805674f7364bf10993f3b35a70
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  ## CHANGE LOG
2
2
 
3
+ ### v6.2.4
4
+
5
+ - 调整User Agent。 [https://github.com/qiniu/ruby-sdk/pull/94](https://github.com/qiniu/ruby-sdk/pull/94)
6
+
7
+ ### v6.2.3
8
+
9
+ - 为上传策略添加`persistentPipeline`参数,用于指明使用哪个命名转码队列。 [https://github.com/qiniu/ruby-sdk/pull/93](https://github.com/qiniu/ruby-sdk/pull/93)
10
+
11
+ ### v6.2.2
12
+
13
+ - 为/pfop接口添加`pipeline`参数,用于指明使用哪个命名转码队列。 [https://github.com/qiniu/ruby-sdk/pull/92](https://github.com/qiniu/ruby-sdk/pull/92)
14
+ - 为authorize_download_url()添加`:fop`参数,用于生成含数据处理指令的授权下载URL。
15
+
3
16
  ### v6.2.1
4
17
 
5
18
  - 去除已废弃的publish/unpublish接口。 [https://github.com/qiniu/ruby-sdk/pull/90](https://github.com/qiniu/ruby-sdk/pull/90) (#8143)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qiniu (6.2.1)
4
+ qiniu (6.2.4)
5
5
  json (~> 1.7)
6
6
  mime-types (~> 1.19)
7
7
  rest-client (~> 1.6)
data/lib/qiniu/auth.rb CHANGED
@@ -51,15 +51,14 @@ module Qiniu
51
51
  :callback_body => "callbackBody" ,
52
52
  :persistent_ops => "persistentOps" ,
53
53
  :persistent_notify_url => "persistentNotifyUrl" ,
54
- :transform => "transform" ,
54
+ :persistent_pipeline => "persistentPipeline" ,
55
55
 
56
56
  # 数值类型参数
57
57
  :deadline => "deadline" ,
58
58
  :insert_only => "insertOnly" ,
59
59
  :fsize_limit => "fsizeLimit" ,
60
60
  :detect_mime => "detectMime" ,
61
- :mime_limit => "mimeLimit" ,
62
- :fop_timeout => "fopTimeout"
61
+ :mime_limit => "mimeLimit"
63
62
  } # PARAMS
64
63
 
65
64
  public
@@ -140,16 +139,29 @@ module Qiniu
140
139
  access_key = Config.settings[:access_key]
141
140
  secret_key = Config.settings[:secret_key]
142
141
 
142
+ download_url = url
143
+
144
+ ### URL变换:追加FOP指令
145
+ if args[:fop].is_a?(String) && args[:fop] != '' then
146
+ if download_url.index('?').is_a?(Fixnum) then
147
+ # 已有参数
148
+ download_url = "#{download_url}&#{args[:fop]}"
149
+ else
150
+ # 尚无参数
151
+ download_url = "#{download_url}?#{args[:fop]}"
152
+ end
153
+ end
154
+
143
155
  ### 授权期计算
144
156
  e = Auth.calculate_deadline(args[:expires_in], args[:deadline])
145
157
 
146
158
  ### URL变换:追加授权期参数
147
- if url.index('?').is_a?(Fixnum) then
159
+ if download_url.index('?').is_a?(Fixnum) then
148
160
  # 已有参数
149
- download_url = "#{url}&e=#{e}"
161
+ download_url = "#{download_url}&e=#{e}"
150
162
  else
151
163
  # 尚无参数
152
- download_url = "#{url}?e=#{e}"
164
+ download_url = "#{download_url}?e=#{e}"
153
165
  end
154
166
 
155
167
  ### 生成数字签名
@@ -184,7 +196,7 @@ module Qiniu
184
196
  # 如果有Body,则也加上
185
197
  # (仅限于mime == "application/x-www-form-urlencoded"的情况)
186
198
  if body.is_a?(String) && !body.empty?
187
- signing_str += body
199
+ signing_str += body
188
200
  end
189
201
 
190
202
  ### 生成数字签名
data/lib/qiniu/config.rb CHANGED
@@ -15,7 +15,7 @@ module Qiniu
15
15
  class << self
16
16
 
17
17
  DEFAULT_OPTIONS = {
18
- :user_agent => 'Qiniu-RS-Ruby-SDK-' + Version.to_s + '()',
18
+ :user_agent => 'QiniuRuby/' + Version.to_s + ' ('+RUBY_PLATFORM+')' + ' Ruby/'+ RUBY_VERSION,
19
19
  :method => :post,
20
20
  :content_type => 'application/x-www-form-urlencoded',
21
21
  :auth_url => "https://acc.qbox.me/oauth2/token",
@@ -23,8 +23,6 @@ module Qiniu
23
23
  :up_host => "http://up.qiniu.com",
24
24
  :pub_host => "http://pu.qbox.me:10200",
25
25
  :eu_host => "http://eu.qbox.me",
26
- :client_id => "a75604760c4da4caaa456c0c5895c061c3065c5a",
27
- :client_secret => "75df554a39f58accb7eb293b550fa59618674b7d",
28
26
  :access_key => "",
29
27
  :secret_key => "",
30
28
  :auto_reconnect => true,
@@ -32,7 +30,7 @@ module Qiniu
32
30
  :block_size => 1024*1024*4,
33
31
  :chunk_size => 1024*256,
34
32
  :enable_debug => true,
35
- :tmpdir => Dir.tmpdir + File::SEPARATOR + 'Qiniu-RS-Ruby-SDK'
33
+ :tmpdir => Dir.tmpdir + File::SEPARATOR + 'QiniuRuby'
36
34
  }
37
35
 
38
36
  REQUIRED_OPTION_KEYS = [:access_key, :secret_key]
data/lib/qiniu/pfop.rb CHANGED
@@ -30,6 +30,7 @@ module Qiniu
30
30
  :key => "key",
31
31
  :fops => "fops",
32
32
  :notify_url => "notifyURL",
33
+ :pipeline => "pipeline",
33
34
 
34
35
  # 数值类型参数
35
36
  :force => "force"
data/lib/qiniu/version.rb CHANGED
@@ -4,7 +4,7 @@ module Qiniu
4
4
  module Version
5
5
  MAJOR = 6
6
6
  MINOR = 2
7
- PATCH = 1
7
+ PATCH = 4
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
@@ -1,4 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ # vim: sw=2 ts=2
2
3
 
3
4
  require 'spec_helper'
4
5
  require 'qiniu/auth'
@@ -56,7 +57,12 @@ module Qiniu
56
57
  result.body.should_not be_empty
57
58
 
58
59
  ### 授权下载地址(带参数)
59
- download_url = Qiniu::Auth.authorize_download_url(url + '?download/a.m3u8')
60
+ download_url = Qiniu::Auth.authorize_download_url(
61
+ url,
62
+ {
63
+ :fop => 'download/a.m3u8'
64
+ }
65
+ )
60
66
  puts "download_url=#{download_url}"
61
67
 
62
68
  result = RestClient.get(download_url)
@@ -7,7 +7,7 @@ module Qiniu
7
7
  module RS
8
8
  describe QboxToken do
9
9
  before :all do
10
- @qbox_token = QboxToken.new(:url => 'www.qiniutek.com?key1=value1',
10
+ @qbox_token = QboxToken.new(:url => 'www.qiniu.com?key1=value1',
11
11
  :params => { :key2 => 'value2' })
12
12
  @qbox_token.access_key = 'access_key'
13
13
  @qbox_token.secret_key = 'secret_key'
@@ -21,7 +21,7 @@ module Qiniu
21
21
 
22
22
  context "#generate_signature" do
23
23
  it "should generate signature" do
24
- @qbox_token.generate_signature.should == "www.qiniutek.com?key1=value1\nkey2=value2"
24
+ @qbox_token.generate_signature.should == "www.qiniu.com?key1=value1\nkey2=value2"
25
25
  end
26
26
  end
27
27
  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.2.1
4
+ version: 6.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - why404
@@ -9,104 +9,104 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-04-21 00:00:00.000000000 Z
12
+ date: 2014-06-20 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
43
43
  name: fakeweb
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ~>
47
47
  - !ruby/object:Gem::Version
48
48
  version: '1.3'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ~>
54
54
  - !ruby/object:Gem::Version
55
55
  version: '1.3'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: json
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ~>
61
61
  - !ruby/object:Gem::Version
62
62
  version: '1.7'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
69
  version: '1.7'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rest-client
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "~>"
74
+ - - ~>
75
75
  - !ruby/object:Gem::Version
76
76
  version: '1.6'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - "~>"
81
+ - - ~>
82
82
  - !ruby/object:Gem::Version
83
83
  version: '1.6'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: mime-types
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - "~>"
88
+ - - ~>
89
89
  - !ruby/object:Gem::Version
90
90
  version: '1.19'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - "~>"
95
+ - - ~>
96
96
  - !ruby/object:Gem::Version
97
97
  version: '1.19'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: ruby-hmac
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - "~>"
102
+ - - ~>
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0.4'
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - "~>"
109
+ - - ~>
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0.4'
112
112
  description: 'Qiniu Resource (Cloud) Storage SDK for Ruby. See: http://developer.qiniu.com/docs/v6/sdk/ruby-sdk.html'
@@ -116,9 +116,9 @@ executables: []
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
- - ".gitignore"
120
- - ".rspec"
121
- - ".travis.yml"
119
+ - .gitignore
120
+ - .rspec
121
+ - .travis.yml
122
122
  - CHANGELOG.md
123
123
  - Gemfile
124
124
  - Gemfile.lock
@@ -173,17 +173,17 @@ require_paths:
173
173
  - lib
174
174
  required_ruby_version: !ruby/object:Gem::Requirement
175
175
  requirements:
176
- - - ">="
176
+ - - '>='
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  requirements:
181
- - - ">="
181
+ - - '>='
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  requirements: []
185
185
  rubyforge_project:
186
- rubygems_version: 2.2.2
186
+ rubygems_version: 2.0.14
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: Qiniu Resource (Cloud) Storage SDK for Ruby