qiniu 6.4.1 → 6.4.2
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 +4 -4
- data/.rspec +1 -1
- data/.travis.yml +3 -0
- data/CHANGELOG.md +7 -1
- data/Gemfile +2 -2
- data/Gemfile.lock +24 -17
- data/lib/qiniu/auth.rb +3 -0
- data/lib/qiniu/misc.rb +2 -0
- data/lib/qiniu/version.rb +1 -1
- data/qiniu.gemspec +2 -2
- data/rails3/Gemfile +4 -0
- data/rails3/qiniu.gemspec +29 -0
- data/spec/qiniu/qiniu_spec.rb +26 -38
- metadata +8 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 63cda6dcf5ebd659bdc35ee8e1a1b5adda2ded38
|
|
4
|
+
data.tar.gz: 5cd9bb60b47ff6e938197b97cd204f2e29dc101f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67ca3c4009d3c1c8687171172f7b82a62c5446e329de50258091c51633d61ea652bc52aa4d69817fdb52490c5122f91527bda48a628fb193fe58e68533c05538
|
|
7
|
+
data.tar.gz: bad9f549eaffe56fc660cff16cc6355f8ff44d9f69fe43074b7909c72cb631900f744f8b08e96fd16bde6935e29ecd17533d31bf8853455ab6552a386db3ccd8
|
data/.rspec
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
--colour -f
|
|
1
|
+
--colour -f documentation
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## CHANGE LOG
|
|
2
2
|
|
|
3
|
+
### v6.4.2
|
|
4
|
+
|
|
5
|
+
- gem 兼容性调整 。 [https://github.com/qiniu/ruby-sdk/pull/122](https://github.com/qiniu/ruby-sdk/pull/122)
|
|
6
|
+
|
|
7
|
+
- 上传策略参数调整 。 [https://github.com/qiniu/ruby-sdk/pull/120](https://github.com/qiniu/ruby-sdk/pull/120)
|
|
8
|
+
|
|
3
9
|
### v6.4.1
|
|
4
10
|
|
|
5
11
|
- 将 mime-types 的依赖版本升级到 2.4.3 。 [https://github.com/qiniu/ruby-sdk/pull/113](https://github.com/qiniu/ruby-sdk/pull/113)
|
|
@@ -33,7 +39,7 @@
|
|
|
33
39
|
### v6.2.2
|
|
34
40
|
|
|
35
41
|
- 为/pfop接口添加`pipeline`参数,用于指明使用哪个命名转码队列。 [https://github.com/qiniu/ruby-sdk/pull/92](https://github.com/qiniu/ruby-sdk/pull/92)
|
|
36
|
-
- 为authorize_download_url()添加`:fop`参数,用于生成含数据处理指令的授权下载URL。
|
|
42
|
+
- 为authorize_download_url()添加`:fop`参数,用于生成含数据处理指令的授权下载URL。
|
|
37
43
|
|
|
38
44
|
### v6.2.1
|
|
39
45
|
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -2,29 +2,36 @@ PATH
|
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
4
|
qiniu (6.4.1)
|
|
5
|
-
json (~> 1.
|
|
6
|
-
mime-types (~>
|
|
7
|
-
rest-client (~> 1.
|
|
5
|
+
json (~> 1.8)
|
|
6
|
+
mime-types (~> 1.19)
|
|
7
|
+
rest-client (~> 1.7.3)
|
|
8
8
|
ruby-hmac (~> 0.4)
|
|
9
9
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
diff-lcs (1.
|
|
13
|
+
diff-lcs (1.2.5)
|
|
14
14
|
fakeweb (1.3.0)
|
|
15
|
-
json (1.8.
|
|
16
|
-
mime-types (1.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
rspec-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
json (1.8.2)
|
|
16
|
+
mime-types (1.25.1)
|
|
17
|
+
netrc (0.10.3)
|
|
18
|
+
rake (10.4.2)
|
|
19
|
+
rest-client (1.7.3)
|
|
20
|
+
mime-types (>= 1.16, < 3.0)
|
|
21
|
+
netrc (~> 0.7)
|
|
22
|
+
rspec (3.2.0)
|
|
23
|
+
rspec-core (~> 3.2.0)
|
|
24
|
+
rspec-expectations (~> 3.2.0)
|
|
25
|
+
rspec-mocks (~> 3.2.0)
|
|
26
|
+
rspec-core (3.2.2)
|
|
27
|
+
rspec-support (~> 3.2.0)
|
|
28
|
+
rspec-expectations (3.2.0)
|
|
29
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
30
|
+
rspec-support (~> 3.2.0)
|
|
31
|
+
rspec-mocks (3.2.1)
|
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
33
|
+
rspec-support (~> 3.2.0)
|
|
34
|
+
rspec-support (3.2.2)
|
|
28
35
|
ruby-hmac (0.4.0)
|
|
29
36
|
|
|
30
37
|
PLATFORMS
|
data/lib/qiniu/auth.rb
CHANGED
|
@@ -49,7 +49,9 @@ module Qiniu
|
|
|
49
49
|
:return_url => "returnUrl" ,
|
|
50
50
|
:return_body => "returnBody" ,
|
|
51
51
|
:callback_url => "callbackUrl" ,
|
|
52
|
+
:callback_host => "callbackHost" ,
|
|
52
53
|
:callback_body => "callbackBody" ,
|
|
54
|
+
:callback_body_type => "callbackBodyType" ,
|
|
53
55
|
:persistent_ops => "persistentOps" ,
|
|
54
56
|
:persistent_notify_url => "persistentNotifyUrl" ,
|
|
55
57
|
:persistent_pipeline => "persistentPipeline" ,
|
|
@@ -58,6 +60,7 @@ module Qiniu
|
|
|
58
60
|
:deadline => "deadline" ,
|
|
59
61
|
:insert_only => "insertOnly" ,
|
|
60
62
|
:fsize_limit => "fsizeLimit" ,
|
|
63
|
+
:callback_fetch_key => "callbackFetchKey" ,
|
|
61
64
|
:detect_mime => "detectMime" ,
|
|
62
65
|
:mime_limit => "mimeLimit"
|
|
63
66
|
} # PARAMS
|
data/lib/qiniu/misc.rb
CHANGED
data/lib/qiniu/version.rb
CHANGED
data/qiniu.gemspec
CHANGED
|
@@ -21,8 +21,8 @@ Gem::Specification.new do |gem|
|
|
|
21
21
|
gem.add_development_dependency "rake", ">= 0.9"
|
|
22
22
|
gem.add_development_dependency "rspec", ">= 2.11"
|
|
23
23
|
gem.add_development_dependency "fakeweb", "~> 1.3"
|
|
24
|
-
gem.add_runtime_dependency "json", "~> 1.
|
|
25
|
-
gem.add_runtime_dependency "rest-client", "~> 1.
|
|
24
|
+
gem.add_runtime_dependency "json", "~> 1.8"
|
|
25
|
+
gem.add_runtime_dependency "rest-client", "~> 1.7.3"
|
|
26
26
|
gem.add_runtime_dependency "mime-types", "~> 2.4.3"
|
|
27
27
|
gem.add_runtime_dependency "ruby-hmac", "~> 0.4"
|
|
28
28
|
gem.add_runtime_dependency "jruby-openssl", "~> 0.7" if RUBY_PLATFORM == "java"
|
data/rails3/Gemfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
require File.expand_path('../../lib/qiniu/version', __FILE__)
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |gem|
|
|
6
|
+
gem.authors = ["why404","BluntBlade"]
|
|
7
|
+
gem.email = ["sdk@qiniu.com"]
|
|
8
|
+
gem.description = %q{Qiniu Resource (Cloud) Storage SDK for Ruby. See: http://developer.qiniu.com/docs/v6/sdk/ruby-sdk.html}
|
|
9
|
+
gem.summary = %q{Qiniu Resource (Cloud) Storage SDK for Ruby}
|
|
10
|
+
gem.homepage = "https://github.com/qiniu/ruby-sdk"
|
|
11
|
+
|
|
12
|
+
gem.files = `git ls-files`.split($\)
|
|
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"]
|
|
17
|
+
gem.version = Qiniu::Version.to_s
|
|
18
|
+
gem.license = "MIT"
|
|
19
|
+
|
|
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.7.3"
|
|
26
|
+
gem.add_runtime_dependency "mime-types", "~> 1.19"
|
|
27
|
+
gem.add_runtime_dependency "ruby-hmac", "~> 0.4"
|
|
28
|
+
gem.add_runtime_dependency "jruby-openssl", "~> 0.7" if RUBY_PLATFORM == "java"
|
|
29
|
+
end
|
data/spec/qiniu/qiniu_spec.rb
CHANGED
|
@@ -34,7 +34,7 @@ module Qiniu
|
|
|
34
34
|
context ".buckets" do
|
|
35
35
|
it "should works" do
|
|
36
36
|
result = Qiniu.buckets
|
|
37
|
-
result.
|
|
37
|
+
expect(result).to_not be_empty
|
|
38
38
|
puts result.inspect
|
|
39
39
|
end
|
|
40
40
|
end
|
|
@@ -42,7 +42,7 @@ module Qiniu
|
|
|
42
42
|
context ".set_protected" do
|
|
43
43
|
it "should works" do
|
|
44
44
|
result = Qiniu.set_protected(@bucket, 1)
|
|
45
|
-
result.
|
|
45
|
+
expect(result).to eq(true)
|
|
46
46
|
puts result.inspect
|
|
47
47
|
end
|
|
48
48
|
end
|
|
@@ -50,7 +50,7 @@ module Qiniu
|
|
|
50
50
|
context ".set_separator" do
|
|
51
51
|
it "should works" do
|
|
52
52
|
result = Qiniu.set_separator(@bucket, "-")
|
|
53
|
-
result.
|
|
53
|
+
expect(result).to eq(true)
|
|
54
54
|
puts result.inspect
|
|
55
55
|
end
|
|
56
56
|
end
|
|
@@ -58,7 +58,7 @@ module Qiniu
|
|
|
58
58
|
context ".set_style" do
|
|
59
59
|
it "should works" do
|
|
60
60
|
result = Qiniu.set_style(@bucket, "small.jpg", "imageMogr/auto-orient/thumbnail/!120x120r/gravity/center/crop/!120x120/quality/80")
|
|
61
|
-
result.
|
|
61
|
+
expect(result).to eq(true)
|
|
62
62
|
puts result.inspect
|
|
63
63
|
end
|
|
64
64
|
end
|
|
@@ -66,7 +66,7 @@ module Qiniu
|
|
|
66
66
|
context ".unset_style" do
|
|
67
67
|
it "should works" do
|
|
68
68
|
result = Qiniu.unset_style(@bucket, "small.jpg")
|
|
69
|
-
result.
|
|
69
|
+
expect(result).to eq(true)
|
|
70
70
|
puts result.inspect
|
|
71
71
|
end
|
|
72
72
|
end
|
|
@@ -82,7 +82,7 @@ module Qiniu
|
|
|
82
82
|
:enable_crc32_check => true
|
|
83
83
|
}
|
|
84
84
|
result = Qiniu.upload_file(upload_opts)
|
|
85
|
-
result.
|
|
85
|
+
expect(result).to_not be_empty
|
|
86
86
|
puts result.inspect
|
|
87
87
|
end
|
|
88
88
|
|
|
@@ -132,24 +132,22 @@ module Qiniu
|
|
|
132
132
|
File.unlink(localfile) if File.exists?(localfile)
|
|
133
133
|
#expect
|
|
134
134
|
puts result1.inspect
|
|
135
|
-
result1.
|
|
136
|
-
result1.should_not be_empty
|
|
135
|
+
expect(result1).to_not be_empty
|
|
137
136
|
#stat
|
|
138
137
|
result2 = Qiniu.stat(@bucket, key)
|
|
139
138
|
puts result2.inspect
|
|
140
|
-
result2.
|
|
139
|
+
expect(result2).to_not be_empty
|
|
141
140
|
#delete
|
|
142
141
|
result3 = Qiniu.delete(@bucket, key)
|
|
143
142
|
puts result3.inspect
|
|
144
|
-
result3.
|
|
143
|
+
expect(result3).to eq(true)
|
|
145
144
|
end
|
|
146
145
|
end
|
|
147
146
|
|
|
148
147
|
context ".stat" do
|
|
149
148
|
it "should works" do
|
|
150
149
|
result = Qiniu.stat(@bucket, @key)
|
|
151
|
-
result.
|
|
152
|
-
result.should_not be_empty
|
|
150
|
+
expect(result).to_not be_empty
|
|
153
151
|
puts result.inspect
|
|
154
152
|
end
|
|
155
153
|
end
|
|
@@ -157,8 +155,7 @@ module Qiniu
|
|
|
157
155
|
context ".get" do
|
|
158
156
|
it "should works" do
|
|
159
157
|
result = Qiniu.get(@bucket, @key, "qiniu_spec.rb", 10)
|
|
160
|
-
result.
|
|
161
|
-
result.should_not be_empty
|
|
158
|
+
expect(result).to_not be_empty
|
|
162
159
|
puts result.inspect
|
|
163
160
|
end
|
|
164
161
|
end
|
|
@@ -166,8 +163,7 @@ module Qiniu
|
|
|
166
163
|
context ".download" do
|
|
167
164
|
it "should works" do
|
|
168
165
|
result = Qiniu.download(@bucket, @key, "rs_spec.rb", 10)
|
|
169
|
-
result.
|
|
170
|
-
result.should_not be_empty
|
|
166
|
+
expect(result).to_not be_empty
|
|
171
167
|
puts result.inspect
|
|
172
168
|
end
|
|
173
169
|
end
|
|
@@ -175,8 +171,7 @@ module Qiniu
|
|
|
175
171
|
context ".batch" do
|
|
176
172
|
it "should works" do
|
|
177
173
|
result = Qiniu.batch("stat", @bucket, [@key])
|
|
178
|
-
result.
|
|
179
|
-
result.should_not be_empty
|
|
174
|
+
expect(result).to_not be_empty
|
|
180
175
|
puts result.inspect
|
|
181
176
|
end
|
|
182
177
|
end
|
|
@@ -184,8 +179,7 @@ module Qiniu
|
|
|
184
179
|
context ".batch_stat" do
|
|
185
180
|
it "should works" do
|
|
186
181
|
result = Qiniu.batch_stat(@bucket, [@key])
|
|
187
|
-
result.
|
|
188
|
-
result.should_not be_empty
|
|
182
|
+
expect(result).to_not be_empty
|
|
189
183
|
puts result.inspect
|
|
190
184
|
end
|
|
191
185
|
end
|
|
@@ -193,8 +187,7 @@ module Qiniu
|
|
|
193
187
|
context ".batch_get" do
|
|
194
188
|
it "should works" do
|
|
195
189
|
result = Qiniu.batch_get(@bucket, [@key])
|
|
196
|
-
result.
|
|
197
|
-
result.should_not be_empty
|
|
190
|
+
expect(result).to_not be_empty
|
|
198
191
|
puts result.inspect
|
|
199
192
|
end
|
|
200
193
|
end
|
|
@@ -202,8 +195,7 @@ module Qiniu
|
|
|
202
195
|
context ".batch_download" do
|
|
203
196
|
it "should works" do
|
|
204
197
|
result = Qiniu.batch_download(@bucket, [@key])
|
|
205
|
-
result.
|
|
206
|
-
result.should_not be_empty
|
|
198
|
+
expect(result).to_not be_empty
|
|
207
199
|
puts result.inspect
|
|
208
200
|
end
|
|
209
201
|
end
|
|
@@ -236,42 +228,40 @@ module Qiniu
|
|
|
236
228
|
context ".move" do
|
|
237
229
|
it "should works" do
|
|
238
230
|
result = Qiniu.move(@bucket, @key, @bucket, @key2)
|
|
239
|
-
result.
|
|
231
|
+
expect(result).to eq(true)
|
|
240
232
|
|
|
241
233
|
result2 = Qiniu.stat(@bucket, @key2)
|
|
242
|
-
result2.
|
|
234
|
+
expect(result2).to_not be_empty
|
|
243
235
|
|
|
244
236
|
result3 = Qiniu.move(@bucket, @key2, @bucket, @key)
|
|
245
|
-
result3.
|
|
237
|
+
expect(result3).to eq(true)
|
|
246
238
|
end
|
|
247
239
|
end
|
|
248
240
|
|
|
249
241
|
context ".copy" do
|
|
250
242
|
it "should works" do
|
|
251
243
|
result = Qiniu.copy(@bucket, @key, @bucket, @key2)
|
|
252
|
-
result.
|
|
244
|
+
expect(result).to eq(true)
|
|
253
245
|
|
|
254
246
|
result3 = Qiniu.delete(@bucket, @key2)
|
|
255
|
-
result3.
|
|
247
|
+
expect(result3).to eq(true)
|
|
256
248
|
end
|
|
257
249
|
end
|
|
258
250
|
|
|
259
251
|
context ".delete" do
|
|
260
252
|
it "should works" do
|
|
261
253
|
result = Qiniu.delete(@bucket, @key)
|
|
262
|
-
result.
|
|
254
|
+
expect(result).to eq(true)
|
|
263
255
|
end
|
|
264
256
|
end
|
|
265
257
|
|
|
266
258
|
context ".image_info" do
|
|
267
259
|
it "should works" do
|
|
268
260
|
data = Qiniu.get(@test_image_bucket, @test_image_key)
|
|
269
|
-
data.
|
|
270
|
-
data.should_not be_empty
|
|
261
|
+
expect(data).to_not be_empty
|
|
271
262
|
puts data.inspect
|
|
272
263
|
result = Qiniu.image_info(data["url"])
|
|
273
|
-
result.
|
|
274
|
-
result.should_not be_empty
|
|
264
|
+
expect(result).to_not be_empty
|
|
275
265
|
puts result.inspect
|
|
276
266
|
end
|
|
277
267
|
end
|
|
@@ -279,8 +269,7 @@ module Qiniu
|
|
|
279
269
|
context ".image_mogrify_save_as" do
|
|
280
270
|
it "should works" do
|
|
281
271
|
data = Qiniu.get(@test_image_bucket, @test_image_key)
|
|
282
|
-
data.
|
|
283
|
-
data.should_not be_empty
|
|
272
|
+
expect(data).to_not be_empty
|
|
284
273
|
puts data.inspect
|
|
285
274
|
|
|
286
275
|
dest_key = "cropped-" + @test_image_key
|
|
@@ -295,8 +284,7 @@ module Qiniu
|
|
|
295
284
|
:auto_orient => true
|
|
296
285
|
}
|
|
297
286
|
result2 = Qiniu.image_mogrify_save_as(@test_image_bucket, dest_key, src_img_url, mogrify_options)
|
|
298
|
-
result2.
|
|
299
|
-
result2.should_not be_empty
|
|
287
|
+
expect(result2).to_not be_empty
|
|
300
288
|
puts result2.inspect
|
|
301
289
|
end
|
|
302
290
|
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.4.
|
|
4
|
+
version: 6.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- why404
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2015-04-08 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|
|
@@ -59,28 +59,28 @@ dependencies:
|
|
|
59
59
|
requirements:
|
|
60
60
|
- - ~>
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '1.
|
|
62
|
+
version: '1.8'
|
|
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
|
-
version: '1.
|
|
69
|
+
version: '1.8'
|
|
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
|
-
version:
|
|
76
|
+
version: 1.7.3
|
|
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
|
-
version:
|
|
83
|
+
version: 1.7.3
|
|
84
84
|
- !ruby/object:Gem::Dependency
|
|
85
85
|
name: mime-types
|
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -150,6 +150,8 @@ files:
|
|
|
150
150
|
- lib/qiniu/utils.rb
|
|
151
151
|
- lib/qiniu/version.rb
|
|
152
152
|
- qiniu.gemspec
|
|
153
|
+
- rails3/Gemfile
|
|
154
|
+
- rails3/qiniu.gemspec
|
|
153
155
|
- spec/qiniu/abstract_spec.rb
|
|
154
156
|
- spec/qiniu/auth_spec.rb
|
|
155
157
|
- spec/qiniu/image_logo_for_test.png
|