aliyun-sdk 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/aliyun/oss/http.rb +7 -2
- data/lib/aliyun/version.rb +1 -1
- data/spec/aliyun/oss/http_spec.rb +18 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 002610ac26720b767cd7218d665da92926081f17
|
4
|
+
data.tar.gz: 62a0a01d10c1fe2f944c7247f6b52a5cf35a6e60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 783dd45bcc4db86557e81a383f0de230e5c937d060c6cb8ff00cab296a67f963b718c2e13d32e1fdbdf9926f8f165a851f826eb68b53fb62252ed76ccc12c4c2
|
7
|
+
data.tar.gz: 2742836c20960f9dd4df8f546a144ddebae62677f2d650108c3677dc9038bb4d71020356c99a5e3368bc323f5a11e63a45aef37670bce3cd1d82eed2bd500407
|
data/CHANGELOG.md
CHANGED
data/lib/aliyun/oss/http.rb
CHANGED
@@ -52,8 +52,13 @@ module Aliyun
|
|
52
52
|
ret = ""
|
53
53
|
loop do
|
54
54
|
if bytes
|
55
|
-
|
56
|
-
|
55
|
+
fail if bytes < 0
|
56
|
+
piece = @buffer.slice!(0, bytes)
|
57
|
+
if piece
|
58
|
+
ret << piece
|
59
|
+
bytes -= piece.size
|
60
|
+
break if bytes == 0
|
61
|
+
end
|
57
62
|
else
|
58
63
|
ret << @buffer
|
59
64
|
@buffer.clear
|
data/lib/aliyun/version.rb
CHANGED
@@ -58,6 +58,24 @@ module Aliyun
|
|
58
58
|
r = s.read
|
59
59
|
expect(r).to eq('')
|
60
60
|
end
|
61
|
+
|
62
|
+
it "should read exactly bytes" do
|
63
|
+
s = HTTP::StreamWriter.new do |sr|
|
64
|
+
100.times { sr << 'x' * 10 }
|
65
|
+
end
|
66
|
+
|
67
|
+
r = s.read(11)
|
68
|
+
expect(r.size).to eq(11)
|
69
|
+
|
70
|
+
r = s.read(25)
|
71
|
+
expect(r.size).to eq(25)
|
72
|
+
|
73
|
+
r = s.read(900)
|
74
|
+
expect(r.size).to eq(900)
|
75
|
+
|
76
|
+
r = s.read(1000)
|
77
|
+
expect(r.size).to eq(64)
|
78
|
+
end
|
61
79
|
end # StreamWriter
|
62
80
|
|
63
81
|
end # HTTP
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aliyun-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tianlong Wu
|
@@ -234,3 +234,4 @@ test_files:
|
|
234
234
|
- tests/test_object_acl.rb
|
235
235
|
- tests/test_object_key.rb
|
236
236
|
- tests/test_resumable.rb
|
237
|
+
has_rdoc:
|