rdoc 2.5.10 → 2.5.11

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.

data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,11 @@
1
+ === 2.5.11 / 2010-08-20
2
+
3
+ * Minor Enhancements
4
+ * Alias comments are now discovered by the C parser. Reported by Jeremy
5
+ Evans.
6
+ * Removed --all option which is unused in RDoc. Use the nodoc or
7
+ stopdoc/startdoc directives to suppress documentation instead.
8
+
1
9
  === 2.5.10 / 2010-08-17
2
10
 
3
11
  * Minor Enhancements
@@ -383,7 +383,7 @@ module RDoc
383
383
  ##
384
384
  # RDoc version you are using
385
385
 
386
- VERSION = '2.5.10'
386
+ VERSION = '2.5.11'
387
387
 
388
388
  ##
389
389
  # Name of the dotfile that contains the description of files to be processed
@@ -58,11 +58,6 @@ class RDoc::Options
58
58
 
59
59
  attr_reader :rdoc_include
60
60
 
61
- ##
62
- # Include private and protected methods in the output?
63
-
64
- attr_accessor :show_all
65
-
66
61
  ##
67
62
  # Include the '#' at the front of hyperlinked instance method names
68
63
 
@@ -96,7 +91,6 @@ class RDoc::Options
96
91
  def initialize # :nodoc:
97
92
  require 'rdoc/rdoc'
98
93
  @op_dir = nil
99
- @show_all = false
100
94
  @main_page = nil
101
95
  @exclude = []
102
96
  @generators = RDoc::RDoc::GENERATORS
@@ -160,14 +154,6 @@ Usage: #{opt.program_name} [options] [names...]
160
154
  opt.separator "Parsing Options:"
161
155
  opt.separator nil
162
156
 
163
- opt.on("--all", "-a",
164
- "Include all methods (not just public) in",
165
- "the output.") do |value|
166
- @show_all = value
167
- end
168
-
169
- opt.separator nil
170
-
171
157
  opt.on("--exclude=PATTERN", "-x", Regexp,
172
158
  "Do not process files or directories",
173
159
  "matching PATTERN.") do |value|
@@ -136,6 +136,10 @@ class RDoc::Parser::C < RDoc::Parser
136
136
  al = RDoc::Alias.new '', old_name, new_name, ''
137
137
  al.singleton = @singleton_classes.key?(var_name)
138
138
 
139
+ comment = find_alias_comment var_name, new_name, old_name
140
+ comment = strip_stars comment
141
+ al.comment = comment
142
+
139
143
  class_obj.add_alias al
140
144
  @stats.add_alias al
141
145
  end
@@ -188,7 +192,7 @@ class RDoc::Parser::C < RDoc::Parser
188
192
  end
189
193
 
190
194
  def do_constants
191
- @content.scan(%r{\Wrb_define_
195
+ @content.scan(%r%\Wrb_define_
192
196
  ( variable |
193
197
  readonly_variable |
194
198
  const |
@@ -197,7 +201,7 @@ class RDoc::Parser::C < RDoc::Parser
197
201
  (?:\s*(\w+),)?
198
202
  \s*"(\w+)",
199
203
  \s*(.*?)\s*\)\s*;
200
- }xm) do |type, var_name, const_name, definition|
204
+ %xm) do |type, var_name, const_name, definition|
201
205
  var_name = "rb_cObject" if !var_name or var_name == "rb_mKernel"
202
206
  handle_constants type, var_name, const_name, definition
203
207
  end
@@ -218,7 +222,7 @@ class RDoc::Parser::C < RDoc::Parser
218
222
  end
219
223
 
220
224
  def do_methods
221
- @content.scan(%r{rb_define_
225
+ @content.scan(%r%rb_define_
222
226
  (
223
227
  singleton_method |
224
228
  method |
@@ -230,7 +234,7 @@ class RDoc::Parser::C < RDoc::Parser
230
234
  \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
231
235
  \s*(-?\w+)\s*\)
232
236
  (?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
233
- }xm) do
237
+ %xm) do
234
238
  |type, var_name, meth_name, meth_body, param_count, source_file|
235
239
 
236
240
  # Ignore top-object and weird struct.c dynamic stuff
@@ -244,44 +248,55 @@ class RDoc::Parser::C < RDoc::Parser
244
248
  source_file)
245
249
  end
246
250
 
247
- @content.scan(%r{rb_define_attr\(
251
+ @content.scan(%r%rb_define_attr\(
248
252
  \s*([\w\.]+),
249
253
  \s*"([^"]+)",
250
254
  \s*(\d+),
251
255
  \s*(\d+)\s*\);
252
- }xm) do |var_name, attr_name, attr_reader, attr_writer|
256
+ %xm) do |var_name, attr_name, attr_reader, attr_writer|
253
257
  #var_name = "rb_cObject" if var_name == "rb_mKernel"
254
258
  handle_attr(var_name, attr_name,
255
259
  attr_reader.to_i != 0,
256
260
  attr_writer.to_i != 0)
257
261
  end
258
262
 
259
- @content.scan(%r{rb_define_global_function\s*\(
263
+ @content.scan(%r%rb_define_global_function\s*\(
260
264
  \s*"([^"]+)",
261
265
  \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
262
266
  \s*(-?\w+)\s*\)
263
267
  (?:;\s*/[*/]\s+in\s+(\w+?\.[cy]))?
264
- }xm) do |meth_name, meth_body, param_count, source_file|
268
+ %xm) do |meth_name, meth_body, param_count, source_file|
265
269
  handle_method("method", "rb_mKernel", meth_name,
266
270
  meth_body, param_count, source_file)
267
271
  end
268
272
 
269
273
  @content.scan(/define_filetest_function\s*\(
270
- \s*"([^"]+)",
271
- \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
272
- \s*(-?\w+)\s*\)/xm) do
273
- |meth_name, meth_body, param_count|
274
+ \s*"([^"]+)",
275
+ \s*(?:RUBY_METHOD_FUNC\(|VALUEFUNC\()?(\w+)\)?,
276
+ \s*(-?\w+)\s*\)/xm) do |meth_name, meth_body, param_count|
274
277
 
275
278
  handle_method("method", "rb_mFileTest", meth_name, meth_body, param_count)
276
279
  handle_method("singleton_method", "rb_cFile", meth_name, meth_body, param_count)
277
280
  end
278
281
  end
279
282
 
283
+ def find_alias_comment(class_name, new_name, old_name)
284
+ if content =~ %r%((?>/\*.*?\*/\s+))
285
+ rb_define_alias\(\s*#{class_name}\s*,
286
+ \s*"#{new_name}"\s*,
287
+ \s*"#{old_name}"\s*\);%xm then
288
+ $1
289
+ else
290
+ ''
291
+ end
292
+ end
293
+
280
294
  def find_attr_comment(attr_name)
281
- if @content =~ %r{((?>/\*.*?\*/\s+))
282
- rb_define_attr\((?:\s*(\w+),)?\s*"#{attr_name}"\s*,.*?\)\s*;}xmi
295
+ if @content =~ %r%((?>/\*.*?\*/\s+))
296
+ rb_define_attr\((?:\s*(\w+),)?\s*
297
+ "#{attr_name}"\s*,.*?\)\s*;%xmi
283
298
  $1
284
- elsif @content =~ %r{Document-attr:\s#{attr_name}\s*?\n((?>.*?\*/))}m
299
+ elsif @content =~ %r%Document-attr:\s#{attr_name}\s*?\n((?>.*?\*/))%m
285
300
  $1
286
301
  else
287
302
  ''
@@ -293,8 +308,10 @@ class RDoc::Parser::C < RDoc::Parser
293
308
 
294
309
  def find_body(class_name, meth_name, meth_obj, body, quiet = false)
295
310
  case body
296
- when %r"((?>/\*.*?\*/\s*))((?:(?:static|SWIGINTERN)\s+)?(?:intern\s+)?VALUE\s+#{meth_name}
297
- \s*(\([^)]*\))([^;]|$))"xm
311
+ when %r%((?>/\*.*?\*/\s*))
312
+ ((?:(?:static|SWIGINTERN)\s+)?
313
+ (?:intern\s+)?VALUE\s+#{meth_name}
314
+ \s*(\([^)]*\))([^;]|$))%xm then
298
315
  comment = $1
299
316
  body_text = $2
300
317
  params = $3
@@ -323,7 +340,7 @@ class RDoc::Parser::C < RDoc::Parser
323
340
  tk.set_text body_text
324
341
  meth_obj.add_token tk
325
342
  meth_obj.comment = strip_stars comment
326
- when %r{((?>/\*.*?\*/\s*))^\s*(\#\s*define\s+#{meth_name}\s+(\w+))}m
343
+ when %r%((?>/\*.*?\*/\s*))^\s*(\#\s*define\s+#{meth_name}\s+(\w+))%m
327
344
  comment = $1
328
345
  body_text = $2
329
346
  find_body class_name, $3, meth_obj, body, true
@@ -334,7 +351,7 @@ class RDoc::Parser::C < RDoc::Parser
334
351
  tk.set_text body_text
335
352
  meth_obj.add_token tk
336
353
  meth_obj.comment = strip_stars(comment) + meth_obj.comment.to_s
337
- when %r{^\s*\#\s*define\s+#{meth_name}\s+(\w+)}m
354
+ when %r%^\s*\#\s*define\s+#{meth_name}\s+(\w+)%m
338
355
  unless find_body(class_name, $1, meth_obj, body, true)
339
356
  warn "No definition for #{meth_name}" unless @options.quiet
340
357
  return false
@@ -397,16 +414,17 @@ class RDoc::Parser::C < RDoc::Parser
397
414
  def find_class_comment(class_name, class_mod)
398
415
  comment = nil
399
416
 
400
- if @content =~ %r{
417
+ if @content =~ %r%
401
418
  ((?>/\*.*?\*/\s+))
402
419
  (static\s+)?
403
420
  void\s+
404
- Init_#{class_name}\s*(?:_\(\s*)?\(\s*(?:void\s*)?\)}xmi then # )
421
+ Init_#{class_name}\s*(?:_\(\s*)?\(\s*(?:void\s*)?\)%xmi then
405
422
  comment = $1
406
- elsif @content =~ %r{Document-(?:class|module):\s+#{class_name}\s*?(?:<\s+[:,\w]+)?\n((?>.*?\*/))}m then
423
+ elsif @content =~ %r%Document-(?:class|module):\s+#{class_name}\s*?
424
+ (?:<\s+[:,\w]+)?\n((?>.*?\*/))%xm then
407
425
  comment = $1
408
- elsif @content =~ %r{((?>/\*.*?\*/\s+))
409
- ([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(#{class_name})"}xm then # "
426
+ elsif @content =~ %r%((?>/\*.*?\*/\s+))
427
+ ([\w\.\s]+\s* = \s+)?rb_define_(class|module).*?"(#{class_name})"%xm then
410
428
  comment = $1
411
429
  end
412
430
 
@@ -424,10 +442,13 @@ class RDoc::Parser::C < RDoc::Parser
424
442
  # comment or in the matching Document- section.
425
443
 
426
444
  def find_const_comment(type, const_name)
427
- if @content =~ %r{((?>^\s*/\*.*?\*/\s+))
428
- rb_define_#{type}\((?:\s*(\w+),)?\s*"#{const_name}"\s*,.*?\)\s*;}xmi
445
+ if @content =~ %r%((?>^\s*/\*.*?\*/\s+))
446
+ rb_define_#{type}\((?:\s*(\w+),)?\s*
447
+ "#{const_name}"\s*,
448
+ .*?\)\s*;%xmi then
429
449
  $1
430
- elsif @content =~ %r{Document-(?:const|global|variable):\s#{const_name}\s*?\n((?>.*?\*/))}m
450
+ elsif @content =~ %r%Document-(?:const|global|variable):\s#{const_name}
451
+ \s*?\n((?>.*?\*/))%xm
431
452
  $1
432
453
  else
433
454
  ''
@@ -459,9 +480,9 @@ class RDoc::Parser::C < RDoc::Parser
459
480
 
460
481
  def find_override_comment(class_name, meth_name)
461
482
  name = Regexp.escape(meth_name)
462
- if @content =~ %r{Document-method:\s+#{class_name}(?:\.|::|#)#{name}\s*?\n((?>.*?\*/))}m then
483
+ if @content =~ %r%Document-method:\s+#{class_name}(?:\.|::|#)#{name}\s*?\n((?>.*?\*/))%m then
463
484
  $1
464
- elsif @content =~ %r{Document-method:\s#{name}\s*?\n((?>.*?\*/))}m then
485
+ elsif @content =~ %r%Document-method:\s#{name}\s*?\n((?>.*?\*/))%m then
465
486
  $1
466
487
  end
467
488
  end
@@ -513,7 +534,7 @@ class RDoc::Parser::C < RDoc::Parser
513
534
  class_name
514
535
  end
515
536
 
516
- if @content =~ %r{Document-class:\s+#{full_name}\s*<\s+([:,\w]+)} then
537
+ if @content =~ %r%Document-class:\s+#{full_name}\s*<\s+([:,\w]+)% then
517
538
  parent_name = $1
518
539
  end
519
540
 
@@ -706,7 +727,7 @@ class RDoc::Parser::C < RDoc::Parser
706
727
  # when scanning for classes and methods
707
728
 
708
729
  def remove_commented_out_lines
709
- @content.gsub!(%r{//.*rb_define_}, '//')
730
+ @content.gsub!(%r%//.*rb_define_%, '//')
710
731
  end
711
732
 
712
733
  def remove_private_comments(comment)
@@ -58,7 +58,7 @@ void Init_Blah(void) {
58
58
  def test_do_aliases_singleton
59
59
  content = <<-EOF
60
60
  /*
61
- * This should show up as an alias with documentation
61
+ * This should show up as a method with documentation
62
62
  */
63
63
  VALUE blah(VALUE klass, VALUE year) {
64
64
  }
@@ -69,6 +69,9 @@ void Init_Blah(void) {
69
69
 
70
70
  rb_define_method(sDate, "blah", blah, 1);
71
71
 
72
+ /*
73
+ * This should show up as an alias
74
+ */
72
75
  rb_define_alias(sDate, "bleh", "blah");
73
76
  }
74
77
  EOF
@@ -81,6 +84,7 @@ void Init_Blah(void) {
81
84
  assert_equal 'bleh', methods.last.name
82
85
  assert methods.last.singleton
83
86
  assert_equal 'blah', methods.last.is_alias_for.name
87
+ assert_equal 'This should show up as an alias', methods.last.comment
84
88
  end
85
89
 
86
90
  def test_do_classes_boot_class
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 2
8
8
  - 5
9
- - 10
10
- version: 2.5.10
9
+ - 11
10
+ version: 2.5.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric Hodel
@@ -39,7 +39,7 @@ cert_chain:
39
39
  x52qPcexcYZR7w==
40
40
  -----END CERTIFICATE-----
41
41
 
42
- date: 2010-08-17 00:00:00 -07:00
42
+ date: 2010-08-20 00:00:00 -07:00
43
43
  default_executable:
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
@@ -1,4 +1,2 @@
1
- �L����
2
- đ(p!�k�Y
3
- ﯅�%�gZ��{r�s�G�цvMa� �DF@�\[i���ބ��3�$��(k+�b��I�;�����0|��X�����<�S7�э��~�� �1���Z�}8�o� q����9Mw.+�U!I�6�B�_�v��y�c��tKK~t�d I,�2�+���KeM�
4
- A���J�E�v��9�5ׂ�fj�t���8��I�t�<�0�b8f�e&ÆR�����ki ’����}a:
1
+ 9�
2
+ g�����'<Q�3H�>�*g5(�1���D@:Z�L��C��i{��.7<A�b-�V_���b�� ��a����Lz��]2N"�m">�i2�!�{��fПգR�J3`��0�/l�?�g&P���֞�(���0_����@�/��V�B��\��0�P��G?N/O<����_>)��mf���2����