protocol-http 0.12.1 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2953e96c1addb4934e048f77b901f4d5a03b3425b0bf0100d7dff9245e6eb370
4
- data.tar.gz: 2d4c0922cdbcca179dca6e68e35d552e8e0402726fbc7aa924e01c4ceb1ac74e
3
+ metadata.gz: 50cafe21c0b3f5ed6b29fe6d7099cb3597c08c6082cc76919280671b4f4c0c6d
4
+ data.tar.gz: 361cad94d3eec69321daa40e05f6c1aaa5c49fa474387e97e8b1a19e724e4692
5
5
  SHA512:
6
- metadata.gz: 9e9ba539505e9e99aa8fc7dfb91a06cad3aad67d1ad75eb77dda3bd6dacfb5af5424cdeaee863b5768c2b0fdc94a452c8657083df049d42c424909d0c2f578f5
7
- data.tar.gz: afe556ba1f91b03406477390112123907d3e70a3f705686de0ce617389f59850cabf51aa6a1b97745697937bb8853ca3d53de5933e0a05ae39ecda0c4dcee4c8
6
+ metadata.gz: dc2805fc35956abf21aebdf26e461d50bcc712702f67c66fb12e408e8bea1e3fa4b301d4af65ff6c6c5fe814358451694db88f7ba5656a8295aa53e5ad48385a
7
+ data.tar.gz: 1f7df6fdde7bb8a5dee4318d3df256981726cdbba8d1e2aeec149e94699200782b86cb496a85ac63ca1e69b3b6e0e5c63db894600ff5f0957d8331d726e11da0
@@ -28,8 +28,8 @@ module Protocol
28
28
  BLOCK_SIZE = Async::IO::BLOCK_SIZE
29
29
  MODE = ::File::RDONLY | ::File::BINARY
30
30
 
31
- def self.open(path, *args)
32
- self.new(::File.open(path, MODE), *args)
31
+ def self.open(path, *arguments, **options)
32
+ self.new(::File.open(path, MODE), *arguments, **options)
33
33
  end
34
34
 
35
35
  def initialize(file, range = nil, size: file.size, block_size: BLOCK_SIZE)
@@ -67,16 +67,6 @@ module Protocol
67
67
  self.close($!)
68
68
  end
69
69
 
70
- # def call(stream)
71
- # # Flushing after every chunk is inefficient, but it's also a safe default.
72
- # self.each do |chunk|
73
- # stream.write(chunk)
74
- # stream.flush
75
- # end
76
- # ensure
77
- # stream.close
78
- # end
79
-
80
70
  # Read all remaining chunks into a single binary string using `#each`.
81
71
  def join
82
72
  buffer = String.new.force_encoding(Encoding::BINARY)
@@ -22,7 +22,7 @@
22
22
 
23
23
  module Protocol
24
24
  module HTTP
25
- # HTTP method verbs
25
+ # All supported HTTP methods
26
26
  class Methods
27
27
  GET = 'GET'
28
28
  POST = 'POST'
@@ -39,7 +39,7 @@ module Protocol
39
39
  def self.valid?(name)
40
40
  const_defined?(name)
41
41
  rescue NameError
42
- # Ruby will raise an exception if te name is not valid for a constant.
42
+ # Ruby will raise an exception if the name is not valid for a constant.
43
43
  return false
44
44
  end
45
45
 
@@ -50,10 +50,10 @@ module Protocol
50
50
  end
51
51
 
52
52
  # Use Methods.constants to get all constants.
53
- self.each do |name, verb|
54
- define_method(verb.downcase) do |location, headers = [], body = nil|
53
+ self.each do |name, value|
54
+ define_method(name.downcase) do |location, headers = [], body = nil|
55
55
  self.call(
56
- Request[verb, location.to_str, Headers[headers], body]
56
+ Request[value, location.to_str, Headers[headers], body]
57
57
  )
58
58
  end
59
59
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Protocol
22
22
  module HTTP
23
- VERSION = "0.12.1"
23
+ VERSION = "0.12.2"
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.12.1
4
+ version: 0.12.2
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-08-11 00:00:00.000000000 Z
11
+ date: 2019-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: covered
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubygems_version: 3.0.3
131
+ rubygems_version: 3.0.4
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Provides abstractions to handle HTTP protocols.