rdoc 6.6.1 → 6.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rdoc/cross_reference.rb +3 -0
- data/lib/rdoc/encoding.rb +0 -11
- data/lib/rdoc/generator/pot.rb +1 -0
- data/lib/rdoc/markdown/literals.kpeg +0 -2
- data/lib/rdoc/markdown/literals.rb +0 -1
- data/lib/rdoc/markup/attribute_manager.rb +3 -0
- data/lib/rdoc/markup/parser.rb +4 -0
- data/lib/rdoc/markup/table.rb +11 -2
- data/lib/rdoc/markup/to_html.rb +1 -0
- data/lib/rdoc/markup/to_html_crossref.rb +1 -0
- data/lib/rdoc/markup/to_html_snippet.rb +3 -0
- data/lib/rdoc/parser/c.rb +15 -14
- data/lib/rdoc/parser/changelog.rb +15 -0
- data/lib/rdoc/parser/ripper_state_lex.rb +10 -0
- data/lib/rdoc/parser/ruby.rb +3 -0
- data/lib/rdoc/store.rb +3 -0
- data/lib/rdoc/text.rb +4 -0
- data/lib/rdoc/top_level.rb +3 -0
- data/lib/rdoc/version.rb +1 -1
- data/lib/rdoc.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 060b06473aafc2a0a07ded738b5be7819ddd0520d7e2033ef72311ff8dd57248
|
4
|
+
data.tar.gz: 500fd282367d6cefeb9257518a0ed5e5371cf3c09a6addc8ac30be1dbe7ba267
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52461100f11f5123da6874e2786b4a83248435fd4955609647421c49a71c5d6ba98bd869fc3c510e64d148992461762b4213390b7aa33bd9dd80d7caad665638
|
7
|
+
data.tar.gz: 87b21e587bc4e2d97b35f56b4be8e28a1ac40961dc5caf2f61ab3500f5f3a9147195b917d329a1264cb6f4605daec30bb5603c2269a09c5a89da359074928805
|
data/lib/rdoc/cross_reference.rb
CHANGED
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
|
|
data/lib/rdoc/generator/pot.rb
CHANGED
@@ -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
|
-
|
@@ -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
|
data/lib/rdoc/markup/parser.rb
CHANGED
@@ -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
|
##
|
data/lib/rdoc/markup/table.rb
CHANGED
@@ -3,12 +3,21 @@
|
|
3
3
|
# A section of table
|
4
4
|
|
5
5
|
class RDoc::Markup::Table
|
6
|
-
|
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
|
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|
|
data/lib/rdoc/markup/to_html.rb
CHANGED
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
|
-
((
|
579
|
-
|
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 $
|
586
|
-
table[
|
587
|
-
when $
|
588
|
-
table[
|
589
|
-
when $8
|
590
|
-
table[
|
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
|
-
|
941
|
+
if /\A(.+?)?:(?!\S)/ =~ comment.text
|
942
|
+
new_definition, new_comment = $1, $'
|
943
943
|
|
944
|
-
|
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
|
data/lib/rdoc/parser/ruby.rb
CHANGED
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
data/lib/rdoc/top_level.rb
CHANGED
data/lib/rdoc/version.rb
CHANGED
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.
|
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-
|
17
|
+
date: 2023-12-16 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: psych
|