Skip to content

Commit 1a81a2d

Browse files
committed
Sigh
1 parent d4ff3f6 commit 1a81a2d

35 files changed

+998
-562
lines changed

History.txt

+21-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
=== 3.0
1+
=== 3.0.1 / 2010-12-19
2+
3+
* Bug fix
4+
* RDoc no longer has a Perl parser.
5+
6+
=== 3.0 / 2010-12-19
7+
8+
Special thanks to Thierry Lambert for massive improvements to RDoc.
29

310
* Major enhancements
411
* Ruby 1.8.6 is no longer supported by RDoc.
12+
* RDoc now converts input files to a single encoding specified by
13+
<tt>--encoding</tt>. See RDoc::RDoc and RDoc::Options#encoding.
14+
<tt>--encoding</tt> is now preferred over <tt>--charset</tt>
15+
* RDoc now supports a <tt>--coverage-report</tt> flag (also <tt>-C</tt> and
16+
<tt>--dcov</tt>) that outputs a report on items lacking documentation.
17+
* Templates (<tt>rdoc -T</tt>) are now checked for existence in
18+
RDoc::Options. Generator authors can now use RDoc::Options#template_dir
19+
which is the full path to the template directory.
20+
* Added support for class aliases. Patch by Thierry Lambert.
521
* Improved merging of classes and modules across multiple files including
622
more accurate documentation statistics. Patch by Thierry Lambert.
723
* Improved handling of method aliases. Patch by Thierry Lambert.
8-
* Added support for class aliases. Patch by Thierry Lambert.
924
* Improved handling of visibility of RDoc code objects. Patch by Thierry
1025
Lambert.
11-
* RDoc now converts input files to a single encoding specified by
12-
<tt>--encoding</tt>. See RDoc::RDoc and RDoc::Options#encoding.
13-
<tt>--encoding</tt> is now preferred over <tt>--charset</tt>
1426
* RDoc::Attr#type is now RDoc::Attr#definition. Patch by Thierry Lambert.
1527
* Removed TimeConstantMethods
16-
* Templates (<tt>rdoc -T</tt>) are now checked for existence in
17-
RDoc::Options. Generator authors can now use RDoc::Options#template_dir
18-
which is the full path to the template directory.
28+
* RDoc now calls ::new instead of ::for on generators.
1929
* Minor enhancements
2030
* Added rdoc arguments <tt>--dry-run</tt>, <tt>--all</tt>,
2131
<tt>--visibility</tt>, <tt>--force-output</tt>, <tt>--hyperlink-all</tt>.
@@ -53,6 +63,9 @@
5363
* Removed "':' not followed by operator or identifier" warning for new Hash
5464
syntax.
5565
* rb_attr() is now supported for attributes.
66+
* RDoc::Parser::C now supports yields, doc, and args directives like
67+
RDoc::Parser::Ruby.
68+
* Moved RDoc::Parser::PerlPOD to the rdoc-perl_pod gem.
5669
* Bug fixes
5770
* RDoc::Generator tests no longer require any installed RDoc on Ruby 1.9
5871
* Load existing cache before generating ri. Ruby r27749 by NAKAMURA Usaku.

Manifest.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ lib/rdoc/normal_module.rb
8787
lib/rdoc/options.rb
8888
lib/rdoc/parser.rb
8989
lib/rdoc/parser/c.rb
90-
lib/rdoc/parser/perl.rb
9190
lib/rdoc/parser/ruby.rb
9291
lib/rdoc/parser/ruby_tools.rb
9392
lib/rdoc/parser/simple.rb
@@ -102,6 +101,9 @@ lib/rdoc/ruby_lex.rb
102101
lib/rdoc/ruby_token.rb
103102
lib/rdoc/single_class.rb
104103
lib/rdoc/stats.rb
104+
lib/rdoc/stats/normal.rb
105+
lib/rdoc/stats/quiet.rb
106+
lib/rdoc/stats/verbose.rb
105107
lib/rdoc/task.rb
106108
lib/rdoc/text.rb
107109
lib/rdoc/token_stream.rb
@@ -142,7 +144,6 @@ test/test_rdoc_normal_module.rb
142144
test/test_rdoc_options.rb
143145
test/test_rdoc_parser.rb
144146
test/test_rdoc_parser_c.rb
145-
test/test_rdoc_parser_perl.rb
146147
test/test_rdoc_parser_ruby.rb
147148
test/test_rdoc_parser_simple.rb
148149
test/test_rdoc_rdoc.rb

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Hoe.spec 'rdoc' do
1313
self.remote_rdoc_dir = ''
1414
self.testlib = :minitest
1515

16-
extra_dev_deps << ['minitest', '~> 1.3']
16+
extra_dev_deps << ['minitest', '~> 2']
1717
extra_rdoc_files << 'Rakefile'
1818
spec_extras['required_rubygems_version'] = '>= 1.3'
1919
spec_extras['homepage'] = 'http://rdoc.rubyforge.org'

lib/rdoc.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def self.const_missing const_name # :nodoc:
9595
##
9696
# RDoc version you are using
9797

98-
VERSION = '2.6'
98+
VERSION = '3.0.1'
9999

100100
##
101101
# Method visibilities

lib/rdoc/context.rb

+1
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ def full_name
841841

842842
def fully_documented?
843843
documented? and
844+
attributes.all? { |a| a.documented? } and
844845
method_list.all? { |m| m.documented? } and
845846
constants.all? { |c| c.documented? }
846847
end

lib/rdoc/erbio.rb

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# To use:
88
#
9-
# erbio = RDoc::ERBIO.new '<%= "hello world" %>', nil, nil, 'io'
9+
# erbio = RDoc::ERBIO.new '<%= "hello world" %>', nil, nil
1010
#
1111
# open 'hello.txt', 'w' do |io|
1212
# erbio.result binding
@@ -16,6 +16,13 @@
1616

1717
class RDoc::ERBIO < ERB
1818

19+
##
20+
# Defaults +eoutvar+ to 'io', otherwise is identical to ERB's initialize
21+
22+
def initialize str, safe_level = nil, trim_mode = nil, eoutvar = 'io'
23+
super
24+
end
25+
1926
##
2027
# Instructs +compiler+ how to write to +io_variable+
2128

lib/rdoc/gauntlet.rb

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
class RDoc::Gauntlet < Gauntlet
99

10+
##
11+
# Runs an RDoc generator for gem +name+
12+
1013
def run name
1114
return if self.data.key? name
1215

lib/rdoc/generator/darkfish.rb

+35-36
Original file line numberDiff line numberDiff line change
@@ -53,38 +53,15 @@ class RDoc::Generator::Darkfish
5353

5454
include ERB::Util
5555

56-
##
57-
# Subversion rev
58-
59-
SVNRev = %$Rev: 52 $
60-
61-
##
62-
# Subversion ID
63-
64-
SVNId = %$Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $
65-
6656
# Path to this file's parent directory. Used to find templates and other
6757
# resources.
6858

6959
GENERATOR_DIR = File.join 'rdoc', 'generator'
7060

61+
##
7162
# Release Version
7263

73-
VERSION = '1.1.6'
74-
75-
# Directory where generated classes live relative to the root
76-
77-
CLASS_DIR = nil
78-
79-
# Directory where generated files live relative to the root
80-
81-
FILE_DIR = nil
82-
83-
# Standard generator factory method
84-
85-
def self.for options
86-
new options
87-
end
64+
VERSION = '2'
8865

8966
##
9067
# Initialize a few instance variables before we start
@@ -93,6 +70,7 @@ def initialize options
9370
@options = options
9471

9572
@template_dir = Pathname.new options.template_dir
73+
@template_cache = {}
9674

9775
@files = nil
9876
@classes = nil
@@ -113,12 +91,20 @@ def debug_msg *msg
11391
$stderr.puts(*msg)
11492
end
11593

94+
##
95+
# Directory where generated class HTML files live relative to the output
96+
# dir.
97+
11698
def class_dir
117-
CLASS_DIR
99+
nil
118100
end
119101

102+
##
103+
# Directory where generated class HTML files live relative to the output
104+
# dir.
105+
120106
def file_dir
121-
FILE_DIR
107+
nil
122108
end
123109

124110
##
@@ -229,9 +215,10 @@ def generate_class_files
229215

230216
@classes.each do |klass|
231217
debug_msg " working on %s (%s)" % [klass.full_name, klass.path]
232-
out_file = @outputdir + klass.path
233-
rel_prefix = @outputdir.relative_path_from out_file.dirname
234-
svninfo = self.get_svninfo klass
218+
out_file = @outputdir + klass.path
219+
# suppress 1.9.3 warning
220+
rel_prefix = rel_prefix = @outputdir.relative_path_from(out_file.dirname)
221+
svninfo = svninfo = self.get_svninfo(klass)
235222

236223
debug_msg " rendering #{out_file}"
237224
render_template template_file, out_file do |io| binding end
@@ -249,7 +236,8 @@ def generate_file_files
249236
@files.each do |file|
250237
out_file = @outputdir + file.path
251238
debug_msg " working on %s (%s)" % [ file.full_name, out_file ]
252-
rel_prefix = @outputdir.relative_path_from out_file.dirname
239+
# suppress 1.9.3 warning
240+
rel_prefix = rel_prefix = @outputdir.relative_path_from(out_file.dirname)
253241

254242
debug_msg " rendering #{out_file}"
255243
render_template template_file, out_file do |io| binding end
@@ -317,7 +305,7 @@ def get_svninfo klass
317305
# An io will be yielded which must be captured by binding in the caller.
318306

319307
def render_template template_file, out_file # :yield: io
320-
template_src = template_file.read
308+
template = template_for template_file
321309

322310
unless @options.dry_run then
323311
debug_msg "Outputting to %s" % [out_file.expand_path]
@@ -326,15 +314,11 @@ def render_template template_file, out_file # :yield: io
326314
out_file.open 'w', 0644 do |io|
327315
io.set_encoding @options.encoding if Object.const_defined? :Encoding
328316

329-
template = RDoc::ERBIO.new template_src, nil, '<>', 'io'
330-
331317
context = yield io
332318

333319
template_result template, context, template_file
334320
end
335321
else
336-
template = ERB.new template_src, nil, '<>'
337-
338322
context = yield nil
339323

340324
output = template_result template, context, template_file
@@ -359,5 +343,20 @@ def template_result template, context, template_file
359343
], e.backtrace
360344
end
361345

346+
##
347+
# Retrieves a cache template for +file+, if present, or fills the cache.
348+
349+
def template_for file
350+
template = @template_cache[file]
351+
352+
return template if template
353+
354+
klass = @options.dry_run ? ERB : RDoc::ERBIO
355+
356+
template = klass.new file.read, nil, '<>'
357+
@template_cache[file] = template
358+
template
359+
end
360+
362361
end
363362

lib/rdoc/generator/ri.rb

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ class RDoc::Generator::RI
88

99
RDoc::RDoc.add_generator self
1010

11-
def self.for options
12-
new options
13-
end
14-
1511
##
1612
# Set up a new ri generator
1713

lib/rdoc/markup.rb

+3
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,9 @@
527527

528528
class RDoc::Markup
529529

530+
##
531+
# An AttributeManager which handles inline markup.
532+
530533
attr_reader :attribute_manager
531534

532535
##

lib/rdoc/markup/attribute_manager.rb

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ class RDoc::Markup::AttributeManager
1515
# optimistic
1616
#++
1717

18-
A_PROTECT = 004 # :nodoc:
18+
A_PROTECT = 004 # :nodoc:
1919

20-
PROTECT_ATTR = A_PROTECT.chr # :nodoc:
20+
##
21+
# Special mask character to prevent inline markup handling
22+
23+
PROTECT_ATTR = A_PROTECT.chr # :nodoc:
2124

2225
##
2326
# This maps delimiters that occur around words (such as *bold* or +tt+)

0 commit comments

Comments
 (0)