protocol-http 0.38.0 → 0.39.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/protocol/http/body/file.rb +10 -0
- data/lib/protocol/http/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcd8228b665455c02862f4019d3a44028c015339a43bcf6d3c7f338a3f9b2173
|
4
|
+
data.tar.gz: d7f99542317ee6624aa98538318ec78eb8938d0a34d16fd55ae505ec08247745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3d68dc17a9b7da1cd54d9adab3bcbc4008f61c9e50e124264b9aec73c14c7af61d07528302d57b2ad0aef2c0f1e33ed9057ee7755b266d919578c96b1508105
|
7
|
+
data.tar.gz: 48c95c2b547e066dbe467dd7a282628f9890c1c61bb58ada51bcecbe86bf278c91f1ee53ab89e873a9ae3609b1e5b594dc58c97128d1641bff782bf8f15a6f6d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -18,6 +18,7 @@ module Protocol
|
|
18
18
|
|
19
19
|
def initialize(file, range = nil, size: file.size, block_size: BLOCK_SIZE)
|
20
20
|
@file = file
|
21
|
+
@range = range
|
21
22
|
|
22
23
|
@block_size = block_size
|
23
24
|
|
@@ -26,6 +27,7 @@ module Protocol
|
|
26
27
|
@offset = range.min
|
27
28
|
@length = @remaining = range.size
|
28
29
|
else
|
30
|
+
@file.seek(0)
|
29
31
|
@offset = 0
|
30
32
|
@length = @remaining = size
|
31
33
|
end
|
@@ -51,11 +53,19 @@ module Protocol
|
|
51
53
|
true
|
52
54
|
end
|
53
55
|
|
56
|
+
def buffered
|
57
|
+
self.class.new(@file.dup, @range, block_size: @block_size)
|
58
|
+
end
|
59
|
+
|
54
60
|
def rewind
|
55
61
|
@file.seek(@offset)
|
56
62
|
@remaining = @length
|
57
63
|
end
|
58
64
|
|
65
|
+
def rewindable?
|
66
|
+
true
|
67
|
+
end
|
68
|
+
|
59
69
|
def read
|
60
70
|
if @remaining > 0
|
61
71
|
amount = [@remaining, @block_size].min
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|