Skip to content

Commit e4c9034

Browse files
committed
[DOC] Add missing documents
1 parent edb2523 commit e4c9034

12 files changed

+63
-3
lines changed

lib/rdoc.rb

+11
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,17 @@ def self.load_yaml
120120
end
121121
end
122122

123+
##
124+
# Seaches and returns the directory for settings.
125+
#
126+
# 1. <tt>$HOME/.rdoc</tt> directory, if it exists.
127+
# 2. The +rdoc+ directory under the path specified by the
128+
# +XDG_DATA_HOME+ environment variable, if it is set.
129+
# 3. <tt>$HOME/.local/share/rdoc</tt> directory.
130+
#
131+
# Other than the home directory, the containing directory will be
132+
# created automatically.
133+
123134
def self.home
124135
rdoc_dir = begin
125136
File.expand_path('~/.rdoc')

lib/rdoc/cross_reference.rb

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ def initialize context
131131
@seen = {}
132132
end
133133

134+
##
135+
# Returns a method reference to +name+.
136+
134137
def resolve_method name
135138
ref = nil
136139

lib/rdoc/markdown/literals.kpeg

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# :markup: markdown
77

88
##
9-
#--
109
# This set of literals is for Ruby 1.9 regular expressions and gives full
1110
# unicode support.
1211
#
@@ -20,4 +19,3 @@ BOM = "\uFEFF"
2019
Newline = /\n|\r\n?|\p{Zl}|\p{Zp}/
2120
NonAlphanumeric = /\p{^Word}/
2221
Spacechar = /\t|\p{Zs}/
23-

lib/rdoc/markup/table.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
# A section of table
44

55
class RDoc::Markup::Table
6-
attr_accessor :header, :align, :body
6+
# headers of each column
7+
attr_accessor :header
78

9+
# alignments of each column
10+
attr_accessor :align
11+
12+
# body texts of each column
13+
attr_accessor :body
14+
15+
# Creates new instance
816
def initialize header, align, body
917
@header, @align, @body = header, align, body
1018
end

lib/rdoc/markup/to_html_snippet.rb

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ def accept_heading heading
6666

6767
alias accept_rule ignore
6868

69+
##
70+
# Adds +paragraph+ to the output
71+
6972
def accept_paragraph paragraph
7073
para = @in_list_entry.last || "<p>"
7174

lib/rdoc/parser/c.rb

+3
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,9 @@ def scan
12151215
@top_level
12161216
end
12171217

1218+
##
1219+
# Creates a RDoc::Comment instance.
1220+
12181221
def new_comment text = nil, location = nil, language = nil
12191222
RDoc::Comment.new(text, location, language).tap do |comment|
12201223
comment.format = @markup

lib/rdoc/parser/changelog.rb

+15
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,22 @@ def scan
216216
@top_level
217217
end
218218

219+
##
220+
# The extension for Git commit log
221+
219222
module Git
223+
##
224+
# Parses auxiliary info. Currentry `base-url` to expand
225+
# references is effective.
226+
220227
def parse_info(info)
221228
/^\s*base-url\s*=\s*(.*\S)/ =~ info
222229
@base_url = $1
223230
end
224231

232+
##
233+
# Parses the entries in the Git commit logs
234+
225235
def parse_entries
226236
entries = []
227237

@@ -244,6 +254,11 @@ def parse_entries
244254
entries
245255
end
246256

257+
##
258+
# Returns a list of ChangeLog entries as
259+
# RDoc::Parser::ChangeLog::Git::LogEntry list for the given
260+
# +entries+.
261+
247262
def create_entries entries
248263
# git log entries have no strictly itemized style like the old
249264
# style, just assume Markdown.

lib/rdoc/parser/ripper_state_lex.rb

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# frozen_string_literal: true
22
require 'ripper'
33

4+
##
5+
# Wrapper for Ripper lex states
6+
47
class RDoc::Parser::RipperStateLex
58
# TODO: Remove this constants after Ruby 2.4 EOL
69
RIPPER_HAS_LEX_STATE = Ripper::Filter.method_defined?(:state)
@@ -565,13 +568,15 @@ def get_squashed_tk
565568
tk
566569
end
567570

571+
# New lexer for +code+.
568572
def initialize(code)
569573
@buf = []
570574
@heredoc_queue = []
571575
@inner_lex = InnerStateLex.new(code)
572576
@tokens = @inner_lex.parse([])
573577
end
574578

579+
# Returns tokens parsed from +code+.
575580
def self.parse(code)
576581
lex = self.new(code)
577582
tokens = []
@@ -584,6 +589,7 @@ def self.parse(code)
584589
tokens
585590
end
586591

592+
# Returns +true+ if lex state will be +END+ after +token+.
587593
def self.end?(token)
588594
(token[:state] & EXPR_END)
589595
end

lib/rdoc/parser/ruby.rb

+3
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ def initialize(top_level, file_name, content, options, stats)
180180
reset
181181
end
182182

183+
##
184+
# Return +true+ if +tk+ is a newline.
185+
183186
def tk_nl?(tk)
184187
:on_nl == tk[:kind] or :on_ignored_nl == tk[:kind]
185188
end

lib/rdoc/store.rb

+3
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ def add_file absolute_name, relative_name: absolute_name, parser: nil
197197
top_level
198198
end
199199

200+
##
201+
# Sets the parser of +absolute_name+, unless it from a source code file.
202+
200203
def update_parser_of_file(absolute_name, parser)
201204
if top_level = @files_hash[absolute_name] then
202205
@text_files_hash[absolute_name] = top_level if top_level.text?

lib/rdoc/text.rb

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
module RDoc::Text
1212

13+
##
14+
# The language for this text. This affects stripping comments
15+
# markers.
16+
1317
attr_accessor :language
1418

1519
##

lib/rdoc/top_level.rb

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ def initialize absolute_name, relative_name = absolute_name
5252
@classes_or_modules = []
5353
end
5454

55+
##
56+
# Sets the parser for this toplevel context, also the store.
57+
5558
def parser=(val)
5659
@parser = val
5760
@store.update_parser_of_file(absolute_name, val) if @store

0 commit comments

Comments
 (0)