Skip to content

Commit 3628e19

Browse files
committed
Add LEGAL.rdoc with references to licenses in other files. Issue #78
RDoc::CrossReference now ignores non-text RDoc::TopLevels when generating links.
1 parent 062efe8 commit 3628e19

File tree

8 files changed

+65
-11
lines changed

8 files changed

+65
-11
lines changed

History.rdoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
* Major enhancements
44
* RDoc HTML output has been improved:
5-
* The search from Володя Колесников's sdoc has been integrated.
5+
* The search from Володя Колесников's (Vladimir Kolesnikov) Sdoc has been
6+
integrated.
67

78
The search index generation is a reusable component through
89
RDoc::Generator::JsonIndex
@@ -87,6 +88,8 @@
8788
+rb_struct_define_without_accessor+ (like Range). Pull Request #73 by Dan
8889
Bernier
8990
* Fixed lexing of <code>a b <<-HEREDOC</code>. Issue #75 by John Mair.
91+
* Added LEGAL.rdoc with references to licenses in other files. Issue #78 by
92+
Dmitry Jemerov.
9093

9194
=== 3.9.2 / 2011-08-11
9295

LEGAL.rdoc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# coding: UTF-8
2+
3+
= Legal Notice Information
4+
5+
The files in this distribution are covered by the Ruby license (see LICENSE) except the features mentioned below:
6+
7+
Darkfish::
8+
Darkfish was written by Michael Granger and is included under the MIT
9+
license. Darkfish contains images from the Silk Icons set by Mark James.
10+
11+
See lib/rdoc/generator/darkfish.rb for license information.
12+
13+
* lib/rdoc/generator/darkfish.rb
14+
* lib/rdoc/generator/template/darkfish/*
15+
* lib/rdoc/generator/template/darkfish/images
16+
17+
Sdoc::
18+
Portions of SDoc by (Володя Колесников) Vladimir Kolesnikov are included
19+
under the MIT license as RDoc::Generator::JsonIndex. See
20+
lib/rdoc/generator/json_index.rb for license information.
21+
22+
* lib/rdoc/generator/json_index.rb
23+
* lib/rdoc/generator/template/json_index/*
24+
* The +#search_index+ methods on RDoc::CodeObject subclasses were derived
25+
from sdoc.
26+
* RDoc::ClassModule#document_self_or_methods comes from Sdoc.
27+

Manifest.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.autotest
22
.document
33
History.rdoc
4+
LEGAL.rdoc
45
LICENSE.rdoc
56
Manifest.txt
67
README.rdoc

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Depending on your version of ruby, you may need to install ruby rdoc/ri data:
4141
self.extra_rdoc_files += %w[
4242
History.rdoc
4343
LICENSE.rdoc
44+
LEGAL.rdoc
4445
README.rdoc
4546
RI.rdoc
4647
TODO.rdoc
@@ -128,3 +129,4 @@ task :diff_rubinius do
128129
sh "diff #{diff_options} test #{rubinius_dir}/test/rdoc; true"
129130
end
130131

132+

lib/rdoc/top_level.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,14 @@ def base_name
378378

379379
alias name base_name
380380

381+
##
382+
# Only a TopLevel that contains text file) will be displayed. See also
383+
# RDoc::CodeObject#display?
384+
385+
def display?
386+
text? and super
387+
end
388+
381389
##
382390
# See RDoc::TopLevel::find_class_or_module
383391
#--

test/test_rdoc_cross_reference.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ def refute_ref name
1616
assert_equal name, @xref.resolve(name, name)
1717
end
1818

19-
def test_resolve_page
20-
page = RDoc::TopLevel.new 'README.txt'
21-
page.parser = RDoc::Parser::Simple
22-
23-
assert_ref page, 'README'
24-
end
25-
2619
def test_resolve_C2
2720
@xref = RDoc::CrossReference.new @c2
2821

@@ -100,7 +93,7 @@ def test_resolve_class
10093
end
10194

10295
def test_resolve_file
103-
assert_ref @xref_data, 'xref_data.rb'
96+
refute_ref 'xref_data.rb'
10497
end
10598

10699
def test_resolve_method
@@ -136,6 +129,13 @@ def test_resolve_method
136129
assert_ref @c2_c3_m, '::C2::C3#m(*)'
137130
end
138131

132+
def test_resolve_page
133+
page = RDoc::TopLevel.new 'README.txt'
134+
page.parser = RDoc::Parser::Simple
135+
136+
assert_ref page, 'README'
137+
end
138+
139139
def test_resolve_percent
140140
i_percent = RDoc::AnyMethod.new nil, '%'
141141
i_percent.singleton = false

test/test_rdoc_markup_to_html_crossref.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ def test_handle_special_CROSSREF_show_hash_false
118118
end
119119

120120
def test_handle_special_HYPERLINK_rdoc
121-
RDoc::TopLevel.new 'README.txt'
121+
readme = RDoc::TopLevel.new 'README.txt'
122+
readme.parser = RDoc::Parser::Simple
123+
122124
@to = RDoc::Markup::ToHtmlCrossref.new 'C2.html', @c2, true
123125

124126
link = @to.handle_special_HYPERLINK hyper 'C2::C3'
@@ -135,7 +137,9 @@ def test_handle_special_HYPERLINK_rdoc
135137
end
136138

137139
def test_handle_special_TIDYLINK_rdoc
138-
RDoc::TopLevel.new 'README.txt'
140+
readme = RDoc::TopLevel.new 'README.txt'
141+
readme.parser = RDoc::Parser::Simple
142+
139143
@to = RDoc::Markup::ToHtmlCrossref.new 'C2.html', @c2, true
140144

141145
link = @to.handle_special_TIDYLINK tidy 'C2::C3'

test/test_rdoc_top_level.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,15 @@ def test_base_name
191191
assert_equal 'top_level.rb', @top_level.base_name
192192
end
193193

194+
def test_display_eh
195+
refute @top_level.display?
196+
197+
page = RDoc::TopLevel.new 'README.txt'
198+
page.parser = RDoc::Parser::Simple
199+
200+
assert page.display?
201+
end
202+
194203
def test_eql_eh
195204
top_level2 = RDoc::TopLevel.new 'path/top_level.rb'
196205
other_level = RDoc::TopLevel.new 'path/other_level.rb'

0 commit comments

Comments
 (0)