rdoc 2.5 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rdoc might be problematic. Click here for more details.

Files changed (56) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.autotest +1 -1
  3. data/History.txt +41 -8
  4. data/Manifest.txt +1 -0
  5. data/lib/rdoc.rb +7 -7
  6. data/lib/rdoc/any_method.rb +24 -8
  7. data/lib/rdoc/attr.rb +13 -0
  8. data/lib/rdoc/class_module.rb +5 -3
  9. data/lib/rdoc/code_object.rb +0 -19
  10. data/lib/rdoc/generator/darkfish.rb +44 -42
  11. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +5 -5
  12. data/lib/rdoc/generator/template/darkfish/js/quicksearch.js +7 -7
  13. data/lib/rdoc/generator/template/darkfish/rdoc.css +2 -2
  14. data/lib/rdoc/markup.rb +7 -7
  15. data/lib/rdoc/markup/parser.rb +1 -1
  16. data/lib/rdoc/markup/preprocess.rb +1 -1
  17. data/lib/rdoc/markup/to_html.rb +1 -1
  18. data/lib/rdoc/options.rb +1 -1
  19. data/lib/rdoc/parser.rb +5 -5
  20. data/lib/rdoc/parser/c.rb +54 -17
  21. data/lib/rdoc/parser/perl.rb +8 -8
  22. data/lib/rdoc/parser/ruby.rb +24 -29
  23. data/lib/rdoc/rdoc.rb +30 -18
  24. data/lib/rdoc/ri/driver.rb +7 -15
  25. data/lib/rdoc/ri/paths.rb +1 -2
  26. data/lib/rdoc/ruby_lex.rb +12 -12
  27. data/lib/rdoc/ruby_token.rb +4 -4
  28. data/lib/rdoc/stats.rb +2 -2
  29. data/lib/rdoc/task.rb +9 -5
  30. data/test/test.txt +1 -0
  31. data/test/test_rdoc_any_method.rb +50 -8
  32. data/test/test_rdoc_attr.rb +8 -0
  33. data/test/test_rdoc_class_module.rb +1 -1
  34. data/test/test_rdoc_code_object.rb +2 -2
  35. data/test/test_rdoc_constant.rb +1 -1
  36. data/test/test_rdoc_context.rb +2 -2
  37. data/test/test_rdoc_include.rb +1 -1
  38. data/test/test_rdoc_markup_parser.rb +18 -0
  39. data/test/test_rdoc_markup_to_ansi.rb +1 -1
  40. data/test/test_rdoc_markup_to_html_crossref.rb +1 -1
  41. data/test/test_rdoc_markup_to_rdoc.rb +1 -1
  42. data/test/test_rdoc_normal_class.rb +1 -1
  43. data/test/test_rdoc_normal_module.rb +1 -1
  44. data/test/test_rdoc_parser.rb +2 -6
  45. data/test/test_rdoc_parser_c.rb +20 -0
  46. data/test/test_rdoc_parser_ruby.rb +1 -1
  47. data/test/test_rdoc_rdoc.rb +2 -2
  48. data/test/test_rdoc_require.rb +1 -1
  49. data/test/test_rdoc_ri_driver.rb +27 -6
  50. data/test/test_rdoc_ri_paths.rb +10 -6
  51. data/test/test_rdoc_task.rb +9 -9
  52. data/test/test_rdoc_top_level.rb +1 -1
  53. data/test/xref_data.rb +1 -1
  54. data/test/xref_test_case.rb +1 -1
  55. metadata +4 -2
  56. metadata.gz.sig +0 -0
@@ -1,6 +1,6 @@
1
1
  require 'rubygems'
2
- require 'minitest/unit'
3
- require 'test/xref_test_case'
2
+ require 'minitest/autorun'
3
+ require File.expand_path '../xref_test_case', __FILE__
4
4
 
5
5
  class TestRDocContext < XrefTestCase
6
6
 
@@ -1,4 +1,4 @@
1
- require 'test/xref_test_case'
1
+ require File.expand_path '../xref_test_case', __FILE__
2
2
 
3
3
  class TestRDocInclude < XrefTestCase
4
4
 
@@ -1004,6 +1004,24 @@ the time
1004
1004
  assert_equal expected, @RMP.tokenize(str)
1005
1005
  end
1006
1006
 
1007
+ def test_tokenize_heading_no_space
1008
+ str = <<-STR
1009
+ =Heading
1010
+ ==Heading 2
1011
+ STR
1012
+
1013
+ expected = [
1014
+ [:HEADER, 1, 0, 0],
1015
+ [:TEXT, 'Heading', 1, 0],
1016
+ [:NEWLINE, "\n", 8, 0],
1017
+ [:HEADER, 2, 0, 1],
1018
+ [:TEXT, 'Heading 2', 2, 1],
1019
+ [:NEWLINE, "\n", 11, 1],
1020
+ ]
1021
+
1022
+ assert_equal expected, @RMP.tokenize(str)
1023
+ end
1024
+
1007
1025
  def test_tokenize_label
1008
1026
  str = <<-STR
1009
1027
  [cat] l1
@@ -9,7 +9,7 @@ class TestRDocMarkupToAnsi < RDoc::Markup::FormatterTestCase
9
9
 
10
10
  def setup
11
11
  super
12
-
12
+
13
13
  @to = RDoc::Markup::ToAnsi.new
14
14
  end
15
15
 
@@ -3,7 +3,7 @@ require 'minitest/autorun'
3
3
  require 'rdoc/rdoc'
4
4
  require 'rdoc/code_objects'
5
5
  require 'rdoc/markup/to_html_crossref'
6
- require 'test/xref_test_case'
6
+ require File.expand_path '../xref_test_case', __FILE__
7
7
 
8
8
  class TestRDocMarkupToHtmlCrossref < XrefTestCase
9
9
 
@@ -9,7 +9,7 @@ class TestRDocMarkupToRdoc < RDoc::Markup::FormatterTestCase
9
9
 
10
10
  def setup
11
11
  super
12
-
12
+
13
13
  @to = RDoc::Markup::ToRdoc.new
14
14
  end
15
15
 
@@ -1,4 +1,4 @@
1
- require 'test/xref_test_case'
1
+ require File.expand_path '../xref_test_case', __FILE__
2
2
 
3
3
  class TestRDocNormalClass < XrefTestCase
4
4
 
@@ -1,4 +1,4 @@
1
- require 'test/xref_test_case'
1
+ require File.expand_path '../xref_test_case', __FILE__
2
2
 
3
3
  class TestRDocNormalModule < XrefTestCase
4
4
 
@@ -45,13 +45,9 @@ class TestRDocParser < MiniTest::Unit::TestCase
45
45
  def test_class_can_parse
46
46
  assert_equal @RP.can_parse(__FILE__), @RP::Ruby
47
47
 
48
- readme_file_name = File.expand_path '../README.txt', __FILE__
48
+ readme_file_name = File.expand_path '../test.txt', __FILE__
49
49
 
50
- unless File.exist? readme_file_name then # HACK for tests in trunk :/
51
- readme_file_name = File.expand_path '../../README.txt', __FILE__
52
- end
53
-
54
- assert_equal @RP.can_parse(readme_file_name), @RP::Simple
50
+ assert_equal @RP::Simple, @RP.can_parse(readme_file_name)
55
51
 
56
52
  assert_nil @RP.can_parse(@binary_dat)
57
53
 
@@ -201,6 +201,26 @@ Multiline comment goes here because this comment spans multiple lines.
201
201
  assert constants.empty?, constants.inspect
202
202
  end
203
203
 
204
+ def test_find_class_comment_include
205
+ @options.rdoc_include << File.dirname(__FILE__)
206
+
207
+ content = <<-EOF
208
+ /*
209
+ * a comment for class Foo
210
+ *
211
+ * :include: test.txt
212
+ */
213
+ void
214
+ Init_Foo(void) {
215
+ VALUE foo = rb_define_class("Foo", rb_cObject);
216
+ }
217
+ EOF
218
+
219
+ klass = util_get_class content, 'foo'
220
+
221
+ assert_equal "a comment for class Foo\n\ntest file", klass.comment
222
+ end
223
+
204
224
  def test_find_class_comment_init
205
225
  content = <<-EOF
206
226
  /*
@@ -1240,7 +1240,7 @@ end
1240
1240
  util_parser 'class A; B = "#{c}"; end'
1241
1241
 
1242
1242
  while tk = @parser.get_tk do last_tk = tk end
1243
-
1243
+
1244
1244
  assert_equal "\n", last_tk.text
1245
1245
  end
1246
1246
 
@@ -15,8 +15,8 @@ class TestRDocRDoc < MiniTest::Unit::TestCase
15
15
  end
16
16
 
17
17
  def test_gather_files
18
- assert_equal(%w[lib/rdoc.rb],
19
- @rdoc.gather_files(%w[lib/rdoc.rb lib/rdoc.rb]))
18
+ file = File.expand_path __FILE__
19
+ assert_equal [file], @rdoc.gather_files([file, file])
20
20
  end
21
21
 
22
22
  def test_read_file_contents
@@ -1,4 +1,4 @@
1
- require 'test/xref_test_case'
1
+ require File.expand_path '../xref_test_case', __FILE__
2
2
 
3
3
  class TestRDocRequire < XrefTestCase
4
4
 
@@ -34,6 +34,15 @@ class TestRDocRIDriver < MiniTest::Unit::TestCase
34
34
  FileUtils.rm_rf @tmpdir
35
35
  end
36
36
 
37
+ DUMMY_PAGER = ":;\n"
38
+
39
+ def with_dummy_pager
40
+ pager_env, ENV['RI_PAGER'] = ENV['RI_PAGER'], DUMMY_PAGER
41
+ yield
42
+ ensure
43
+ ENV['RI_PAGER'] = pager_env
44
+ end
45
+
37
46
  def mu_pp(obj)
38
47
  s = ''
39
48
  s = PP.pp obj, s
@@ -357,7 +366,6 @@ class TestRDocRIDriver < MiniTest::Unit::TestCase
357
366
  assert_match %r%Foo::Bar#blah%, out
358
367
  assert_match %r%blah.5%, out
359
368
  assert_match %r%blah.6%, out
360
- assert_match %r%yields: stuff%, out
361
369
  end
362
370
 
363
371
  def test_display_method_attribute
@@ -416,6 +424,16 @@ Foo::Bar#bother
416
424
  assert_equal expected, out
417
425
  end
418
426
 
427
+ def test_display_method_params
428
+ util_store
429
+
430
+ out, err = capture_io do
431
+ @driver.display_method 'Foo::Bar#bother'
432
+ end
433
+
434
+ assert_match %r%things.*stuff%, out
435
+ end
436
+
419
437
  def test_expand_class
420
438
  util_store
421
439
 
@@ -558,10 +576,12 @@ Foo::Bar#bother
558
576
  def test_page
559
577
  @driver.use_stdout = false
560
578
 
561
- @driver.page do |io|
562
- skip "couldn't find a standard pager" if io == $stdout
579
+ with_dummy_pager do
580
+ @driver.page do |io|
581
+ skip "couldn't find a standard pager" if io == $stdout
563
582
 
564
- assert @driver.paging?
583
+ assert @driver.paging?
584
+ end
565
585
  end
566
586
 
567
587
  refute @driver.paging?
@@ -664,7 +684,7 @@ Foo::Bar#bother
664
684
  def test_setup_pager
665
685
  @driver.use_stdout = false
666
686
 
667
- pager = @driver.setup_pager
687
+ pager = with_dummy_pager do @driver.setup_pager end
668
688
 
669
689
  skip "couldn't find a standard pager" unless pager
670
690
 
@@ -765,9 +785,10 @@ Foo::Bar#bother
765
785
 
766
786
  @blah = RDoc::AnyMethod.new nil, 'blah'
767
787
  @blah.call_seq = "blah(5) => 5\nblah(6) => 6\n"
768
- @blah.block_params = "stuff"
769
788
 
770
789
  @bother = RDoc::AnyMethod.new nil, 'bother'
790
+ @bother.params = "(things)"
791
+ @bother.block_params = "stuff"
771
792
 
772
793
  @new = RDoc::AnyMethod.new nil, 'new'
773
794
  @new.singleton = true
@@ -6,6 +6,14 @@ require 'rdoc/ri/paths'
6
6
 
7
7
  class TestRDocRIPaths < MiniTest::Unit::TestCase
8
8
 
9
+ def setup
10
+ RDoc::RI::Paths.instance_variable_set :@gemdirs, %w[/nonexistent/gemdir]
11
+ end
12
+
13
+ def teardown
14
+ RDoc::RI::Paths.instance_variable_set :@gemdirs, nil
15
+ end
16
+
9
17
  def test_class_path_nonexistent
10
18
  path = RDoc::RI::Paths.path true, true, true, true, '/nonexistent'
11
19
 
@@ -18,9 +26,7 @@ class TestRDocRIPaths < MiniTest::Unit::TestCase
18
26
  assert_equal RDoc::RI::Paths::SYSDIR, path.shift
19
27
  assert_equal RDoc::RI::Paths::SITEDIR, path.shift
20
28
  assert_equal RDoc::RI::Paths::HOMEDIR, path.shift
21
-
22
- refute_empty path
23
- assert_kind_of String, path.first
29
+ assert_equal '/nonexistent/gemdir', path.shift
24
30
  end
25
31
 
26
32
  def test_class_raw_path_extra_dirs
@@ -30,9 +36,7 @@ class TestRDocRIPaths < MiniTest::Unit::TestCase
30
36
  assert_equal RDoc::RI::Paths::SYSDIR, path.shift
31
37
  assert_equal RDoc::RI::Paths::SITEDIR, path.shift
32
38
  assert_equal RDoc::RI::Paths::HOMEDIR, path.shift
33
-
34
- refute_empty path
35
- assert_kind_of String, path.first
39
+ assert_equal '/nonexistent/gemdir', path.shift
36
40
  end
37
41
 
38
42
  end
@@ -3,18 +3,18 @@ require 'minitest/autorun'
3
3
  require 'rdoc/task'
4
4
 
5
5
  class TestRDocTask < MiniTest::Unit::TestCase
6
-
6
+
7
7
  def setup
8
8
  Rake::Task.clear
9
9
  end
10
-
10
+
11
11
  def test_tasks_creation
12
12
  RDoc::Task.new
13
13
  assert Rake::Task[:rdoc]
14
14
  assert Rake::Task[:clobber_rdoc]
15
15
  assert Rake::Task[:rerdoc]
16
16
  end
17
-
17
+
18
18
  def test_tasks_creation_with_custom_name_symbol
19
19
  rd = RDoc::Task.new(:rdoc_dev)
20
20
  assert Rake::Task[:rdoc_dev]
@@ -22,7 +22,7 @@ class TestRDocTask < MiniTest::Unit::TestCase
22
22
  assert Rake::Task[:rerdoc_dev]
23
23
  assert_equal :rdoc_dev, rd.name
24
24
  end
25
-
25
+
26
26
  def test_tasks_creation_with_custom_name_string
27
27
  rd = RDoc::Task.new("rdoc_dev")
28
28
  assert Rake::Task[:rdoc_dev]
@@ -30,7 +30,7 @@ class TestRDocTask < MiniTest::Unit::TestCase
30
30
  assert Rake::Task[:rerdoc_dev]
31
31
  assert_equal "rdoc_dev", rd.name
32
32
  end
33
-
33
+
34
34
  def test_tasks_creation_with_custom_name_hash
35
35
  options = { :rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:force" }
36
36
  rd = RDoc::Task.new(options)
@@ -40,25 +40,25 @@ class TestRDocTask < MiniTest::Unit::TestCase
40
40
  assert_raises(RuntimeError) { Rake::Task[:clobber_rdoc] }
41
41
  assert_equal options, rd.name
42
42
  end
43
-
43
+
44
44
  def test_tasks_creation_with_custom_name_hash_will_use_default_if_an_option_isnt_given
45
45
  rd = RDoc::Task.new(:clobber_rdoc => "rdoc:clean")
46
46
  assert Rake::Task[:rdoc]
47
47
  assert Rake::Task[:"rdoc:clean"]
48
48
  assert Rake::Task[:rerdoc]
49
49
  end
50
-
50
+
51
51
  def test_tasks_creation_with_custom_name_hash_raises_exception_if_invalid_option_given
52
52
  assert_raises(ArgumentError) do
53
53
  RDoc::Task.new(:foo => "bar")
54
54
  end
55
-
55
+
56
56
  begin
57
57
  RDoc::Task.new(:foo => "bar")
58
58
  rescue ArgumentError => e
59
59
  assert_match(/foo/, e.message)
60
60
  end
61
61
  end
62
-
62
+
63
63
  end
64
64
 
@@ -1,6 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'minitest/autorun'
3
- require 'test/xref_test_case'
3
+ require File.expand_path '../xref_test_case', __FILE__
4
4
 
5
5
  class TestRDocTopLevel < XrefTestCase
6
6
 
@@ -11,7 +11,7 @@ class C1
11
11
  def self.m
12
12
  end
13
13
 
14
- def m
14
+ def m foo
15
15
  end
16
16
  end
17
17
 
@@ -7,7 +7,7 @@ require 'rdoc/stats'
7
7
  require 'rdoc/options'
8
8
  require 'rdoc/code_objects'
9
9
  require 'rdoc/parser/ruby'
10
- require 'test/xref_data'
10
+ require File.expand_path '../xref_data', __FILE__
11
11
 
12
12
  class XrefTestCase < MiniTest::Unit::TestCase
13
13
 
metadata CHANGED
@@ -5,7 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 5
8
- version: "2.5"
8
+ - 1
9
+ version: 2.5.1
9
10
  platform: ruby
10
11
  authors:
11
12
  - Eric Hodel
@@ -37,7 +38,7 @@ cert_chain:
37
38
  x52qPcexcYZR7w==
38
39
  -----END CERTIFICATE-----
39
40
 
40
- date: 2010-03-31 00:00:00 -07:00
41
+ date: 2010-04-06 00:00:00 -07:00
41
42
  default_executable:
42
43
  dependencies:
43
44
  - !ruby/object:Gem::Dependency
@@ -229,6 +230,7 @@ files:
229
230
  - test/hidden.zip.txt
230
231
  - test/test.ja.rdoc
231
232
  - test/test.ja.txt
233
+ - test/test.txt
232
234
  - test/test_attribute_manager.rb
233
235
  - test/test_rdoc_any_method.rb
234
236
  - test/test_rdoc_attr.rb
metadata.gz.sig CHANGED
Binary file