rdoc 2.1.0 → 2.2.0

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 (57) hide show
  1. data/History.txt +82 -1
  2. data/Manifest.txt +8 -0
  3. data/README.txt +33 -9
  4. data/RI.txt +58 -0
  5. data/Rakefile +2 -0
  6. data/bin/ri +1 -2
  7. data/lib/rdoc.rb +154 -36
  8. data/lib/rdoc/code_objects.rb +38 -2
  9. data/lib/rdoc/diagram.rb +17 -15
  10. data/lib/rdoc/generator.rb +21 -15
  11. data/lib/rdoc/generator/chm/chm.rb +2 -0
  12. data/lib/rdoc/generator/html.rb +137 -89
  13. data/lib/rdoc/generator/html/common.rb +24 -0
  14. data/lib/rdoc/generator/html/frameless.rb +28 -731
  15. data/lib/rdoc/generator/html/hefss.rb +47 -311
  16. data/lib/rdoc/generator/html/html.rb +226 -156
  17. data/lib/rdoc/generator/html/kilmer.rb +31 -298
  18. data/lib/rdoc/generator/html/kilmerfactory.rb +427 -0
  19. data/lib/rdoc/generator/html/one_page_html.rb +6 -5
  20. data/lib/rdoc/generator/texinfo.rb +3 -6
  21. data/lib/rdoc/generator/xml.rb +4 -7
  22. data/lib/rdoc/generator/xml/xml.rb +21 -9
  23. data/lib/rdoc/markup.rb +0 -95
  24. data/lib/rdoc/markup/inline.rb +1 -1
  25. data/lib/rdoc/markup/to_html.rb +9 -6
  26. data/lib/rdoc/markup/to_html_crossref.rb +67 -21
  27. data/lib/rdoc/markup/to_texinfo.rb +1 -1
  28. data/lib/rdoc/parser.rb +22 -1
  29. data/lib/rdoc/parser/c.rb +14 -16
  30. data/lib/rdoc/parser/ruby.rb +3 -3
  31. data/lib/rdoc/parser/simple.rb +1 -1
  32. data/lib/rdoc/rdoc.rb +0 -1
  33. data/lib/rdoc/ri/cache.rb +5 -6
  34. data/lib/rdoc/ri/descriptions.rb +3 -0
  35. data/lib/rdoc/ri/display.rb +157 -37
  36. data/lib/rdoc/ri/driver.rb +314 -198
  37. data/lib/rdoc/ri/formatter.rb +1 -1
  38. data/lib/rdoc/ri/paths.rb +2 -11
  39. data/lib/rdoc/ri/reader.rb +3 -3
  40. data/lib/rdoc/ri/util.rb +0 -2
  41. data/test/binary.dat +0 -0
  42. data/test/rdoc_markup_to_html_crossref_reference.rb +31 -0
  43. data/test/test_attribute_manager.rb +73 -0
  44. data/test/test_rdoc_info_formatting.rb +6 -6
  45. data/test/test_rdoc_info_sections.rb +2 -2
  46. data/test/test_rdoc_markup_attribute_manager.rb +14 -14
  47. data/test/test_rdoc_markup_to_html.rb +15 -3
  48. data/test/test_rdoc_markup_to_html_crossref.rb +276 -7
  49. data/test/test_rdoc_parser.rb +13 -0
  50. data/test/test_rdoc_parser_c.rb +1 -1
  51. data/test/test_rdoc_parser_ruby.rb +72 -1
  52. data/test/test_rdoc_ri_default_display.rb +23 -22
  53. data/test/test_rdoc_ri_driver.rb +1 -1
  54. data/test/test_rdoc_ri_formatter.rb +1 -1
  55. metadata +27 -35
  56. data.tar.gz.sig +0 -1
  57. metadata.gz.sig +0 -0
@@ -0,0 +1,13 @@
1
+ require 'rdoc/parser'
2
+
3
+ class TestRDocParser < Test::Unit::TestCase
4
+ def test_can_parse
5
+ assert_equal(RDoc::Parser.can_parse(__FILE__), RDoc::Parser::Ruby)
6
+
7
+ readme_file_name = File.join(File.dirname(__FILE__), "..", "README.txt")
8
+ assert_equal(RDoc::Parser.can_parse(readme_file_name), RDoc::Parser::Simple)
9
+
10
+ binary_file_name = File.join(File.dirname(__FILE__), "binary.dat")
11
+ assert_equal(RDoc::Parser.can_parse(binary_file_name), nil)
12
+ end
13
+ end
@@ -10,7 +10,7 @@ class RDoc::Parser::C
10
10
  public :do_classes, :do_constants
11
11
  end
12
12
 
13
- class TestRdocParserC < Test::Unit::TestCase
13
+ class TestRDocParserC < Test::Unit::TestCase
14
14
 
15
15
  def setup
16
16
  @tempfile = Tempfile.new self.class.name
@@ -6,7 +6,7 @@ require 'rdoc/options'
6
6
  require 'rdoc/parser/ruby'
7
7
  require 'rdoc/stats'
8
8
 
9
- class TestRdocParserRuby < Test::Unit::TestCase
9
+ class TestRDocParserRuby < Test::Unit::TestCase
10
10
 
11
11
  def setup
12
12
  @tempfile = Tempfile.new self.class.name
@@ -158,6 +158,77 @@ class TestRdocParserRuby < Test::Unit::TestCase
158
158
  assert_equal 'Super', bar.superclass
159
159
  end
160
160
 
161
+ def test_parse_module
162
+ comment = "##\n# my module\n"
163
+
164
+ util_parser 'module Foo; end'
165
+
166
+ tk = @parser.get_tk
167
+
168
+ @parser.parse_module @top_level, RDoc::Parser::Ruby::NORMAL, tk, comment
169
+
170
+ foo = @top_level.modules.first
171
+ assert_equal 'Foo', foo.full_name
172
+ assert_equal comment, foo.comment
173
+ end
174
+
175
+ def test_parse_class_mistaken_for_module
176
+ #
177
+ # The code below is not strictly legal Ruby (Foo must have been defined
178
+ # before Foo::Bar is encountered), but RDoc might encounter Foo::Bar before
179
+ # Foo if they live in different files.
180
+ #
181
+ code = <<-EOF
182
+ class Foo::Bar
183
+ end
184
+
185
+ module Foo::Baz
186
+ end
187
+
188
+ class Foo
189
+ end
190
+ EOF
191
+
192
+ util_parser code
193
+
194
+ @parser.scan()
195
+
196
+ assert(@top_level.modules.empty?)
197
+ foo = @top_level.classes.first
198
+ assert_equal 'Foo', foo.full_name
199
+
200
+ bar = foo.classes.first
201
+ assert_equal 'Foo::Bar', bar.full_name
202
+
203
+ baz = foo.modules.first
204
+ assert_equal 'Foo::Baz', baz.full_name
205
+ end
206
+
207
+ def test_parse_module_relative_to_top_level_namespace
208
+ comment = <<-EOF
209
+ #
210
+ # Weirdly named module
211
+ #
212
+ EOF
213
+
214
+ code = comment + <<-EOF
215
+ module ::Foo
216
+ class Helper
217
+ end
218
+ end
219
+ EOF
220
+
221
+ util_parser code
222
+ @parser.scan()
223
+
224
+ foo = @top_level.modules.first
225
+ assert_equal 'Foo', foo.full_name
226
+ assert_equal comment, foo.comment
227
+
228
+ helper = foo.classes.first
229
+ assert_equal 'Foo::Helper', helper.full_name
230
+ end
231
+
161
232
  def test_parse_comment
162
233
  content = <<-EOF
163
234
  class Foo
@@ -4,7 +4,7 @@ require 'rdoc/ri/formatter'
4
4
  require 'rdoc/ri/display'
5
5
  require 'rdoc/ri/driver'
6
6
 
7
- class TestRdocRiDefaultDisplay < Test::Unit::TestCase
7
+ class TestRDocRiDefaultDisplay < Test::Unit::TestCase
8
8
 
9
9
  def setup
10
10
  @output = StringIO.new
@@ -27,7 +27,6 @@ class TestRdocRiDefaultDisplay < Test::Unit::TestCase
27
27
  end
28
28
 
29
29
  def test_display_class_info
30
- ri_reader = nil
31
30
  klass = h \
32
31
  'attributes' => [
33
32
  { 'name' => 'attribute', 'rw' => 'RW',
@@ -59,7 +58,7 @@ class TestRdocRiDefaultDisplay < Test::Unit::TestCase
59
58
  ],
60
59
  'superclass_string' => 'Object'
61
60
 
62
- @dd.display_class_info klass, ri_reader
61
+ @dd.display_class_info klass
63
62
 
64
63
  expected = <<-EOF
65
64
  ---------------------------------------------------- Class: SomeClass < Object
@@ -77,6 +76,15 @@ Constants:
77
76
  CONSTANT_NOCOMMENT
78
77
 
79
78
 
79
+ Attributes:
80
+ -----------
81
+
82
+ attribute (RW):
83
+ attribute comment
84
+
85
+ attribute_no_comment (RW)
86
+
87
+
80
88
  Class methods:
81
89
  --------------
82
90
 
@@ -99,15 +107,6 @@ Instance method extensions:
99
107
  ---------------------------
100
108
 
101
109
  instance_method_extension
102
-
103
-
104
- Attributes:
105
- -----------
106
-
107
- attribute (RW):
108
- attribute comment
109
-
110
- attribute_no_comment (RW)
111
110
  EOF
112
111
 
113
112
  assert_equal expected, @output.string
@@ -140,7 +139,7 @@ Attributes:
140
139
  -------------------------------------------------------- SomeClass#some_method
141
140
  some_method(arg1, arg2) {|block_param| ...}
142
141
 
143
- Extension from /nonexistent
142
+ From /nonexistent
144
143
  ------------------------------------------------------------------------------
145
144
  some comment
146
145
 
@@ -152,7 +151,7 @@ Attributes:
152
151
  end
153
152
 
154
153
  def test_display_method_info_singleton
155
- method = RDoc::RI::Driver::Hash.new.update \
154
+ method = RDoc::RI::Driver::OpenStructHash.new.update \
156
155
  'aliases' => [],
157
156
  'block_params' => nil,
158
157
  'comment' => nil,
@@ -167,6 +166,8 @@ Attributes:
167
166
  expected = <<-EOF
168
167
  ------------------------------------------------------- SomeClass::some_method
169
168
  SomeClass::some_method(arg1, arg2)
169
+
170
+ From
170
171
  ------------------------------------------------------------------------------
171
172
  [no description]
172
173
  EOF
@@ -176,7 +177,7 @@ Attributes:
176
177
 
177
178
  def test_display_method_list
178
179
  methods = [
179
- RDoc::RI::Driver::Hash.new.update(
180
+ RDoc::RI::Driver::OpenStructHash.new.update(
180
181
  "aliases" => [],
181
182
  "block_params" => nil,
182
183
  "comment" => nil,
@@ -186,7 +187,7 @@ Attributes:
186
187
  "params" => "()",
187
188
  "visibility" => "public"
188
189
  ),
189
- RDoc::RI::Driver::Hash.new.update(
190
+ RDoc::RI::Driver::OpenStructHash.new.update(
190
191
  "aliases" => [],
191
192
  "block_params" => nil,
192
193
  "comment" => nil,
@@ -204,7 +205,8 @@ Attributes:
204
205
  More than one method matched your request. You can refine your search by
205
206
  asking for information on one of:
206
207
 
207
- SomeClass#some_method, SomeClass#some_other_method
208
+ SomeClass#some_method []
209
+ SomeClass#some_other_method []
208
210
  EOF
209
211
 
210
212
  assert_equal expected, @output.string
@@ -216,7 +218,7 @@ Attributes:
216
218
  expected = <<-EOF
217
219
  some_method(arg1, arg2) {|block_param| ...}
218
220
 
219
- Extension from /nonexistent
221
+ From /nonexistent
220
222
  EOF
221
223
 
222
224
  assert_equal expected, @output.string
@@ -234,7 +236,7 @@ some_method(start, length)
234
236
  some_method(index)
235
237
  some_method(start, length)
236
238
 
237
- Extension from /nonexistent
239
+ From /nonexistent
238
240
  EOF
239
241
 
240
242
  assert_equal expected, @output.string
@@ -249,7 +251,7 @@ some_method(start, length)
249
251
  expected = <<-EOF
250
252
  SomeClass::some_method(arg1, arg2) {|block_param| ...}
251
253
 
252
- Extension from /nonexistent
254
+ From /nonexistent
253
255
  EOF
254
256
 
255
257
  assert_equal expected, @output.string
@@ -289,8 +291,7 @@ install an additional package, or ask the packager to enable ri generation.
289
291
  end
290
292
 
291
293
  def h(hash)
292
- RDoc::RI::Driver::Hash.convert hash
294
+ RDoc::RI::Driver::OpenStructHash.convert hash
293
295
  end
294
296
 
295
297
  end
296
-
@@ -14,7 +14,7 @@ class TestRDocRIDriver < Test::Unit::TestCase
14
14
  FileUtils.mkdir_p @home_ri
15
15
  FileUtils.mkdir_p @cache_dir
16
16
 
17
- @driver = RDoc::RI::Driver.new
17
+ @driver = RDoc::RI::Driver.new(RDoc::RI::Driver.process_args([]))
18
18
  @driver.homepath = @home_ri
19
19
  end
20
20
 
@@ -245,7 +245,7 @@ class TestRDocRIFormatter < Test::Unit::TestCase
245
245
  def test_raw_print_line
246
246
  @f.raw_print_line 'a b c'
247
247
 
248
- assert_equal "a b c\n", @output.string
248
+ assert_equal "a b c", @output.string
249
249
  end
250
250
 
251
251
  def test_strip_attributes_b
metadata CHANGED
@@ -1,38 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
8
8
  - Dave Thomas
9
9
  - Phil Hagelberg
10
+ - Tony Strauss
10
11
  autorequire:
11
12
  bindir: bin
12
- cert_chain:
13
- - |
14
- -----BEGIN CERTIFICATE-----
15
- MIIDNjCCAh6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBBMRAwDgYDVQQDDAdkcmJy
16
- YWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZFgNu
17
- ZXQwHhcNMDcxMjIxMDIwNDE0WhcNMDgxMjIwMDIwNDE0WjBBMRAwDgYDVQQDDAdk
18
- cmJyYWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZ
19
- FgNuZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbbgLrGLGIDE76
20
- LV/cvxdEzCuYuS3oG9PrSZnuDweySUfdp/so0cDq+j8bqy6OzZSw07gdjwFMSd6J
21
- U5ddZCVywn5nnAQ+Ui7jMW54CYt5/H6f2US6U0hQOjJR6cpfiymgxGdfyTiVcvTm
22
- Gj/okWrQl0NjYOYBpDi+9PPmaH2RmLJu0dB/NylsDnW5j6yN1BEI8MfJRR+HRKZY
23
- mUtgzBwF1V4KIZQ8EuL6I/nHVu07i6IkrpAgxpXUfdJQJi0oZAqXurAV3yTxkFwd
24
- g62YrrW26mDe+pZBzR6bpLE+PmXCzz7UxUq3AE0gPHbiMXie3EFE0oxnsU3lIduh
25
- sCANiQ8BAgMBAAGjOTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
26
- BBS5k4Z75VSpdM0AclG2UvzFA/VW5DANBgkqhkiG9w0BAQUFAAOCAQEAHagT4lfX
27
- kP/hDaiwGct7XPuVGbrOsKRVD59FF5kETBxEc9UQ1clKWngf8JoVuEoKD774dW19
28
- bU0GOVWO+J6FMmT/Cp7nuFJ79egMf/gy4gfUfQMuvfcr6DvZUPIs9P/TlK59iMYF
29
- DIOQ3DxdF3rMzztNUCizN4taVscEsjCcgW6WkUJnGdqlu3OHWpQxZBJkBTjPCoc6
30
- UW6on70SFPmAy/5Cq0OJNGEWBfgD9q7rrs/X8GGwUWqXb85RXnUVi/P8Up75E0ag
31
- 14jEc90kN+C7oI/AGCBN0j6JnEtYIEJZibjjDJTSMWlUKKkj30kq7hlUC2CepJ4v
32
- x52qPcexcYZR7w==
33
- -----END CERTIFICATE-----
13
+ cert_chain: []
34
14
 
35
- date: 2008-07-20 00:00:00 -07:00
15
+ date: 2008-09-19 00:00:00 -04:00
36
16
  default_executable:
37
17
  dependencies:
38
18
  - !ruby/object:Gem::Dependency
@@ -45,11 +25,12 @@ dependencies:
45
25
  - !ruby/object:Gem::Version
46
26
  version: 1.7.0
47
27
  version:
48
- description: RDoc is an application that produces documentation for one or more Ruby source files. RDoc includes the `rdoc` and `ri` tools for generating and displaying online documentation. At this point in time, RDoc 2.x is a work in progress and may incur further API changes beyond what has been made to the RDoc 1.0.1. Command-line tools are largely unaffected, but internal APIs may shift rapidly.
28
+ description: RDoc is an application that produces documentation for one or more Ruby source files. RDoc includes the +rdoc+ and +ri+ tools for generating and displaying online documentation. At this point in time, RDoc 2.x is a work in progress and may incur further API changes beyond what has been made to the RDoc 1.0.1. Command-line tools are largely unaffected, but internal APIs may shift rapidly. See RDoc for a description of RDoc's markup and basic use.
49
29
  email:
50
30
  - drbrain@segment7.net
51
31
  - ""
52
32
  - technomancy@gmail.com
33
+ - tony.strauss@designingpatterns.com
53
34
  executables:
54
35
  - rdoc
55
36
  - ri
@@ -59,11 +40,13 @@ extra_rdoc_files:
59
40
  - History.txt
60
41
  - Manifest.txt
61
42
  - README.txt
43
+ - RI.txt
62
44
  files:
63
45
  - History.txt
64
46
  - Manifest.txt
65
47
  - README.txt
66
48
  - Rakefile
49
+ - RI.txt
67
50
  - bin/rdoc
68
51
  - bin/ri
69
52
  - lib/rdoc.rb
@@ -74,10 +57,12 @@ files:
74
57
  - lib/rdoc/generator/chm.rb
75
58
  - lib/rdoc/generator/chm/chm.rb
76
59
  - lib/rdoc/generator/html.rb
60
+ - lib/rdoc/generator/html/common.rb
77
61
  - lib/rdoc/generator/html/frameless.rb
78
62
  - lib/rdoc/generator/html/hefss.rb
79
63
  - lib/rdoc/generator/html/html.rb
80
64
  - lib/rdoc/generator/html/kilmer.rb
65
+ - lib/rdoc/generator/html/kilmerfactory.rb
81
66
  - lib/rdoc/generator/html/one_page_html.rb
82
67
  - lib/rdoc/generator/ri.rb
83
68
  - lib/rdoc/generator/texinfo.rb
@@ -122,10 +107,15 @@ files:
122
107
  - lib/rdoc/stats.rb
123
108
  - lib/rdoc/template.rb
124
109
  - lib/rdoc/tokenstream.rb
110
+ - test/binary.dat
111
+ - test/rdoc_markup_to_html_crossref_reference.rb
125
112
  - test/test_rdoc_info_formatting.rb
126
113
  - test/test_rdoc_info_sections.rb
127
114
  - test/test_rdoc_markup.rb
128
115
  - test/test_rdoc_markup_attribute_manager.rb
116
+ - test/test_rdoc_markup_to_html.rb
117
+ - test/test_rdoc_markup_to_html_crossref.rb
118
+ - test/test_rdoc_parser.rb
129
119
  - test/test_rdoc_parser_c.rb
130
120
  - test/test_rdoc_parser_ruby.rb
131
121
  - test/test_rdoc_ri_attribute_formatter.rb
@@ -134,7 +124,7 @@ files:
134
124
  - test/test_rdoc_ri_formatter.rb
135
125
  - test/test_rdoc_ri_overstrike_formatter.rb
136
126
  has_rdoc: true
137
- homepage: http://rubyforge.org/projects/rdoc/
127
+ homepage: "Project Page: http://rubyforge.org/projects/rdoc/"
138
128
  post_install_message:
139
129
  rdoc_options:
140
130
  - --main
@@ -161,16 +151,18 @@ signing_key:
161
151
  specification_version: 2
162
152
  summary: RDoc is an application that produces documentation for one or more Ruby source files
163
153
  test_files:
164
- - test/test_rdoc_info_formatting.rb
165
- - test/test_rdoc_info_sections.rb
166
- - test/test_rdoc_markup.rb
167
- - test/test_rdoc_markup_attribute_manager.rb
154
+ - test/test_rdoc_parser.rb
168
155
  - test/test_rdoc_markup_to_html.rb
169
- - test/test_rdoc_markup_to_html_crossref.rb
170
- - test/test_rdoc_parser_c.rb
171
- - test/test_rdoc_parser_ruby.rb
172
- - test/test_rdoc_ri_attribute_formatter.rb
173
156
  - test/test_rdoc_ri_default_display.rb
174
- - test/test_rdoc_ri_driver.rb
157
+ - test/test_rdoc_markup_to_html_crossref.rb
158
+ - test/test_rdoc_info_sections.rb
175
159
  - test/test_rdoc_ri_formatter.rb
160
+ - test/test_rdoc_ri_driver.rb
161
+ - test/test_attribute_manager.rb
162
+ - test/test_rdoc_parser_ruby.rb
176
163
  - test/test_rdoc_ri_overstrike_formatter.rb
164
+ - test/test_rdoc_markup_attribute_manager.rb
165
+ - test/test_rdoc_info_formatting.rb
166
+ - test/test_rdoc_parser_c.rb
167
+ - test/test_rdoc_ri_attribute_formatter.rb
168
+ - test/test_rdoc_markup.rb
data.tar.gz.sig DELETED
@@ -1 +0,0 @@
1
- U�����5j�_Bf~M�]�h煆�_����-G}�tk��C�{�6)��6XGÆ���|�����KE��~þ{>�va���RV����B,�0JA��K w|ީ7�4�}�P��
metadata.gz.sig DELETED
Binary file