[rubygems/rubygems] Use a constant empty tar header to avoid extra allocations
[ruby.git] / lib / uri.rb
blobdfdb052a79057c0bb0c0700b1beb687cff2366fb
1 # frozen_string_literal: false
2 # URI is a module providing classes to handle Uniform Resource Identifiers
3 # (RFC2396[https://www.rfc-editor.org/rfc/rfc2396]).
5 # == Features
7 # * Uniform way of handling URIs.
8 # * Flexibility to introduce custom URI schemes.
9 # * Flexibility to have an alternate URI::Parser (or just different patterns
10 #   and regexp's).
12 # == Basic example
14 #   require 'uri'
16 #   uri = URI("http://foo.com/posts?id=30&limit=5#time=1305298413")
17 #   #=> #<URI::HTTP http://foo.com/posts?id=30&limit=5#time=1305298413>
19 #   uri.scheme    #=> "http"
20 #   uri.host      #=> "foo.com"
21 #   uri.path      #=> "/posts"
22 #   uri.query     #=> "id=30&limit=5"
23 #   uri.fragment  #=> "time=1305298413"
25 #   uri.to_s      #=> "http://foo.com/posts?id=30&limit=5#time=1305298413"
27 # == Adding custom URIs
29 #   module URI
30 #     class RSYNC < Generic
31 #       DEFAULT_PORT = 873
32 #     end
33 #     register_scheme 'RSYNC', RSYNC
34 #   end
35 #   #=> URI::RSYNC
37 #   URI.scheme_list
38 #   #=> {"FILE"=>URI::File, "FTP"=>URI::FTP, "HTTP"=>URI::HTTP,
39 #   #    "HTTPS"=>URI::HTTPS, "LDAP"=>URI::LDAP, "LDAPS"=>URI::LDAPS,
40 #   #    "MAILTO"=>URI::MailTo, "RSYNC"=>URI::RSYNC}
42 #   uri = URI("rsync://rsync.foo.com")
43 #   #=> #<URI::RSYNC rsync://rsync.foo.com>
45 # == RFC References
47 # A good place to view an RFC spec is http://www.ietf.org/rfc.html.
49 # Here is a list of all related RFC's:
50 # - RFC822[https://www.rfc-editor.org/rfc/rfc822]
51 # - RFC1738[https://www.rfc-editor.org/rfc/rfc1738]
52 # - RFC2255[https://www.rfc-editor.org/rfc/rfc2255]
53 # - RFC2368[https://www.rfc-editor.org/rfc/rfc2368]
54 # - RFC2373[https://www.rfc-editor.org/rfc/rfc2373]
55 # - RFC2396[https://www.rfc-editor.org/rfc/rfc2396]
56 # - RFC2732[https://www.rfc-editor.org/rfc/rfc2732]
57 # - RFC3986[https://www.rfc-editor.org/rfc/rfc3986]
59 # == Class tree
61 # - URI::Generic (in uri/generic.rb)
62 #   - URI::File - (in uri/file.rb)
63 #   - URI::FTP - (in uri/ftp.rb)
64 #   - URI::HTTP - (in uri/http.rb)
65 #     - URI::HTTPS - (in uri/https.rb)
66 #   - URI::LDAP - (in uri/ldap.rb)
67 #     - URI::LDAPS - (in uri/ldaps.rb)
68 #   - URI::MailTo - (in uri/mailto.rb)
69 # - URI::Parser - (in uri/common.rb)
70 # - URI::REGEXP - (in uri/common.rb)
71 #   - URI::REGEXP::PATTERN - (in uri/common.rb)
72 # - URI::Util - (in uri/common.rb)
73 # - URI::Error - (in uri/common.rb)
74 #   - URI::InvalidURIError - (in uri/common.rb)
75 #   - URI::InvalidComponentError - (in uri/common.rb)
76 #   - URI::BadURIError - (in uri/common.rb)
78 # == Copyright Info
80 # Author:: Akira Yamada <akira@ruby-lang.org>
81 # Documentation::
82 #   Akira Yamada <akira@ruby-lang.org>
83 #   Dmitry V. Sabanin <sdmitry@lrn.ru>
84 #   Vincent Batts <vbatts@hashbangbash.com>
85 # License::
86 #  Copyright (c) 2001 akira yamada <akira@ruby-lang.org>
87 #  You can redistribute it and/or modify it under the same term as Ruby.
90 module URI
91 end
93 require_relative 'uri/version'
94 require_relative 'uri/common'
95 require_relative 'uri/generic'
96 require_relative 'uri/file'
97 require_relative 'uri/ftp'
98 require_relative 'uri/http'
99 require_relative 'uri/https'
100 require_relative 'uri/ldap'
101 require_relative 'uri/ldaps'
102 require_relative 'uri/mailto'
103 require_relative 'uri/ws'
104 require_relative 'uri/wss'