File: httpserver.rbs

package info (click to toggle)
ruby-webrick 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 748 kB
  • sloc: ruby: 7,783; sh: 4; makefile: 4
file content (71 lines) | stat: -rw-r--r-- 2,042 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
module WEBrick
  class HTTPServerError < ServerError
  end

  class HTTPServer < ::WEBrick::GenericServer
    @http_version: HTTPVersion

    @mount_tab: MountTable

    @virtual_hosts: Array[untyped]

    def initialize: (?Hash[Symbol, untyped] config, ?Hash[Symbol, untyped] default) -> void

    def run: (TCPSocket sock) -> void

    def service: (HTTPRequest req, HTTPResponse res) -> void

    def do_OPTIONS: (HTTPRequest req, HTTPResponse res) -> void

    def mount: (String dir, singleton(HTTPServlet::AbstractServlet) servlet, *untyped options) -> void

    def mount_proc: (String dir, ?HTTPServlet::ProcHandler::_Callable proc) -> void
                  | (String dir, ?nil proc) { (HTTPRequest, HTTPResponse) -> void } -> void

    def unmount: (String dir) -> MountTable::value_type

    alias umount unmount

    def search_servlet: (String path) -> [singleton(HTTPServlet::AbstractServlet), Array[untyped], String, String]?

    def virtual_host: (instance server) -> void

    def lookup_server: (HTTPRequest req) -> instance?

    def access_log: (Hash[Symbol, untyped] config, HTTPRequest req, HTTPResponse res) -> void

    #
    # Creates the HTTPRequest used when handling the HTTP
    # request. Can be overridden by subclasses.
    def create_request: (Hash[Symbol, untyped] with_webrick_config) -> HTTPRequest

    #
    # Creates the HTTPResponse used when handling the HTTP
    # request. Can be overridden by subclasses.
    def create_response: (Hash[Symbol, untyped] with_webrick_config) -> HTTPResponse

    class MountTable
      type value_type = [singleton(HTTPServlet::AbstractServlet), Array[untyped]]

      @tab: Hash[String, value_type]

      @scanner: Regexp

      def initialize: () -> void

      def []: (String dir) -> value_type

      def []=: (String dir, value_type val) -> value_type

      def delete: (String dir) -> value_type

      def scan: (String path) -> [String, String]

      private

      def compile: () -> void

      def normalize: (String dir) -> String
    end
  end
end