protocol-http 0.18.0 → 0.19.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: d8d2f576f6e7e6ce261d80fbdc0e38e2775b2f22ac156958b1e1b91472fdfec3
4
- data.tar.gz: b450d401f5791db371761fd52a6c1adb32807a13659570a1ad0ef0d5ef3dd8d5
3
+ metadata.gz: 0af75765a43c5fb19b3071937a6162477ebdb206811be34f5d74c7881688117e
4
+ data.tar.gz: 7eef98e2de4c86ddb2f4cd5a77d61f8a2ca3998e30d8bef61d95d7c4bb902c34
5
5
  SHA512:
6
- metadata.gz: 0be25839110052bd336f729800768eb8d8ef51bf15c2852b9bc526e20a6998177dadfc4e71b889681b16ba263f25dc14ea42e0835ce4f87de7d343936ff91ea8
7
- data.tar.gz: bf48aa19e331906fcf518eed7c6c94243656856f034d6c44a90ecf41c0bd1807c1a540d836fc61d63d6cd3acc2a769b37f1898b608296578edc45866747659a6
6
+ metadata.gz: 7f42ab4cd4bf8bf144ced1758316ab181a78687b89882e6d63d10ac190112dfc6aaa02800af6048d7ee12f510d8c805736a412bdb32926c81baaf85f46994dd3
7
+ data.tar.gz: 020bc0c0ff0d2b687117cbbdd09fe38e0c7e5510f3b94f96f3de6e3eed3ecf32fad35cc408cd3fd3af63fdb0500aae841fba67c6835272b9a06b2b7d0c36b7f9
@@ -72,6 +72,11 @@ module Protocol
72
72
  @index >= @chunks.length
73
73
  end
74
74
 
75
+ # A buffered response is always ready.
76
+ def ready?
77
+ true
78
+ end
79
+
75
80
  def read
76
81
  if chunk = @chunks[@index]
77
82
  @index += 1
@@ -65,6 +65,10 @@ module Protocol
65
65
  @remaining == 0
66
66
  end
67
67
 
68
+ def ready?
69
+ true
70
+ end
71
+
68
72
  def rewind
69
73
  @file.seek(@offset)
70
74
  end
@@ -42,6 +42,10 @@ module Protocol
42
42
  true
43
43
  end
44
44
 
45
+ def ready?
46
+ true
47
+ end
48
+
45
49
  def length
46
50
  @length
47
51
  end
@@ -44,6 +44,13 @@ module Protocol
44
44
  false
45
45
  end
46
46
 
47
+ # Whether calling read will block.
48
+ # We prefer pessimistic implementation, and thus default to `false`.
49
+ # @return [Boolean]
50
+ def ready?
51
+ false
52
+ end
53
+
47
54
  def length
48
55
  nil
49
56
  end
@@ -39,6 +39,10 @@ module Protocol
39
39
  (@index >= @chunks.size) && super
40
40
  end
41
41
 
42
+ def ready?
43
+ (@index < @chunks.size) || super
44
+ end
45
+
42
46
  # A rewindable body wraps some other body. Convert it to a buffered body
43
47
  def buffered
44
48
  Buffered.new(@chunks)
@@ -55,6 +55,10 @@ module Protocol
55
55
  @body.empty?
56
56
  end
57
57
 
58
+ def ready?
59
+ @body.ready?
60
+ end
61
+
58
62
  def length
59
63
  @body.length
60
64
  end
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Protocol
24
24
  module HTTP
25
- VERSION = "0.18.0"
25
+ VERSION = "0.19.0"
26
26
  end
27
27
  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.18.0
4
+ version: 0.19.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: 2020-04-08 00:00:00.000000000 Z
11
+ date: 2020-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: covered