rdoc 6.6.1 → 6.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b065b8eb430d44d3590ff47f2a649fbdde2cd01e1d45690b503e874664c0e35
4
- data.tar.gz: '0122984ed2155f7455ff3c7229cee18f7e7e57723ef7210c8c3b77453cd05590'
3
+ metadata.gz: 060b06473aafc2a0a07ded738b5be7819ddd0520d7e2033ef72311ff8dd57248
4
+ data.tar.gz: 500fd282367d6cefeb9257518a0ed5e5371cf3c09a6addc8ac30be1dbe7ba267
5
5
  SHA512:
6
- metadata.gz: 403154275fe0a89423cb91a84227a5c821c018ed6e5a741b10741768fde727c2721ae4a3bb0ba57baf756d86609248202bcb76a9a505b2b1ad03f76e4e460a4f
7
- data.tar.gz: 5c4dcb7981173716d2ec6a6282b26da0994e91c9e821fea09cab7a713b974825687e77131418f02cd0317c075fe2c83baf840a60c71649a1307b44f51ca7054c
6
+ metadata.gz: 52461100f11f5123da6874e2786b4a83248435fd4955609647421c49a71c5d6ba98bd869fc3c510e64d148992461762b4213390b7aa33bd9dd80d7caad665638
7
+ data.tar.gz: 87b21e587bc4e2d97b35f56b4be8e28a1ac40961dc5caf2f61ab3500f5f3a9147195b917d329a1264cb6f4605daec30bb5603c2269a09c5a89da359074928805
@@ -131,6 +131,9 @@ class RDoc::CrossReference
131
131
  @seen = {}
132
132
  end
133
133
 
134
+ ##
135
+ # Returns a method reference to +name+.
136
+
134
137
  def resolve_method name
135
138
  ref = nil
136
139
 
data/lib/rdoc/encoding.rb CHANGED
@@ -86,17 +86,6 @@ module RDoc::Encoding
86
86
  nil
87
87
  end
88
88
 
89
- def self.remove_frozen_string_literal string
90
- string =~ /\A(?:#!.*\n)?(.*\n)/
91
- first_line = $1
92
-
93
- if first_line =~ /\A# +frozen[-_]string[-_]literal[=:].+$/i
94
- string = string.sub first_line, ''
95
- end
96
-
97
- string
98
- end
99
-
100
89
  ##
101
90
  # Detects the encoding of +string+ based on the magic comment
102
91
 
@@ -81,6 +81,7 @@ class RDoc::Generator::POT
81
81
  end
82
82
  end
83
83
 
84
+ # :nodoc:
84
85
  def class_dir
85
86
  nil
86
87
  end
@@ -6,7 +6,6 @@
6
6
  # :markup: markdown
7
7
 
8
8
  ##
9
- #--
10
9
  # This set of literals is for Ruby 1.9 regular expressions and gives full
11
10
  # unicode support.
12
11
  #
@@ -20,4 +19,3 @@ BOM = "\uFEFF"
20
19
  Newline = /\n|\r\n?|\p{Zl}|\p{Zp}/
21
20
  NonAlphanumeric = /\p{^Word}/
22
21
  Spacechar = /\t|\p{Zs}/
23
-
@@ -3,7 +3,6 @@
3
3
  # :markup: markdown
4
4
 
5
5
  ##
6
- #--
7
6
  # This set of literals is for Ruby 1.9 regular expressions and gives full
8
7
  # unicode support.
9
8
  #
@@ -138,6 +138,7 @@ class RDoc::Markup::AttributeManager
138
138
  res
139
139
  end
140
140
 
141
+ # :nodoc:
141
142
  def exclusive?(attr)
142
143
  (attr & @exclusive_bitmap) != 0
143
144
  end
@@ -155,6 +156,7 @@ class RDoc::Markup::AttributeManager
155
156
  convert_attrs_word_pair_map(str, attrs, exclusive)
156
157
  end
157
158
 
159
+ # :nodoc:
158
160
  def convert_attrs_matching_word_pairs(str, attrs, exclusive)
159
161
  # first do matching ones
160
162
  tags = @matching_word_pairs.select { |start, bitmap|
@@ -179,6 +181,7 @@ class RDoc::Markup::AttributeManager
179
181
  str.delete!(NON_PRINTING_START + NON_PRINTING_END)
180
182
  end
181
183
 
184
+ # :nodoc:
182
185
  def convert_attrs_word_pair_map(str, attrs, exclusive)
183
186
  # then non-matching
184
187
  unless @word_pair_map.empty? then
@@ -420,6 +420,8 @@ class RDoc::Markup::Parser
420
420
  # A simple wrapper of StringScanner that is aware of the current column and lineno
421
421
 
422
422
  class MyStringScanner
423
+ # :stopdoc:
424
+
423
425
  def initialize(input)
424
426
  @line = @column = 0
425
427
  @s = StringScanner.new input
@@ -456,6 +458,8 @@ class RDoc::Markup::Parser
456
458
  def [](i)
457
459
  @s[i]
458
460
  end
461
+
462
+ #:startdoc:
459
463
  end
460
464
 
461
465
  ##
@@ -3,12 +3,21 @@
3
3
  # A section of table
4
4
 
5
5
  class RDoc::Markup::Table
6
- attr_accessor :header, :align, :body
6
+ # headers of each column
7
+ attr_accessor :header
7
8
 
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
8
16
  def initialize header, align, body
9
17
  @header, @align, @body = header, align, body
10
18
  end
11
19
 
20
+ # :stopdoc:
12
21
  def == other
13
22
  self.class == other.class and
14
23
  @header == other.header and
@@ -20,7 +29,7 @@ class RDoc::Markup::Table
20
29
  visitor.accept_table @header, @body, @align
21
30
  end
22
31
 
23
- def pretty_print q # :nodoc:
32
+ def pretty_print q
24
33
  q.group 2, '[Table: ', ']' do
25
34
  q.group 2, '[Head: ', ']' do
26
35
  q.seplist @header.zip(@align) do |text, align|
@@ -61,6 +61,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
61
61
  #
62
62
  # These methods are used by regexp handling markup added by RDoc::Markup#add_regexp_handling.
63
63
 
64
+ # :nodoc:
64
65
  URL_CHARACTERS_REGEXP_STR = /[A-Za-z0-9\-._~:\/\?#\[\]@!$&'\(\)*+,;%=]/.source
65
66
 
66
67
  ##
@@ -42,6 +42,7 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
42
42
  @cross_reference = RDoc::CrossReference.new @context
43
43
  end
44
44
 
45
+ # :nodoc:
45
46
  def init_link_notation_regexp_handlings
46
47
  add_regexp_handling_RDOCLINK
47
48
 
@@ -66,6 +66,9 @@ class RDoc::Markup::ToHtmlSnippet < RDoc::Markup::ToHtml
66
66
 
67
67
  alias accept_rule ignore
68
68
 
69
+ ##
70
+ # Adds +paragraph+ to the output
71
+
69
72
  def accept_paragraph paragraph
70
73
  para = @in_list_entry.last || "<p>"
71
74
 
data/lib/rdoc/parser/c.rb CHANGED
@@ -575,19 +575,18 @@ class RDoc::Parser::C < RDoc::Parser
575
575
  table = {}
576
576
  file_content.scan(%r{
577
577
  ((?>/\*.*?\*/\s*)?)
578
- ((?:(?:\w+)\s+)?
579
- (?:intern\s+)?VALUE\s+(\w+)
580
- \s*(?:\([^)]*\))(?:[^\);]|$))
578
+ ((?:\w+\s+){0,2} VALUE\s+(\w+)
579
+ \s*(?:\([^\)]*\))(?:[^\);]|$))
581
580
  | ((?>/\*.*?\*/\s*))^\s*(\#\s*define\s+(\w+)\s+(\w+))
582
581
  | ^\s*\#\s*define\s+(\w+)\s+(\w+)
583
582
  }xm) do
584
583
  case
585
- when $1
586
- table[$3] = [:func_def, $1, $2, $~.offset(2)] if !table[$3] || table[$3][0] != :func_def
587
- when $4
588
- table[$6] = [:macro_def, $4, $5, $~.offset(5), $7] if !table[$6] || table[$6][0] == :macro_alias
589
- when $8
590
- table[$8] ||= [:macro_alias, $9]
584
+ when name = $3
585
+ table[name] = [:func_def, $1, $2, $~.offset(2)] if !(t = table[name]) || t[0] != :func_def
586
+ when name = $6
587
+ table[name] = [:macro_def, $4, $5, $~.offset(5), $7] if !(t = table[name]) || t[0] == :macro_alias
588
+ when name = $8
589
+ table[name] ||= [:macro_alias, $9]
591
590
  end
592
591
  end
593
592
  table
@@ -939,14 +938,13 @@ class RDoc::Parser::C < RDoc::Parser
939
938
  # "/* definition: comment */" form. The literal ':' and '\' characters
940
939
  # can be escaped with a backslash.
941
940
  if type.downcase == 'const' then
942
- no_match, new_definition, new_comment = comment.text.split(/(\A.*):/)
941
+ if /\A(.+?)?:(?!\S)/ =~ comment.text
942
+ new_definition, new_comment = $1, $'
943
943
 
944
- if no_match and no_match.empty? then
945
- if new_definition.empty? then # Default to literal C definition
944
+ if !new_definition # Default to literal C definition
946
945
  new_definition = definition
947
946
  else
948
- new_definition = new_definition.gsub("\:", ":")
949
- new_definition = new_definition.gsub("\\", '\\')
947
+ new_definition = new_definition.gsub(/\\([\\:])/, '\1')
950
948
  end
951
949
 
952
950
  new_definition.sub!(/\A(\s+)/, '')
@@ -1217,6 +1215,9 @@ class RDoc::Parser::C < RDoc::Parser
1217
1215
  @top_level
1218
1216
  end
1219
1217
 
1218
+ ##
1219
+ # Creates a RDoc::Comment instance.
1220
+
1220
1221
  def new_comment text = nil, location = nil, language = nil
1221
1222
  RDoc::Comment.new(text, location, language).tap do |comment|
1222
1223
  comment.format = @markup
@@ -216,12 +216,22 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
216
216
  @top_level
217
217
  end
218
218
 
219
+ ##
220
+ # The extension for Git commit log
221
+
219
222
  module Git
223
+ ##
224
+ # Parses auxiliary info. Currentry `base-url` to expand
225
+ # references is effective.
226
+
220
227
  def parse_info(info)
221
228
  /^\s*base-url\s*=\s*(.*\S)/ =~ info
222
229
  @base_url = $1
223
230
  end
224
231
 
232
+ ##
233
+ # Parses the entries in the Git commit logs
234
+
225
235
  def parse_entries
226
236
  entries = []
227
237
 
@@ -244,6 +254,11 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
244
254
  entries
245
255
  end
246
256
 
257
+ ##
258
+ # Returns a list of ChangeLog entries as
259
+ # RDoc::Parser::ChangeLog::Git::LogEntry list for the given
260
+ # +entries+.
261
+
247
262
  def create_entries entries
248
263
  # git log entries have no strictly itemized style like the old
249
264
  # style, just assume Markdown.
@@ -1,7 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
  require 'ripper'
3
3
 
4
+ ##
5
+ # Wrapper for Ripper lex states
6
+
4
7
  class RDoc::Parser::RipperStateLex
8
+ # :stopdoc:
9
+
5
10
  # TODO: Remove this constants after Ruby 2.4 EOL
6
11
  RIPPER_HAS_LEX_STATE = Ripper::Filter.method_defined?(:state)
7
12
 
@@ -565,6 +570,9 @@ class RDoc::Parser::RipperStateLex
565
570
  tk
566
571
  end
567
572
 
573
+ # :startdoc:
574
+
575
+ # New lexer for +code+.
568
576
  def initialize(code)
569
577
  @buf = []
570
578
  @heredoc_queue = []
@@ -572,6 +580,7 @@ class RDoc::Parser::RipperStateLex
572
580
  @tokens = @inner_lex.parse([])
573
581
  end
574
582
 
583
+ # Returns tokens parsed from +code+.
575
584
  def self.parse(code)
576
585
  lex = self.new(code)
577
586
  tokens = []
@@ -584,6 +593,7 @@ class RDoc::Parser::RipperStateLex
584
593
  tokens
585
594
  end
586
595
 
596
+ # Returns +true+ if lex state will be +END+ after +token+.
587
597
  def self.end?(token)
588
598
  (token[:state] & EXPR_END)
589
599
  end
@@ -180,6 +180,9 @@ class RDoc::Parser::Ruby < RDoc::Parser
180
180
  reset
181
181
  end
182
182
 
183
+ ##
184
+ # Return +true+ if +tk+ is a newline.
185
+
183
186
  def tk_nl?(tk)
184
187
  :on_nl == tk[:kind] or :on_ignored_nl == tk[:kind]
185
188
  end
data/lib/rdoc/store.rb CHANGED
@@ -197,6 +197,9 @@ class RDoc::Store
197
197
  top_level
198
198
  end
199
199
 
200
+ ##
201
+ # Sets the parser of +absolute_name+, unless it from a source code file.
202
+
200
203
  def update_parser_of_file(absolute_name, parser)
201
204
  if top_level = @files_hash[absolute_name] then
202
205
  @text_files_hash[absolute_name] = top_level if top_level.text?
data/lib/rdoc/text.rb CHANGED
@@ -10,6 +10,10 @@ require 'strscan'
10
10
 
11
11
  module RDoc::Text
12
12
 
13
+ ##
14
+ # The language for this text. This affects stripping comments
15
+ # markers.
16
+
13
17
  attr_accessor :language
14
18
 
15
19
  ##
@@ -52,6 +52,9 @@ class RDoc::TopLevel < RDoc::Context
52
52
  @classes_or_modules = []
53
53
  end
54
54
 
55
+ ##
56
+ # Sets the parser for this toplevel context, also the store.
57
+
55
58
  def parser=(val)
56
59
  @parser = val
57
60
  @store.update_parser_of_file(absolute_name, val) if @store
data/lib/rdoc/version.rb CHANGED
@@ -5,6 +5,6 @@ module RDoc
5
5
  ##
6
6
  # RDoc version you are using
7
7
 
8
- VERSION = '6.6.1'
8
+ VERSION = '6.6.2'
9
9
 
10
10
  end
data/lib/rdoc.rb CHANGED
@@ -120,6 +120,17 @@ module RDoc
120
120
  end
121
121
  end
122
122
 
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
+
123
134
  def self.home
124
135
  rdoc_dir = begin
125
136
  File.expand_path('~/.rdoc')
@@ -129,6 +140,7 @@ module RDoc
129
140
  if File.directory?(rdoc_dir)
130
141
  rdoc_dir
131
142
  else
143
+ require 'fileutils'
132
144
  begin
133
145
  # XDG
134
146
  xdg_data_home = ENV["XDG_DATA_HOME"] || File.join(File.expand_path("~"), '.local', 'share')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.1
4
+ version: 6.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: exe
16
16
  cert_chain: []
17
- date: 2023-12-05 00:00:00.000000000 Z
17
+ date: 2023-12-16 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: psych