Skip to content

Commit f4eaf20

Browse files
authored
Add llhttp gem (#1031)
1 parent 0a65a84 commit f4eaf20

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

gems/llhttp/0.6/_test/test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require "llhttp"
2+
3+
parser = LLHttp::Parser.new(LLHttp::Delegate.new, type: :response)
4+
parser.reset
5+
parser << "HTTP/1.1 200 OK\r\n\r\n"
6+
parser.status_code
7+
parser.http_major
8+
parser.http_minor

gems/llhttp/0.6/llhttp.rbs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module LLHttp
2+
class Error < StandardError
3+
end
4+
5+
class Parser
6+
def initialize: (untyped delegate, ?type: Symbol) -> void
7+
def reset: () -> void
8+
def <<: (String data) -> void
9+
def status_code: () -> Integer
10+
def http_major: () -> Integer
11+
def http_minor: () -> Integer
12+
end
13+
14+
class Delegate
15+
def initialize: () -> void
16+
end
17+
end

0 commit comments

Comments
 (0)