Skip to content

Commit ddabff4

Browse files
authored
Merge pull request #147 from nobu/doc
Make documentation 100%
2 parents 24cf280 + fe7aa3d commit ddabff4

File tree

6 files changed

+29
-12
lines changed

6 files changed

+29
-12
lines changed

.document

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BSDL
2+
COPYING
3+
README.md
4+
docs/
5+
lib/

.rdoc_options

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
main_page: README.md
2+
op_dir: _site
3+
warn_missing_rdoc_ref: true
4+
title: URI Documentation

docs/kernel.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# :stopdoc:
2+
module Kernel end

lib/uri/common.rb

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@
1313
require_relative "rfc3986_parser"
1414

1515
module URI
16+
# The default parser instance for RFC 2396.
1617
RFC2396_PARSER = RFC2396_Parser.new
1718
Ractor.make_shareable(RFC2396_PARSER) if defined?(Ractor)
1819

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

24+
# The default parser instance.
2225
DEFAULT_PARSER = RFC3986_PARSER
2326
Ractor.make_shareable(DEFAULT_PARSER) if defined?(Ractor)
2427

28+
# Set the default parser instance.
2529
def self.parser=(parser = RFC3986_PARSER)
2630
remove_const(:Parser) if defined?(::URI::Parser)
2731
const_set("Parser", parser.class)
@@ -40,7 +44,7 @@ def self.parser=(parser = RFC3986_PARSER)
4044
end
4145
self.parser = RFC3986_PARSER
4246

43-
def self.const_missing(const)
47+
def self.const_missing(const) # :nodoc:
4448
if const == :REGEXP
4549
warn "URI::REGEXP is obsolete. Use URI::RFC2396_REGEXP explicitly.", uplevel: 1 if $VERBOSE
4650
URI::RFC2396_REGEXP
@@ -87,7 +91,7 @@ def make_components_hash(klass, array_hash)
8791
module_function :make_components_hash
8892
end
8993

90-
module Schemes
94+
module Schemes # :nodoc:
9195
end
9296
private_constant :Schemes
9397

@@ -305,7 +309,7 @@ def self.regexp(schemes = nil)# :nodoc:
305309
256.times do |i|
306310
TBLENCWWWCOMP_[-i.chr] = -('%%%02X' % i)
307311
end
308-
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze
312+
TBLENCURICOMP_ = TBLENCWWWCOMP_.dup.freeze # :nodoc:
309313
TBLENCWWWCOMP_[' '] = '+'
310314
TBLENCWWWCOMP_.freeze
311315
TBLDECWWWCOMP_ = {} # :nodoc:

lib/uri/generic.rb

+5-3
Original file line numberDiff line numberDiff line change
@@ -737,12 +737,12 @@ def check_registry(v) # :nodoc:
737737
end
738738
private :check_registry
739739

740-
def set_registry(v) #:nodoc:
740+
def set_registry(v) # :nodoc:
741741
raise InvalidURIError, "cannot set registry"
742742
end
743743
protected :set_registry
744744

745-
def registry=(v)
745+
def registry=(v) # :nodoc:
746746
raise InvalidURIError, "cannot set registry"
747747
end
748748

@@ -1392,10 +1392,12 @@ def ==(oth)
13921392
end
13931393
end
13941394

1395+
# Returns the hash value.
13951396
def hash
13961397
self.component_ary.hash
13971398
end
13981399

1400+
# Compares with _oth_ for Hash.
13991401
def eql?(oth)
14001402
self.class == oth.class &&
14011403
parser == oth.parser &&
@@ -1438,7 +1440,7 @@ def select(*components)
14381440
end
14391441
end
14401442

1441-
def inspect
1443+
def inspect # :nodoc:
14421444
"#<#{self.class} #{self}>"
14431445
end
14441446

lib/uri/rfc2396_parser.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,14 @@ def unescape(str, escaped = @regexp[:ESCAPED])
321321
str.gsub(escaped) { [$&[1, 2]].pack('H2').force_encoding(enc) }
322322
end
323323

324-
@@to_s = Kernel.instance_method(:to_s)
325-
if @@to_s.respond_to?(:bind_call)
326-
def inspect
327-
@@to_s.bind_call(self)
324+
TO_S = Kernel.instance_method(:to_s) # :nodoc:
325+
if TO_S.respond_to?(:bind_call)
326+
def inspect # :nodoc:
327+
TO_S.bind_call(self)
328328
end
329329
else
330-
def inspect
331-
@@to_s.bind(self).call
330+
def inspect # :nodoc:
331+
TO_S.bind(self).call
332332
end
333333
end
334334

0 commit comments

Comments
 (0)