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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95fdcce85b20ee97e54b44068d59f689f040d1c9489b0e2ff8f9e63464d4c7cd
4
- data.tar.gz: a72f51087a046f2f713208baace1631414e32b1e2eceb82ff69d479b2c2a7eac
3
+ metadata.gz: bcd8228b665455c02862f4019d3a44028c015339a43bcf6d3c7f338a3f9b2173
4
+ data.tar.gz: d7f99542317ee6624aa98538318ec78eb8938d0a34d16fd55ae505ec08247745
5
5
  SHA512:
6
- metadata.gz: a4e7504cf962c63a5dac26fbd235b50d6796d5c97eb1f4b40be4cf6023fd1e118a8c64254d1199cab94f1086ad608367e1e4932de1836d63986b2548149fb3b7
7
- data.tar.gz: b88389e903b175e65fa9f1ee2e36b4894d0484475d8f999ab001cf4968c6edbafb1f9a75fbf14f7fad5f1c7d8e2b4b40a55fd2070aa19ac9eb0a4aae785fdbec
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
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP
8
- VERSION = "0.38.0"
8
+ VERSION = "0.39.0"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.38.0
4
+ version: 0.39.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file