rdoc 6.1.2.1 → 6.2.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rdoc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +9 -0
- data/README.rdoc +0 -1
- data/Rakefile +1 -1
- data/lib/rdoc/class_module.rb +1 -1
- data/lib/rdoc/comment.rb +7 -1
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +13 -5
- data/lib/rdoc/markup/parser.rb +58 -42
- data/lib/rdoc/markup/to_html_crossref.rb +5 -1
- data/lib/rdoc/markup.rb +0 -2
- data/lib/rdoc/options.rb +4 -1
- data/lib/rdoc/parser/c.rb +116 -126
- data/lib/rdoc/parser/ripper_state_lex.rb +2 -1
- data/lib/rdoc/parser/ruby.rb +3 -3
- data/lib/rdoc/rd/block_parser.rb +2 -2
- data/lib/rdoc/rd/inline_parser.rb +2 -2
- data/lib/rdoc/rdoc.rb +2 -2
- data/lib/rdoc/ri/paths.rb +1 -1
- data/lib/rdoc/servlet.rb +10 -7
- data/lib/rdoc/store.rb +4 -12
- data/lib/rdoc/task.rb +1 -1
- data/lib/rdoc/text.rb +8 -2
- data/lib/rdoc/token_stream.rb +8 -3
- data/lib/rdoc/tom_doc.rb +6 -7
- data/lib/rdoc/version.rb +1 -1
- data/rdoc.gemspec +1 -7
- metadata +7 -81
- data/.travis.yml +0 -21
- data/appveyor.yml +0 -36
- data/lib/rdoc/markup/formatter_test_case.rb +0 -764
- data/lib/rdoc/markup/text_formatter_test_case.rb +0 -115
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c71da0922078855b23bba9eb9f3671d5f04abb40c690eab20382c812b1b6aacc
|
4
|
+
data.tar.gz: bf58da8ba529883aa44e4ddc5e7c88a9671e508993bfd62142813cc661bbe62c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f343d3101a0fbd05fc6d8675d9a72cc2aed5ff794258fc3fbe9f8658032857d61a68350ea09e29b84c02789cec3f0f8a6e83faf29faf41d2a00e6cbad07435c5
|
7
|
+
data.tar.gz: f0f506c54e2ebc80b69d0d26104c44ae3ecc5cefcaa90a6cd4364f8e4660fc8021e6c7426bd63363519a217728a8c3ac0be217f4d28b6b3f1c4e9b1ff6f34c26
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -3,7 +3,6 @@
|
|
3
3
|
home :: https://github.com/ruby/rdoc
|
4
4
|
rdoc :: https://ruby.github.io/rdoc
|
5
5
|
bugs :: https://github.com/ruby/rdoc/issues
|
6
|
-
build status :: {<img src="https://travis-ci.org/ruby/rdoc.svg?branch=master" alt="Build Status on Travis CI" />}[https://travis-ci.org/ruby/rdoc] {<img src="https://ci.appveyor.com/api/projects/status/github/ruby/rdoc?branch=master&svg=true" alt="Build Status on AppVeyor" />}[https://ci.appveyor.com/project/ruby/rdoc]
|
7
6
|
code quality :: {<img src="https://codeclimate.com/github/ruby/rdoc/badges/gpa.svg" alt="Code Climate">}[https://codeclimate.com/github/ruby/rdoc]
|
8
7
|
|
9
8
|
== Description
|
data/Rakefile
CHANGED
data/lib/rdoc/class_module.rb
CHANGED
@@ -210,7 +210,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
210
210
|
normalize_comment comment
|
211
211
|
end
|
212
212
|
|
213
|
-
comment = "#{@comment}\n---\n#{comment}" unless @comment.empty?
|
213
|
+
comment = "#{@comment.to_s}\n---\n#{comment.to_s}" unless @comment.empty?
|
214
214
|
|
215
215
|
super comment
|
216
216
|
end
|
data/lib/rdoc/comment.rb
CHANGED
@@ -33,6 +33,11 @@ class RDoc::Comment
|
|
33
33
|
|
34
34
|
attr_reader :text
|
35
35
|
|
36
|
+
##
|
37
|
+
# Alias for text
|
38
|
+
|
39
|
+
alias to_s text
|
40
|
+
|
36
41
|
##
|
37
42
|
# Overrides the content returned by #parse. Use when there is no #text
|
38
43
|
# source for this comment
|
@@ -43,9 +48,10 @@ class RDoc::Comment
|
|
43
48
|
# Creates a new comment with +text+ that is found in the RDoc::TopLevel
|
44
49
|
# +location+.
|
45
50
|
|
46
|
-
def initialize text = nil, location = nil
|
51
|
+
def initialize text = nil, location = nil, language = nil
|
47
52
|
@location = location
|
48
53
|
@text = text.nil? ? nil : text.dup
|
54
|
+
@language = language
|
49
55
|
|
50
56
|
@document = nil
|
51
57
|
@format = 'rdoc'
|
@@ -74,6 +74,9 @@ h6:target {
|
|
74
74
|
code,
|
75
75
|
pre {
|
76
76
|
font-family: "Source Code Pro", Monaco, monospace;
|
77
|
+
background-color: rgba(27,31,35,0.05);
|
78
|
+
padding: 0em 0.2em;
|
79
|
+
border-radius: 0.2em;
|
77
80
|
}
|
78
81
|
|
79
82
|
/* @group Generic Classes */
|
@@ -103,7 +106,7 @@ pre {
|
|
103
106
|
|
104
107
|
.missing-docs {
|
105
108
|
font-size: 120%;
|
106
|
-
background: white url(images/wrench_orange.png) no-repeat 4px center;
|
109
|
+
background: white url(../images/wrench_orange.png) no-repeat 4px center;
|
107
110
|
color: #ccc;
|
108
111
|
line-height: 2em;
|
109
112
|
border: 1px solid #d00;
|
@@ -147,11 +150,11 @@ pre {
|
|
147
150
|
.table-of-contents li .toc-toggle {
|
148
151
|
width: 16px;
|
149
152
|
height: 16px;
|
150
|
-
background: url(images/add.png) no-repeat;
|
153
|
+
background: url(../images/add.png) no-repeat;
|
151
154
|
}
|
152
155
|
|
153
156
|
.table-of-contents li .toc-toggle.open {
|
154
|
-
background: url(images/delete.png) no-repeat;
|
157
|
+
background: url(../images/delete.png) no-repeat;
|
155
158
|
}
|
156
159
|
|
157
160
|
/* @end */
|
@@ -273,8 +276,13 @@ ul.link-list .type {
|
|
273
276
|
-webkit-border-radius: 5px;
|
274
277
|
}
|
275
278
|
|
279
|
+
dl.label-list dt {
|
280
|
+
float: left;
|
281
|
+
margin-right: 1em;
|
282
|
+
}
|
283
|
+
|
276
284
|
.calls-super {
|
277
|
-
background: url(images/arrow_up.png) no-repeat right center;
|
285
|
+
background: url(../images/arrow_up.png) no-repeat right center;
|
278
286
|
}
|
279
287
|
|
280
288
|
/* @end */
|
@@ -500,7 +508,7 @@ main .method-click-advice {
|
|
500
508
|
visibility: hidden;
|
501
509
|
padding-right: 20px;
|
502
510
|
line-height: 20px;
|
503
|
-
background: url(images/zoom.png) no-repeat right top;
|
511
|
+
background: url(../images/zoom.png) no-repeat right top;
|
504
512
|
}
|
505
513
|
main .method-heading:hover .method-click-advice {
|
506
514
|
visibility: visible;
|
data/lib/rdoc/markup/parser.rb
CHANGED
@@ -80,10 +80,6 @@ class RDoc::Markup::Parser
|
|
80
80
|
@binary_input = nil
|
81
81
|
@current_token = nil
|
82
82
|
@debug = false
|
83
|
-
@input = nil
|
84
|
-
@input_encoding = nil
|
85
|
-
@line = 0
|
86
|
-
@line_pos = 0
|
87
83
|
@s = nil
|
88
84
|
@tokens = []
|
89
85
|
end
|
@@ -319,13 +315,6 @@ class RDoc::Markup::Parser
|
|
319
315
|
verbatim
|
320
316
|
end
|
321
317
|
|
322
|
-
##
|
323
|
-
# The character offset for the input string at the given +byte_offset+
|
324
|
-
|
325
|
-
def char_pos byte_offset
|
326
|
-
@input.byteslice(0, byte_offset).length
|
327
|
-
end
|
328
|
-
|
329
318
|
##
|
330
319
|
# Pulls the next token from the stream.
|
331
320
|
|
@@ -424,15 +413,53 @@ class RDoc::Markup::Parser
|
|
424
413
|
token
|
425
414
|
end
|
426
415
|
|
416
|
+
##
|
417
|
+
# A simple wrapper of StringScanner that is aware of the current column and lineno
|
418
|
+
|
419
|
+
class MyStringScanner
|
420
|
+
def initialize(input)
|
421
|
+
@line = @column = 0
|
422
|
+
@s = StringScanner.new input
|
423
|
+
end
|
424
|
+
|
425
|
+
def scan(re)
|
426
|
+
ret = @s.scan(re)
|
427
|
+
@column += ret.length if ret
|
428
|
+
ret
|
429
|
+
end
|
430
|
+
|
431
|
+
def unscan(s)
|
432
|
+
@s.pos -= s.bytesize
|
433
|
+
@column -= s.length
|
434
|
+
end
|
435
|
+
|
436
|
+
def pos
|
437
|
+
[@column, @line]
|
438
|
+
end
|
439
|
+
|
440
|
+
def newline!
|
441
|
+
@column = 0
|
442
|
+
@line += 1
|
443
|
+
end
|
444
|
+
|
445
|
+
def eos?
|
446
|
+
@s.eos?
|
447
|
+
end
|
448
|
+
|
449
|
+
def matched
|
450
|
+
@s.matched
|
451
|
+
end
|
452
|
+
|
453
|
+
def [](i)
|
454
|
+
@s[i]
|
455
|
+
end
|
456
|
+
end
|
457
|
+
|
427
458
|
##
|
428
459
|
# Creates the StringScanner
|
429
460
|
|
430
461
|
def setup_scanner input
|
431
|
-
@
|
432
|
-
@line_pos = 0
|
433
|
-
@input = input.dup
|
434
|
-
|
435
|
-
@s = StringScanner.new input
|
462
|
+
@s = MyStringScanner.new input
|
436
463
|
end
|
437
464
|
|
438
465
|
##
|
@@ -467,31 +494,30 @@ class RDoc::Markup::Parser
|
|
467
494
|
@tokens << case
|
468
495
|
# [CR]LF => :NEWLINE
|
469
496
|
when @s.scan(/\r?\n/) then
|
470
|
-
token = [:NEWLINE, @s.matched, *
|
471
|
-
@
|
472
|
-
@line += 1
|
497
|
+
token = [:NEWLINE, @s.matched, *pos]
|
498
|
+
@s.newline!
|
473
499
|
token
|
474
500
|
# === text => :HEADER then :TEXT
|
475
501
|
when @s.scan(/(=+)(\s*)/) then
|
476
502
|
level = @s[1].length
|
477
|
-
header = [:HEADER, level, *
|
503
|
+
header = [:HEADER, level, *pos]
|
478
504
|
|
479
505
|
if @s[2] =~ /^\r?\n/ then
|
480
|
-
@s.
|
506
|
+
@s.unscan(@s[2])
|
481
507
|
header
|
482
508
|
else
|
483
509
|
pos = @s.pos
|
484
510
|
@s.scan(/.*/)
|
485
511
|
@tokens << header
|
486
|
-
[:TEXT, @s.matched.sub(/\r$/, ''), *
|
512
|
+
[:TEXT, @s.matched.sub(/\r$/, ''), *pos]
|
487
513
|
end
|
488
514
|
# --- (at least 3) and nothing else on the line => :RULE
|
489
515
|
when @s.scan(/(-{3,}) *\r?$/) then
|
490
|
-
[:RULE, @s[1].length - 2, *
|
516
|
+
[:RULE, @s[1].length - 2, *pos]
|
491
517
|
# * or - followed by white space and text => :BULLET
|
492
518
|
when @s.scan(/([*-]) +(\S)/) then
|
493
|
-
@s.
|
494
|
-
[:BULLET, @s[1], *
|
519
|
+
@s.unscan(@s[2])
|
520
|
+
[:BULLET, @s[1], *pos]
|
495
521
|
# A. text, a. text, 12. text => :UALPHA, :LALPHA, :NUMBER
|
496
522
|
when @s.scan(/([a-z]|\d+)\. +(\S)/i) then
|
497
523
|
# FIXME if tab(s), the column will be wrong
|
@@ -500,7 +526,7 @@ class RDoc::Markup::Parser
|
|
500
526
|
# before (and provide a check for that at least in debug
|
501
527
|
# mode)
|
502
528
|
list_label = @s[1]
|
503
|
-
@s.
|
529
|
+
@s.unscan(@s[2])
|
504
530
|
list_type =
|
505
531
|
case list_label
|
506
532
|
when /[a-z]/ then :LALPHA
|
@@ -509,24 +535,24 @@ class RDoc::Markup::Parser
|
|
509
535
|
else
|
510
536
|
raise ParseError, "BUG token #{list_label}"
|
511
537
|
end
|
512
|
-
[list_type, list_label, *
|
538
|
+
[list_type, list_label, *pos]
|
513
539
|
# [text] followed by spaces or end of line => :LABEL
|
514
540
|
when @s.scan(/\[(.*?)\]( +|\r?$)/) then
|
515
|
-
[:LABEL, @s[1], *
|
541
|
+
[:LABEL, @s[1], *pos]
|
516
542
|
# text:: followed by spaces or end of line => :NOTE
|
517
543
|
when @s.scan(/(.*?)::( +|\r?$)/) then
|
518
|
-
[:NOTE, @s[1], *
|
544
|
+
[:NOTE, @s[1], *pos]
|
519
545
|
# >>> followed by end of line => :BLOCKQUOTE
|
520
546
|
when @s.scan(/>>> *(\w+)?$/) then
|
521
|
-
[:BLOCKQUOTE, @s[1], *
|
547
|
+
[:BLOCKQUOTE, @s[1], *pos]
|
522
548
|
# anything else: :TEXT
|
523
549
|
else
|
524
550
|
@s.scan(/(.*?)( )?\r?$/)
|
525
|
-
token = [:TEXT, @s[1], *
|
551
|
+
token = [:TEXT, @s[1], *pos]
|
526
552
|
|
527
553
|
if @s[2] then
|
528
554
|
@tokens << token
|
529
|
-
[:BREAK, @s[2],
|
555
|
+
[:BREAK, @s[2], pos[0] + @s[1].length, pos[1]]
|
530
556
|
else
|
531
557
|
token
|
532
558
|
end
|
@@ -536,16 +562,6 @@ class RDoc::Markup::Parser
|
|
536
562
|
self
|
537
563
|
end
|
538
564
|
|
539
|
-
##
|
540
|
-
# Calculates the column (by character) and line of the current token based
|
541
|
-
# on +byte_offset+.
|
542
|
-
|
543
|
-
def token_pos byte_offset
|
544
|
-
offset = char_pos byte_offset
|
545
|
-
|
546
|
-
[offset - @line_pos, @line]
|
547
|
-
end
|
548
|
-
|
549
565
|
##
|
550
566
|
# Returns the current token to the token stream
|
551
567
|
|
@@ -153,7 +153,11 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
|
|
153
153
|
ref.sections.any? { |section| label == section.title } then
|
154
154
|
path << "##{label}"
|
155
155
|
else
|
156
|
-
|
156
|
+
if ref.respond_to?(:aref)
|
157
|
+
path << "##{ref.aref}-label-#{label}"
|
158
|
+
else
|
159
|
+
path << "#label-#{label}"
|
160
|
+
end
|
157
161
|
end if label
|
158
162
|
|
159
163
|
"<a href=\"#{path}\">#{text}</a>"
|
data/lib/rdoc/markup.rb
CHANGED
@@ -849,8 +849,6 @@ https://github.com/ruby/rdoc/issues
|
|
849
849
|
|
850
850
|
# Formatters
|
851
851
|
autoload :Formatter, 'rdoc/markup/formatter'
|
852
|
-
autoload :FormatterTestCase, 'rdoc/markup/formatter_test_case'
|
853
|
-
autoload :TextFormatterTestCase, 'rdoc/markup/text_formatter_test_case'
|
854
852
|
|
855
853
|
autoload :ToAnsi, 'rdoc/markup/to_ansi'
|
856
854
|
autoload :ToBs, 'rdoc/markup/to_bs'
|
data/lib/rdoc/options.rb
CHANGED