mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Import RDoc 2.2.2 r192
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
da6300e8f8
commit
7222e82a8b
22 changed files with 115 additions and 54 deletions
|
@ -1,3 +1,7 @@
|
|||
Sat Oct 25 07:42:49 2008 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/rdoc*: Update to RDoc 2.2.2 r192.
|
||||
|
||||
Sat Oct 25 04:00:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* enc/us_ascii.c (us_ascii_mbc_enc_len): made static. a patch by
|
||||
|
|
|
@ -372,7 +372,7 @@ module RDoc
|
|||
##
|
||||
# RDoc version you are using
|
||||
|
||||
VERSION = "2.2.1"
|
||||
VERSION = "2.2.2"
|
||||
|
||||
##
|
||||
# Name of the dotfile that contains the description of files to be processed
|
||||
|
|
|
@ -68,7 +68,12 @@ class RDoc::Parser
|
|||
|
||||
def self.binary?(file)
|
||||
s = (File.read(file, File.stat(file).blksize) || "").split(//)
|
||||
((s.size - s.grep(" ".."~").size) / s.size.to_f) > 0.30
|
||||
|
||||
if s.size > 0 then
|
||||
((s.size - s.grep(" ".."~").size) / s.size.to_f) > 0.30
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
private_class_method :binary?
|
||||
|
||||
|
@ -106,6 +111,13 @@ class RDoc::Parser
|
|||
|
||||
parser = can_parse file_name
|
||||
|
||||
#
|
||||
# This method must return a parser.
|
||||
#
|
||||
if !parser then
|
||||
parser = RDoc::Parser::Simple
|
||||
end
|
||||
|
||||
parser.new top_level, file_name, body, options, stats
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
require 'rdoc/parser'
|
||||
require 'rdoc/parser/ruby'
|
||||
require 'rdoc/known_classes'
|
||||
|
||||
##
|
||||
|
|
|
@ -5,8 +5,8 @@ require 'rdoc/ri'
|
|||
begin
|
||||
require('readline')
|
||||
require('abbrev')
|
||||
CAN_USE_READLINE = true
|
||||
rescue
|
||||
CAN_USE_READLINE = true # HACK use an RDoc namespace constant
|
||||
rescue LoadError
|
||||
CAN_USE_READLINE = false
|
||||
end
|
||||
|
||||
|
@ -53,7 +53,7 @@ class RDoc::RI::DefaultDisplay
|
|||
|
||||
def display_class_info(klass)
|
||||
page do
|
||||
superclass = klass.superclass_string
|
||||
superclass = klass.superclass
|
||||
|
||||
if superclass
|
||||
superclass = " < " + superclass
|
||||
|
@ -217,7 +217,7 @@ class RDoc::RI::DefaultDisplay
|
|||
end
|
||||
method_names.sort!
|
||||
|
||||
@formatter.wrap method_names.join(',')
|
||||
@formatter.wrap method_names.join(', ')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -390,4 +390,3 @@ class RDoc::RI::DefaultDisplay
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -28,15 +28,13 @@ module RDoc::RI::Paths
|
|||
|
||||
VERSION = RbConfig::CONFIG['ruby_version']
|
||||
|
||||
ri = RbConfig::CONFIG['RUBY_INSTALL_NAME'].sub(/ruby/, 'ri')
|
||||
base = File.join(RbConfig::CONFIG['datadir'], ri, VERSION)
|
||||
base = File.join(RbConfig::CONFIG['datadir'], "ri", VERSION)
|
||||
SYSDIR = File.join(base, "system")
|
||||
SITEDIR = File.join(base, "site")
|
||||
homedir = ENV['HOME'] || ENV['USERPROFILE'] || ENV['HOMEPATH']
|
||||
|
||||
if homedir then
|
||||
rdoc = RbConfig::CONFIG['RUBY_INSTALL_NAME'].sub(/ruby/, 'rdoc')
|
||||
HOMEDIR = File.join(homedir, ".#{rdoc}")
|
||||
HOMEDIR = File.join(homedir, ".rdoc")
|
||||
else
|
||||
HOMEDIR = nil
|
||||
end
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/markup/attribute_manager'
|
||||
|
||||
class TestAttributeManager < Test::Unit::TestCase
|
||||
class TestAttributeManager < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@am = RDoc::Markup::AttributeManager.new
|
||||
@klass = RDoc::Markup::AttributeManager
|
||||
end
|
||||
|
||||
|
||||
def teardown
|
||||
silently do
|
||||
silently do
|
||||
@klass.const_set(:MATCHING_WORD_PAIRS, {})
|
||||
@klass.const_set(:WORD_PAIR_MAP, {})
|
||||
@klass.const_set(:HTML_TAGS, {})
|
||||
|
@ -34,9 +35,9 @@ class TestAttributeManager < Test::Unit::TestCase
|
|||
assert_equal(4,word_pairs.size)
|
||||
assert(word_pairs.has_key?("x"))
|
||||
end
|
||||
|
||||
|
||||
def test_add_invalid_word_pair
|
||||
assert_raise ArgumentError do
|
||||
assert_raises ArgumentError do
|
||||
@am.add_word_pair("<", "<", :TEST)
|
||||
end
|
||||
end
|
||||
|
@ -71,3 +72,5 @@ class TestAttributeManager < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
require 'fileutils'
|
||||
require 'tmpdir'
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
|
||||
require 'rdoc/generator/texinfo'
|
||||
|
||||
# From chapter 18 of the Pickaxe 3rd ed. and the TexInfo manual.
|
||||
class TestRDocInfoFormatting < Test::Unit::TestCase
|
||||
class TestRDocInfoFormatting < MiniTest::Unit::TestCase
|
||||
def setup
|
||||
@output_dir = File.join Dir.tmpdir, "test_rdoc_info_formatting_#{$$}"
|
||||
@output_file = File.join @output_dir, 'rdoc.texinfo'
|
||||
|
@ -19,12 +20,13 @@ class TestRDocInfoFormatting < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def teardown
|
||||
FileUtils.rm_rf @output_dir
|
||||
# FileUtils.rm_rf @output_dir
|
||||
end
|
||||
|
||||
# Make sure tags like *this* do not make HTML
|
||||
def test_descriptions_are_not_html
|
||||
assert_no_match Regexp.new("\<b\>this\<\/b\>"), @text, "We had some HTML; icky!"
|
||||
refute_match Regexp.new("\<b\>this\<\/b\>"), @text,
|
||||
"We had some HTML; icky!"
|
||||
end
|
||||
|
||||
# Ensure we get a reasonable amount
|
||||
|
@ -173,3 +175,5 @@ Second outer item.
|
|||
assert string[regex] #, message
|
||||
end
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'fileutils'
|
||||
require 'tempfile'
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'tmpdir'
|
||||
|
||||
require 'rdoc/generator/texinfo'
|
||||
|
@ -9,7 +10,7 @@ require 'rdoc/generator/texinfo'
|
|||
class RDoc::Generator::TEXINFO; attr_reader :files, :classes; end
|
||||
class RDoc::RDoc; attr_reader :options; attr_reader :gen; end
|
||||
|
||||
class TestRDocInfoSections < Test::Unit::TestCase
|
||||
class TestRDocInfoSections < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@output_dir = File.join Dir.tmpdir, "test_rdoc_info_sections_#{$$}"
|
||||
|
@ -134,3 +135,5 @@ end
|
|||
DOC
|
||||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/markup'
|
||||
require 'rdoc/markup/to_test'
|
||||
|
||||
class TestRDocMarkup < Test::Unit::TestCase
|
||||
class TestRDocMarkup < MiniTest::Unit::TestCase
|
||||
|
||||
def basic_conv(str)
|
||||
sm = RDoc::Markup.new
|
||||
|
@ -611,3 +612,4 @@ class TestRDocMarkup < Test::Unit::TestCase
|
|||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
require "test/unit"
|
||||
require "rubygems"
|
||||
require "minitest/unit"
|
||||
require "rdoc/markup/inline"
|
||||
require "rdoc/markup/to_html_crossref"
|
||||
|
||||
class TestRDocMarkupAttributeManager < Test::Unit::TestCase
|
||||
class TestRDocMarkupAttributeManager < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@orig_special = RDoc::Markup::AttributeManager::SPECIAL
|
||||
|
@ -60,7 +61,7 @@ class TestRDocMarkupAttributeManager < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_add_word_pair_angle
|
||||
e = assert_raise ArgumentError do
|
||||
e = assert_raises ArgumentError do
|
||||
@am.add_word_pair '<', '>', 'angles'
|
||||
end
|
||||
|
||||
|
@ -229,3 +230,5 @@ class TestRDocMarkupAttributeManager < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/markup'
|
||||
require 'rdoc/markup/to_html'
|
||||
|
||||
class TestRDocMarkupToHtml < Test::Unit::TestCase
|
||||
class TestRDocMarkupToHtml < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@am = RDoc::Markup::AttributeManager.new
|
||||
|
@ -40,3 +41,5 @@ class TestRDocMarkupToHtml < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/generator'
|
||||
require 'rdoc/stats'
|
||||
require 'rdoc/code_objects'
|
||||
require 'rdoc/markup/to_html_crossref'
|
||||
require 'rdoc/parser/ruby'
|
||||
|
||||
require 'pathname'
|
||||
|
||||
class TestRDocMarkupToHtmlCrossref < Test::Unit::TestCase
|
||||
class TestRDocMarkupToHtmlCrossref < MiniTest::Unit::TestCase
|
||||
|
||||
#
|
||||
# This method parses a source file and returns a Hash mapping
|
||||
|
@ -286,3 +290,5 @@ class TestRDocMarkupToHtmlCrossref < Test::Unit::TestCase
|
|||
verify_class_crossref xref, "Ref_Class4", "Ref_Class4::Ref_Class4"
|
||||
end
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/parser'
|
||||
require 'rdoc/parser/ruby'
|
||||
|
||||
class TestRDocParser < Test::Unit::TestCase
|
||||
class TestRDocParser < MiniTest::Unit::TestCase
|
||||
def test_can_parse
|
||||
assert_equal(RDoc::Parser.can_parse(__FILE__), RDoc::Parser::Ruby)
|
||||
|
||||
readme_file_name = File.join(File.dirname(__FILE__), "..", "README.txt")
|
||||
|
||||
unless File.exist? readme_file_name then
|
||||
unless File.exist? readme_file_name then # HACK for tests in trunk :/
|
||||
readme_file_name = File.join File.dirname(__FILE__), '..', '..', 'README'
|
||||
end
|
||||
|
||||
|
@ -16,3 +19,5 @@ class TestRDocParser < Test::Unit::TestCase
|
|||
assert_equal(RDoc::Parser.can_parse(binary_file_name), nil)
|
||||
end
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
require 'stringio'
|
||||
require 'tempfile'
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/options'
|
||||
require 'rdoc/parser/c'
|
||||
|
||||
|
@ -10,7 +11,7 @@ class RDoc::Parser::C
|
|||
public :do_classes, :do_constants
|
||||
end
|
||||
|
||||
class TestRDocParserC < Test::Unit::TestCase
|
||||
class TestRDocParserC < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@tempfile = Tempfile.new self.class.name
|
||||
|
@ -283,3 +284,4 @@ Init_IO(void) {
|
|||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
require 'stringio'
|
||||
require 'tempfile'
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/options'
|
||||
require 'rdoc/parser/perl'
|
||||
|
||||
class TestRdocParserPerlPOD < Test::Unit::TestCase
|
||||
class TestRdocParserPerlPOD < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@tempfile = Tempfile.new self.class.name
|
||||
|
@ -70,3 +71,4 @@ This just contains plain old documentation
|
|||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
require 'stringio'
|
||||
require 'tempfile'
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
|
||||
require 'rdoc/options'
|
||||
require 'rdoc/parser/ruby'
|
||||
require 'rdoc/stats'
|
||||
|
||||
class TestRDocParserRuby < Test::Unit::TestCase
|
||||
class TestRDocParserRuby < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@tempfile = Tempfile.new self.class.name
|
||||
|
@ -747,3 +748,4 @@ EOF
|
|||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
require 'stringio'
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/ri/formatter'
|
||||
|
||||
class TestRDocRIAttributeFormatter < Test::Unit::TestCase
|
||||
class TestRDocRIAttributeFormatter < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@output = StringIO.new
|
||||
|
@ -40,3 +41,4 @@ class TestRDocRIAttributeFormatter < Test::Unit::TestCase
|
|||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
require 'stringio'
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/ri/formatter'
|
||||
require 'rdoc/ri/display'
|
||||
require 'rdoc/ri/driver'
|
||||
|
||||
class TestRDocRiDefaultDisplay < Test::Unit::TestCase
|
||||
class TestRDocRiDefaultDisplay < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@output = StringIO.new
|
||||
|
@ -52,11 +53,12 @@ class TestRDocRiDefaultDisplay < Test::Unit::TestCase
|
|||
'includes' => [],
|
||||
'instance_methods' => [
|
||||
{ 'name' => 'instance_method' },
|
||||
{ 'name' => 'instance_method2' },
|
||||
],
|
||||
'instance_method_extensions' => [
|
||||
{ 'name' => 'instance_method_extension' },
|
||||
],
|
||||
'superclass_string' => 'Object'
|
||||
'superclass' => 'Object'
|
||||
|
||||
@dd.display_class_info klass
|
||||
|
||||
|
@ -100,7 +102,7 @@ Class method extensions:
|
|||
Instance methods:
|
||||
-----------------
|
||||
|
||||
instance_method
|
||||
instance_method, instance_method2
|
||||
|
||||
|
||||
Instance method extensions:
|
||||
|
@ -295,3 +297,5 @@ install an additional package, or ask the packager to enable ri generation.
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'tmpdir'
|
||||
require 'rdoc/ri/driver'
|
||||
|
||||
class TestRDocRIDriver < Test::Unit::TestCase
|
||||
class TestRDocRIDriver < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@tmpdir = File.join Dir.tmpdir, "test_rdoc_ri_driver_#{$$}"
|
||||
|
@ -90,3 +91,4 @@ class TestRDocRIDriver < Test::Unit::TestCase
|
|||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
require 'stringio'
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/ri/formatter'
|
||||
require 'rdoc/markup/to_flow'
|
||||
|
||||
class TestRDocRIFormatter < Test::Unit::TestCase
|
||||
class TestRDocRIFormatter < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@output = StringIO.new
|
||||
|
@ -97,7 +98,7 @@ class TestRDocRIFormatter < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_display_flow_item_unknown
|
||||
e = assert_raise RDoc::Error do
|
||||
e = assert_raises RDoc::Error do
|
||||
@f.display_flow_item Object.new
|
||||
end
|
||||
|
||||
|
@ -189,7 +190,7 @@ class TestRDocRIFormatter < Test::Unit::TestCase
|
|||
list = RDoc::Markup::Flow::LIST.new :UNKNOWN
|
||||
list << RDoc::Markup::Flow::LI.new(nil, 'a b c')
|
||||
|
||||
e = assert_raise ArgumentError do
|
||||
e = assert_raises ArgumentError do
|
||||
@f.display_list list
|
||||
end
|
||||
|
||||
|
@ -316,3 +317,4 @@ class TestRDocRIFormatter < Test::Unit::TestCase
|
|||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
require 'stringio'
|
||||
require 'test/unit'
|
||||
require 'rubygems'
|
||||
require 'minitest/unit'
|
||||
require 'rdoc/ri/formatter'
|
||||
require 'rdoc/markup/fragments'
|
||||
require 'rdoc/markup/to_flow'
|
||||
|
||||
class TestRDocRIOverstrikeFormatter < Test::Unit::TestCase
|
||||
class TestRDocRIOverstrikeFormatter < MiniTest::Unit::TestCase
|
||||
|
||||
def setup
|
||||
@output = StringIO.new
|
||||
|
@ -67,3 +68,4 @@ class TestRDocRIOverstrikeFormatter < Test::Unit::TestCase
|
|||
|
||||
end
|
||||
|
||||
MiniTest::Unit.autorun
|
||||
|
|
Loading…
Reference in a new issue