Skip to content

Commit 6968cca

Browse files
committed
Fix bug in RDoc::CodeObject#display? due to incorrect ivar
Fix warning due to regexp as first argument Increase version to 3.9
1 parent 46f1350 commit 6968cca

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

lib/rdoc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def self.const_missing const_name # :nodoc:
104104
##
105105
# RDoc version you are using
106106

107-
VERSION = '3.8'
107+
VERSION = '3.9'
108108

109109
##
110110
# Method visibilities

lib/rdoc/code_object.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def comment=(comment)
144144
# Should this CodeObject be shown in documentation?
145145

146146
def display?
147-
@document_self and not @ignore
147+
@document_self and not @ignored
148148
end
149149

150150
##
@@ -239,10 +239,10 @@ def full_name= full_name
239239
# documentation.
240240
#
241241
# See github issue #55
242-
#--
242+
#
243243
# The ignored status is temporary in order to allow implementation details
244244
# to be hidden. At the end of processing a file RDoc allows all classes
245-
# and modules to add documentation.
245+
# and modules to add new documentation to previously created classes.
246246
#
247247
# If a class was ignored (via stopdoc) then reopened later with additional
248248
# documentation it should be shown. If a class was ignored and never

lib/rdoc/markup/to_html_crossref.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def initialize(from_path, context, show_hash, hyperlink_all = false,
4141
@cross_reference = RDoc::CrossReference.new context
4242

4343
@markup.add_special crossref_re, :CROSSREF
44-
@markup.add_special /rdoc:\S+\w/, :HYPERLINK
44+
@markup.add_special(/rdoc-ref:\S+\w/, :HYPERLINK)
4545

4646
@from_path = from_path
4747
@hyperlink_all = hyperlink_all

test/test_rdoc_code_object.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def test_comment_equals_encoding_blank
7070
def test_display_eh_document_self
7171
assert @co.display?
7272

73-
@co.stop_doc
73+
@co.document_self = false
7474

7575
refute @co.display?
7676
end
@@ -85,6 +85,10 @@ def test_display_eh_ignore
8585
@co.stop_doc
8686

8787
refute @co.display?
88+
89+
@co.done_documenting = false
90+
91+
refute @co.display?
8892
end
8993

9094
def test_document_children_equals

test/test_rdoc_markup_to_html_crossref.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ def setup
1313
@to = RDoc::Markup::ToHtmlCrossref.new 'index.html', @c1, true
1414
end
1515

16+
def test_convert_CROSSREF
17+
result = @to.convert 'C1'
18+
19+
assert_equal "\n<p><a href=\"C1.html\">C1</a></p>\n", result
20+
end
21+
22+
def test_convert_HYPERLINK_rdoc_ref
23+
result = @to.convert 'rdoc-ref:C1'
24+
25+
assert_equal "\n<p><a href=\"C1.html\">C1</a></p>\n", result
26+
end
27+
1628
def test_handle_special_CROSSREF
1729
assert_equal "<a href=\"C2/C3.html\">C2::C3</a>", SPECIAL('C2::C3')
1830
end

0 commit comments

Comments
 (0)