Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .document
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BSDL
COPYING
README.md
docs/
lib/
4 changes: 4 additions & 0 deletions .rdoc_options
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
main_page: README.md
op_dir: _site
warn_missing_rdoc_ref: true
title: URI Documentation
2 changes: 2 additions & 0 deletions docs/kernel.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# :stopdoc:
module Kernel end
10 changes: 7 additions & 3 deletions lib/uri/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@
require_relative "rfc3986_parser"

module URI
# The default parser instance for RFC 2396.
RFC2396_PARSER = RFC2396_Parser.new
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)

# The default parser instance for RFC 3986.
RFC3986_PARSER = RFC3986_Parser.new
Ractor.make_shareable(RFC3986_PARSER) if defined?(Ractor)

# The default parser instance.
DEFAULT_PARSER = RFC3986_PARSER
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)

# Set the default parser instance.
def self.parser=(parser = RFC3986_PARSER)
remove_const(:Parser) if defined?(::URI::Parser)
const_set("Parser", parser.class)
Expand All @@ -40,7 +44,7 @@ def self.parser=(parser = RFC3986_PARSER)
end
self.parser = RFC3986_PARSER

def self.const_missing(const)
def self.const_missing(const) # :nodoc:
if const == :REGEXP
warn "URI::REGEXP is obsolete. Use URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
URI::RFC2396_REGEXP
Expand Down Expand Up @@ -87,7 +91,7 @@ def make_components_hash(klass, array_hash)
module_function :make_components_hash
end

module Schemes
module Schemes # :nodoc:
end
private_constant :Schemes

Expand Down Expand Up @@ -305,7 +309,7 @@ def self.regexp(schemes = nil)# :nodoc:
256.times do |i|
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
end
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze # :nodoc:
TBLENCWWWCOMP_[' '] = '+'
TBLENCWWWCOMP_.freeze
TBLDECWWWCOMP_ = {} # :nodoc:
Expand Down
8 changes: 5 additions & 3 deletions lib/uri/generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -737,12 +737,12 @@ def check_registry(v) # :nodoc:
end
private :check_registry

def set_registry(v) #:nodoc:
def set_registry(v) # :nodoc:
raise InvalidURIError, "cannot set registry"
end
protected :set_registry

def registry=(v)
def registry=(v) # :nodoc:
raise InvalidURIError, "cannot set registry"
end

Expand Down Expand Up @@ -1392,10 +1392,12 @@ def ==(oth)
end
end

# Returns the hash value.
def hash
self.component_ary.hash
end

# Compares with _oth_ for Hash.
def eql?(oth)
self.class == oth.class &&
parser == oth.parser &&
Expand Down Expand Up @@ -1438,7 +1440,7 @@ def select(*components)
end
end

def inspect
def inspect # :nodoc:
"#<#{self.class} #{self}>"
end

Expand Down
12 changes: 6 additions & 6 deletions lib/uri/rfc2396_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@ def unescape(str, escaped = @regexp[:ESCAPED])
str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
end

@@to_s = Kernel.instance_method(:to_s)
if @@to_s.respond_to?(:bind_call)
def inspect
@@to_s.bind_call(self)
TO_S = Kernel.instance_method(:to_s) # :nodoc:
if TO_S.respond_to?(:bind_call)
def inspect # :nodoc:
TO_S.bind_call(self)
end
else
def inspect
@@to_s.bind(self).call
def inspect # :nodoc:
TO_S.bind(self).call
end
end

Expand Down
Loading