protocol-http 0.9.1 → 0.10.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: 30678c8f31c20a2daa56b58fe3b599af480c76560cae3e9d0d6cebd6fc854767
4
- data.tar.gz: 89dc121efa998bda14f7cc4ab60392fdcccad0cf3f9dae0cf6b497c70f4949bc
3
+ metadata.gz: 74eb2d15782062ec9d5dbd4b9a98c0cad45c4df4c4944f95fb447de0c08b26b5
4
+ data.tar.gz: 6787db74ca0953213cfc1e72dea596189a2532bcf8f8d4408dbcba995880b099
5
5
  SHA512:
6
- metadata.gz: c9821a48ac5c2c26e88e465a427a81956649ac12d4b493af762a788222df569bba9b8b15e696c3888abd391e81fa8d32d62e81d93f90b03d7754a8db06768c5a
7
- data.tar.gz: b86dde999df7c4f23827d381c2500798255833d9cfaf2e9118679c34c51a72cf4cfcd70ef67263e362585a147010e298433da85065ed6dae736d91ae7b2139af
6
+ metadata.gz: 77d71a171d9956a9e9cfbd00896d5c75f96092b2e564e24523aa2b0b97a37de25c834fa36fecb594e663239cf5ecdeee883061468b3115fa4c7a362fd6a6b44f
7
+ data.tar.gz: 5cd9eb09c22b930186ac8752b1b0f1e29c5b5b9d371067369e98ac42f44d0c9656eb2ab8c1771d8b52dcdc81b8ee652d381fdf7358478757b60cc4e3f87176a7
@@ -25,14 +25,14 @@ module Protocol
25
25
  module HTTP
26
26
  module Body
27
27
  class File < Readable
28
- BLOCK_SIZE = Async::IO::Stream::BLOCK_SIZE
28
+ BLOCK_SIZE = Async::IO::BLOCK_SIZE
29
29
  MODE = ::File::RDONLY | ::File::BINARY
30
30
 
31
31
  def self.open(path, *args)
32
32
  self.new(::File.open(path, MODE), *args)
33
33
  end
34
34
 
35
- def initialize(file, range = nil, block_size: BLOCK_SIZE)
35
+ def initialize(file, range = nil, size: file.size, block_size: BLOCK_SIZE)
36
36
  @file = file
37
37
 
38
38
  @block_size = block_size
@@ -43,7 +43,7 @@ module Protocol
43
43
  @length = @remaining = range.size
44
44
  else
45
45
  @offset = 0
46
- @length = @remaining = @file.size
46
+ @length = @remaining = size
47
47
  end
48
48
  end
49
49
 
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Protocol
22
22
  module HTTP
23
- VERSION = "0.9.1"
23
+ VERSION = "0.10.0"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-09 00:00:00.000000000 Z
11
+ date: 2019-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: covered