• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/ruby-106/ruby/lib/uri/

Lines Matching refs:URI

9 # See URI for general documentation
12 module URI
14 # Includes URI::REGEXP::PATTERN
18 # Patterns used to parse URI's
23 # RFC 2396 (URI Generic Syntax)
60 # class that Parses String's into URI's
70 # URI::Parser.new([opts])
75 # Keys of options are pattern names of URI components
81 # * :ESCAPED (URI::PATTERN::ESCAPED in default)
82 # * :UNRESERVED (URI::PATTERN::UNRESERVED in default)
83 # * :DOMLABEL (URI::PATTERN::DOMLABEL in default)
84 # * :TOPLABEL (URI::PATTERN::TOPLABEL in default)
85 # * :HOSTNAME (URI::PATTERN::HOSTNAME in default)
89 # p = URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})")
90 # u = p.parse("http://example.jp/%uABCD") #=> #<URI::HTTP:0xb78cf4f8 URL:http://example.jp/%uABCD>
91 # URI.parse(u.to_s) #=> raises URI::InvalidURIError
94 # u1 = p.parse(s) #=> #<URI::HTTP:0xb78c3220 URL:http://example.com/ABCD>
95 # u2 = URI.parse(s) #=> #<URI::HTTP:0xb78b6d54 URL:http://example.com/ABCD>
111 # see also URI::Parser.initialize_pattern
116 # see also URI::Parser.initialize_regexp
119 # Returns a split URI against regexp[:ABS_URI]
129 # URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
143 "bad URI(absolute but no scheme): #{uri}"
147 "bad URI(absolute but no path): #{uri}"
164 # URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
176 raise InvalidURIError, "bad URI(is not URI?): #{uri}"
200 # parses +uri+ and constructs either matching URI scheme object
201 # (FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or URI::Generic
205 # p = URI::Parser.new
207 # #=> #<URI::LDAP:0x00000000b9e7e8 URL:ldap://ldap.example.com/dc=example?user=john>
213 if scheme && URI.scheme_list.include?(scheme.upcase)
214 URI.scheme_list[scheme.upcase].new(scheme, userinfo, host, port,
259 # see also URI::Parser.make_regexp
351 # RFC 2396 (URI Generic Syntax)
454 # URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
503 # for URI::split
507 # for URI::extract
512 # for URI::escape/unescape
532 if uri.is_a?(URI::Generic)
538 "bad argument (expected URI object or URI string)"
544 # URI::Parser.new
592 # URI.escape(str [, unsafe])
611 # enc_uri = URI.escape("http://example.com/?a=\11\15")
615 # p URI.unescape(enc_uri)
618 # p URI.escape("@?@!", "!?")
622 warn "#{caller(1)[0]}: warning: URI.escape is obsolete" if $VERBOSE
629 # URI.unescape(str)
640 # enc_uri = URI.escape("http://example.com/?a=\11\15")
644 # p URI.unescape(enc_uri)
648 warn "#{caller(1)[0]}: warning: URI.unescape is obsolete" if $VERBOSE
664 # Base class for all URI exceptions.
668 # Not a URI.
672 # Not a URI component.
676 # URI is valid, bad usage is not.
683 # URI::split(uri)
688 # String with URI.
708 # p URI.split("http://www.ruby-lang.org/")
718 # URI::parse(uri_str)
723 # String with URI.
727 # Creates one of the URI's subclasses instance from the string.
731 # URI::InvalidURIError
732 # Raised if URI given is not a correct one.
738 # uri = URI.parse("http://www.ruby-lang.org/")
740 # # => #<URI::HTTP:0x202281be URL:http://www.ruby-lang.org/>
753 # URI::join(str[, str, ...])
768 # p URI.join("http://example.com/","main.rbx")
769 # # => #<URI::HTTP:0x2022ac02 URL:http://localhost/main.rbx>
771 # p URI.join('http://example.com', 'foo')
772 # # => #<URI::HTTP:0x01ab80a0 URL:http://example.com/foo>
774 # p URI.join('http://example.com', '/foo', '/bar')
775 # # => #<URI::HTTP:0x01aaf0b0 URL:http://example.com/bar>
777 # p URI.join('http://example.com', '/foo', 'bar')
778 # # => #<URI::HTTP:0x801a92af0 URL:http://example.com/bar>
780 # p URI.join('http://example.com', '/foo/', 'bar')
781 # # => #<URI::HTTP:0x80135a3a0 URL:http://example.com/foo/bar>
791 # URI::extract(str[, schemes][,&blk])
798 # Limit URI matching to a specific schemes.
809 # URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.")
819 # URI::regexp([match_schemes])
828 # Returns a Regexp object which matches to URI-like strings.
836 # # extract first URI from html_string
837 # html_string.slice(URI.regexp)
840 # html_string.sub(URI.regexp(['ftp'])
843 # html_string.scan(URI.regexp) do |*matches|
879 # See URI.decode_www_form_component, URI.encode_www_form
896 # See URI.encode_www_form_component, URI.decode_www_form
909 # This internally uses URI.encode_www_form_component(str).
922 # URI.encode_www_form([["q", "ruby"], ["lang", "en"]])
924 # URI.encode_www_form("q" => "ruby", "lang" => "en")
926 # URI.encode_www_form("q" => ["ruby", "perl"], "lang" => "en")
928 # URI.encode_www_form([["q", "ruby"], ["q", "perl"], ["lang", "en"]])
931 # See URI.encode_www_form_component, URI.decode_www_form
958 # This internally uses URI.decode_www_form_component.
966 # ary = URI.decode_www_form("a=1&a=2&b=3")
973 # See URI.decode_www_form_component, URI.encode_www_form
985 end # module URI
990 # Returns +uri+ converted to a URI object.
992 def URI(uri)
993 if uri.is_a?(URI::Generic)
996 URI.parse(uri)
999 "bad argument (expected URI object or URI string)"
1002 module_function :URI