Skip to content

Commit

Permalink
Sigh
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed Dec 20, 2010
1 parent d4ff3f6 commit 1a81a2d
Show file tree
Hide file tree
Showing 35 changed files with 998 additions and 562 deletions.
29 changes: 21 additions & 8 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
=== 3.0
=== 3.0.1 / 2010-12-19

* Bug fix
* RDoc no longer has a Perl parser.

=== 3.0 / 2010-12-19

Special thanks to Thierry Lambert for massive improvements to RDoc.

* Major enhancements
* Ruby 1.8.6 is no longer supported by RDoc.
* RDoc now converts input files to a single encoding specified by
<tt>--encoding</tt>. See RDoc::RDoc and RDoc::Options#encoding.
<tt>--encoding</tt> is now preferred over <tt>--charset</tt>
* RDoc now supports a <tt>--coverage-report</tt> flag (also <tt>-C</tt> and
<tt>--dcov</tt>) that outputs a report on items lacking documentation.
* Templates (<tt>rdoc -T</tt>) are now checked for existence in
RDoc::Options. Generator authors can now use RDoc::Options#template_dir
which is the full path to the template directory.
* Added support for class aliases. Patch by Thierry Lambert.
* Improved merging of classes and modules across multiple files including
more accurate documentation statistics. Patch by Thierry Lambert.
* Improved handling of method aliases. Patch by Thierry Lambert.
* Added support for class aliases. Patch by Thierry Lambert.
* Improved handling of visibility of RDoc code objects. Patch by Thierry
Lambert.
* RDoc now converts input files to a single encoding specified by
<tt>--encoding</tt>. See RDoc::RDoc and RDoc::Options#encoding.
<tt>--encoding</tt> is now preferred over <tt>--charset</tt>
* RDoc::Attr#type is now RDoc::Attr#definition. Patch by Thierry Lambert.
* Removed TimeConstantMethods
* Templates (<tt>rdoc -T</tt>) are now checked for existence in
RDoc::Options. Generator authors can now use RDoc::Options#template_dir
which is the full path to the template directory.
* RDoc now calls ::new instead of ::for on generators.
* Minor enhancements
* Added rdoc arguments <tt>--dry-run</tt>, <tt>--all</tt>,
<tt>--visibility</tt>, <tt>--force-output</tt>, <tt>--hyperlink-all</tt>.
Expand Down Expand Up @@ -53,6 +63,9 @@
* Removed "':' not followed by operator or identifier" warning for new Hash
syntax.
* rb_attr() is now supported for attributes.
* RDoc::Parser::C now supports yields, doc, and args directives like
RDoc::Parser::Ruby.
* Moved RDoc::Parser::PerlPOD to the rdoc-perl_pod gem.
* Bug fixes
* RDoc::Generator tests no longer require any installed RDoc on Ruby 1.9
* Load existing cache before generating ri. Ruby r27749 by NAKAMURA Usaku.
Expand Down
5 changes: 3 additions & 2 deletions Manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ lib/rdoc/normal_module.rb
lib/rdoc/options.rb
lib/rdoc/parser.rb
lib/rdoc/parser/c.rb
lib/rdoc/parser/perl.rb
lib/rdoc/parser/ruby.rb
lib/rdoc/parser/ruby_tools.rb
lib/rdoc/parser/simple.rb
Expand All @@ -102,6 +101,9 @@ lib/rdoc/ruby_lex.rb
lib/rdoc/ruby_token.rb
lib/rdoc/single_class.rb
lib/rdoc/stats.rb
lib/rdoc/stats/normal.rb
lib/rdoc/stats/quiet.rb
lib/rdoc/stats/verbose.rb
lib/rdoc/task.rb
lib/rdoc/text.rb
lib/rdoc/token_stream.rb
Expand Down Expand Up @@ -142,7 +144,6 @@ test/test_rdoc_normal_module.rb
test/test_rdoc_options.rb
test/test_rdoc_parser.rb
test/test_rdoc_parser_c.rb
test/test_rdoc_parser_perl.rb
test/test_rdoc_parser_ruby.rb
test/test_rdoc_parser_simple.rb
test/test_rdoc_rdoc.rb
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Hoe.spec 'rdoc' do
self.remote_rdoc_dir = ''
self.testlib = :minitest

extra_dev_deps << ['minitest', '~> 1.3']
extra_dev_deps << ['minitest', '~> 2']
extra_rdoc_files << 'Rakefile'
spec_extras['required_rubygems_version'] = '>= 1.3'
spec_extras['homepage'] = 'http://rdoc.rubyforge.org'
Expand Down
2 changes: 1 addition & 1 deletion lib/rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def self.const_missing const_name # :nodoc:
##
# RDoc version you are using

VERSION = '2.6'
VERSION = '3.0.1'

##
# Method visibilities
Expand Down
1 change: 1 addition & 0 deletions lib/rdoc/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ def full_name

def fully_documented?
documented? and
attributes.all? { |a| a.documented? } and
method_list.all? { |m| m.documented? } and
constants.all? { |c| c.documented? }
end
Expand Down
9 changes: 8 additions & 1 deletion lib/rdoc/erbio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
# To use:
#
# erbio = RDoc::ERBIO.new '<%= "hello world" %>', nil, nil, 'io'
# erbio = RDoc::ERBIO.new '<%= "hello world" %>', nil, nil
#
# open 'hello.txt', 'w' do |io|
# erbio.result binding
Expand All @@ -16,6 +16,13 @@

class RDoc::ERBIO < ERB

##
# Defaults +eoutvar+ to 'io', otherwise is identical to ERB's initialize

def initialize str, safe_level = nil, trim_mode = nil, eoutvar = 'io'
super
end

##
# Instructs +compiler+ how to write to +io_variable+

Expand Down
3 changes: 3 additions & 0 deletions lib/rdoc/gauntlet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

class RDoc::Gauntlet < Gauntlet

##
# Runs an RDoc generator for gem +name+

def run name
return if self.data.key? name

Expand Down
71 changes: 35 additions & 36 deletions lib/rdoc/generator/darkfish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,38 +53,15 @@ class RDoc::Generator::Darkfish

include ERB::Util

##
# Subversion rev

SVNRev = %$Rev: 52 $

##
# Subversion ID

SVNId = %$Id: darkfish.rb 52 2009-01-07 02:08:11Z deveiant $

# Path to this file's parent directory. Used to find templates and other
# resources.

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

##
# Release Version

VERSION = '1.1.6'

# Directory where generated classes live relative to the root

CLASS_DIR = nil

# Directory where generated files live relative to the root

FILE_DIR = nil

# Standard generator factory method

def self.for options
new options
end
VERSION = '2'

##
# Initialize a few instance variables before we start
Expand All @@ -93,6 +70,7 @@ def initialize options
@options = options

@template_dir = Pathname.new options.template_dir
@template_cache = {}

@files = nil
@classes = nil
Expand All @@ -113,12 +91,20 @@ def debug_msg *msg
$stderr.puts(*msg)
end

##
# Directory where generated class HTML files live relative to the output
# dir.

def class_dir
CLASS_DIR
nil
end

##
# Directory where generated class HTML files live relative to the output
# dir.

def file_dir
FILE_DIR
nil
end

##
Expand Down Expand Up @@ -229,9 +215,10 @@ def generate_class_files

@classes.each do |klass|
debug_msg " working on %s (%s)" % [klass.full_name, klass.path]
out_file = @outputdir + klass.path
rel_prefix = @outputdir.relative_path_from out_file.dirname
svninfo = self.get_svninfo klass
out_file = @outputdir + klass.path
# suppress 1.9.3 warning
rel_prefix = rel_prefix = @outputdir.relative_path_from(out_file.dirname)
svninfo = svninfo = self.get_svninfo(klass)

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

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

def render_template template_file, out_file # :yield: io
template_src = template_file.read
template = template_for template_file

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

template = RDoc::ERBIO.new template_src, nil, '<>', 'io'

context = yield io

template_result template, context, template_file
end
else
template = ERB.new template_src, nil, '<>'

context = yield nil

output = template_result template, context, template_file
Expand All @@ -359,5 +343,20 @@ def template_result template, context, template_file
], e.backtrace
end

##
# Retrieves a cache template for +file+, if present, or fills the cache.

def template_for file
template = @template_cache[file]

return template if template

klass = @options.dry_run ? ERB : RDoc::ERBIO

template = klass.new file.read, nil, '<>'
@template_cache[file] = template
template
end

end

4 changes: 0 additions & 4 deletions lib/rdoc/generator/ri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ class RDoc::Generator::RI

RDoc::RDoc.add_generator self

def self.for options
new options
end

##
# Set up a new ri generator

Expand Down
3 changes: 3 additions & 0 deletions lib/rdoc/markup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@

class RDoc::Markup

##
# An AttributeManager which handles inline markup.

attr_reader :attribute_manager

##
Expand Down
7 changes: 5 additions & 2 deletions lib/rdoc/markup/attribute_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ class RDoc::Markup::AttributeManager
# optimistic
#++

A_PROTECT = 004 # :nodoc:
A_PROTECT = 004 # :nodoc:

PROTECT_ATTR = A_PROTECT.chr # :nodoc:
##
# Special mask character to prevent inline markup handling

PROTECT_ATTR = A_PROTECT.chr # :nodoc:

##
# This maps delimiters that occur around words (such as *bold* or +tt+)
Expand Down
Loading

0 comments on commit 1a81a2d

Please sign in to comment.