rdoc 3.3 → 3.4

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
@@ -1,3 +1 @@
1
- +&ɢZ���B�/�����r�����3��|�Ę��y�����~?� ��
2
- �/2G�-[��E>kc�o�+E<�.�"�6h�8��O�^ێ<�f^ v)�j'(�O%C!�W#���F�x���lUÜé{^f�
3
-  }�~%~� �nA�uX��<��+;sD�����`1�H��)]ͽ����
1
+ �K��9�io(t�3;s0���p�'���qj�S�?I�cӗj��:�\���%�u!���r��N��2������"����[��|�j�;+ljls*�����TG���5�A�`��ew�f��)�-�R,��*�*���5��<8X�-�~�m,���ЊP��ti�C���ߌ|�"0j�f9Y�F�#��5�����I\
@@ -1,4 +1,12 @@
1
- === 3.3 / ??
1
+ === 3.4
2
+
3
+ * Minor enhancements
4
+ * RDoc::RDoc#document may now be called with an RDoc::Options instance.
5
+ * Bug fixes
6
+ * Added skips to Encoding tests running on 1.8.
7
+ * Fixed warnings
8
+
9
+ === 3.3 / 2010-01-03
2
10
 
3
11
  * Minor enhancements
4
12
  * The coverage report can now report undocumented method parameters
data/Rakefile CHANGED
@@ -5,6 +5,7 @@ require 'rdoc/rdoc'
5
5
  Hoe.plugin :git
6
6
  Hoe.plugin :isolate
7
7
  Hoe.plugin :minitest
8
+ Hoe.plugin :rdoc_tags
8
9
 
9
10
  $rdoc_rakefile = true
10
11
 
@@ -95,7 +95,7 @@ module RDoc
95
95
  ##
96
96
  # RDoc version you are using
97
97
 
98
- VERSION = '3.3'
98
+ VERSION = '3.4'
99
99
 
100
100
  ##
101
101
  # Method visibilities
@@ -71,7 +71,7 @@ class RDoc::Options
71
71
  attr_accessor :formatter
72
72
 
73
73
  ##
74
- # Description of the output generator (set with the <tt>-fmt</tt> option)
74
+ # Description of the output generator (set with the <tt>--fmt</tt> option)
75
75
 
76
76
  attr_accessor :generator
77
77
 
@@ -246,6 +246,35 @@ class RDoc::Options
246
246
  @title ||= string
247
247
  end
248
248
 
249
+ ##
250
+ # Completes any unfinished option setup business such as filtering for
251
+ # existent files, creating a regexp for #exclude and setting a default
252
+ # #template.
253
+
254
+ def finish
255
+ @op_dir ||= 'doc'
256
+
257
+ @rdoc_include << "." if @rdoc_include.empty?
258
+
259
+ if @exclude.empty? then
260
+ @exclude = nil
261
+ else
262
+ @exclude = Regexp.new(@exclude.join("|"))
263
+ end
264
+
265
+ check_files
266
+
267
+ # If no template was specified, use the default template for the output
268
+ # formatter
269
+
270
+ unless @template then
271
+ @template = @generator_name
272
+ @template_dir = template_dir_for @template
273
+ end
274
+
275
+ self
276
+ end
277
+
249
278
  ##
250
279
  # Returns a properly-space list of generators and their descriptions.
251
280
 
@@ -273,7 +302,7 @@ class RDoc::Options
273
302
  end
274
303
 
275
304
  ##
276
- # Parse command line options.
305
+ # Parses command line options.
277
306
 
278
307
  def parse(argv)
279
308
  ignore_invalid = true
@@ -677,26 +706,9 @@ Usage: #{opt.program_name} [options] [names...]
677
706
  end
678
707
  end
679
708
 
680
- @op_dir ||= 'doc'
681
709
  @files = argv.dup
682
710
 
683
- @rdoc_include << "." if @rdoc_include.empty?
684
-
685
- if @exclude.empty? then
686
- @exclude = nil
687
- else
688
- @exclude = Regexp.new(@exclude.join("|"))
689
- end
690
-
691
- check_files
692
-
693
- # If no template was specified, use the default template for the output
694
- # formatter
695
-
696
- unless @template then
697
- @template = @generator_name
698
- @template_dir = template_dir_for @template
699
- end
711
+ finish
700
712
  end
701
713
 
702
714
  ##
@@ -733,7 +745,10 @@ Usage: #{opt.program_name} [options] [names...]
733
745
  @generator_name = generator_name
734
746
  @generator_options << @generator
735
747
 
736
- @generator.setup_options self if @generator.respond_to? :setup_options
748
+ if @generator.respond_to? :setup_options then
749
+ @option_parser ||= OptionParser.new
750
+ @generator.setup_options self
751
+ end
737
752
  end
738
753
 
739
754
  ##
@@ -382,21 +382,30 @@ The internal error was:
382
382
  end
383
383
 
384
384
  ##
385
- # Format up one or more files according to the given arguments.
385
+ # Generates documentation or a coverage report depending upon the settings
386
+ # in +options+.
386
387
  #
387
- # For simplicity, +argv+ is an array of strings, equivalent to the strings
388
- # that would be passed on the command line. (This isn't a coincidence, as
389
- # we _do_ pass in ARGV when running interactively). For a list of options,
390
- # see <tt>rdoc --help</tt>. By default, output will be stored in a directory
391
- # called +doc+ below the current directory, so make sure you're somewhere
392
- # writable before invoking.
393
-
394
- def document(argv)
388
+ # +options+ can be either an RDoc::Options instance or an array of strings
389
+ # equivalent to the strings that would be passed on the command line like
390
+ # <tt>%w[-q -o doc -t My\ Doc\ Title]</tt>. #document will automatically
391
+ # call RDoc::Options#finish if an options instance was given.
392
+ #
393
+ # For a list of options, see either RDoc::Options or <tt>rdoc --help</tt>.
394
+ #
395
+ # By default, output will be stored in a directory called "doc" below the
396
+ # current directory, so make sure you're somewhere writable before invoking.
397
+
398
+ def document options
395
399
  RDoc::TopLevel.reset
396
400
  RDoc::Parser::C.reset
397
401
 
398
- @options = RDoc::Options.new
399
- @options.parse argv
402
+ if RDoc::Options === options then
403
+ @options = options
404
+ @options.finish
405
+ else
406
+ @options = RDoc::Options.new
407
+ @options.parse options
408
+ end
400
409
 
401
410
  if @options.pipe then
402
411
  handle_pipe
@@ -478,6 +487,7 @@ begin
478
487
  load extension
479
488
  rescue => e
480
489
  warn "error loading #{extension.inspect}: #{e.message} (#{e.class})"
490
+ warn "\t#{e.backtrace.join "\n\t"}" if $DEBUG
481
491
  end
482
492
  end
483
493
  end
@@ -30,6 +30,7 @@ class RDoc::Stats
30
30
  @num_files = num_files
31
31
 
32
32
  @coverage_level = 0
33
+ @doc_items = nil
33
34
  @fully_documented = nil
34
35
  @num_params = 0
35
36
  @percent_doc = nil
@@ -31,6 +31,8 @@ class TestRDocCodeObject < XrefTestCase
31
31
  end
32
32
 
33
33
  def test_comment_equals_encoding
34
+ skip "Encoding not implemented" unless Object.const_defined? :Encoding
35
+
34
36
  refute_equal Encoding::UTF_8, ''.encoding, 'Encoding sanity check'
35
37
 
36
38
  input = 'text'
@@ -43,6 +45,8 @@ class TestRDocCodeObject < XrefTestCase
43
45
  end
44
46
 
45
47
  def test_comment_equals_encoding_blank
48
+ skip "Encoding not implemented" unless Object.const_defined? :Encoding
49
+
46
50
  refute_equal Encoding::UTF_8, ''.encoding, 'Encoding sanity check'
47
51
 
48
52
  input = ''
@@ -345,16 +345,38 @@ file 'unreadable' not readable
345
345
  def self.op() @op end
346
346
  end
347
347
 
348
- RDoc::RDoc::GENERATORS['TestGenerator'] = test_generator
348
+ RDoc::RDoc::GENERATORS['test'] = test_generator
349
349
 
350
- @options.setup_generator 'TestGenerator'
350
+ @options.setup_generator 'test'
351
351
 
352
352
  assert_equal test_generator, @options.generator
353
353
  assert_equal [test_generator], @options.generator_options
354
354
 
355
355
  assert_equal @options, test_generator.op
356
356
  ensure
357
- RDoc::RDoc::GENERATORS.delete 'TestGenerator'
357
+ RDoc::RDoc::GENERATORS.delete 'test'
358
+ end
359
+
360
+ def test_setup_generator_no_option_parser
361
+ test_generator = Class.new do
362
+ def self.setup_options op
363
+ op.option_parser.separator nil
364
+ @op = op
365
+ end
366
+
367
+ def self.op() @op end
368
+ end
369
+
370
+ RDoc::RDoc::GENERATORS['test'] = test_generator
371
+
372
+ @options.setup_generator 'test'
373
+
374
+ assert_equal test_generator, @options.generator
375
+ assert_equal [test_generator], @options.generator_options
376
+
377
+ assert_equal @options, test_generator.op
378
+ ensure
379
+ RDoc::RDoc::GENERATORS.delete 'test'
358
380
  end
359
381
 
360
382
  def test_update_output_dir
@@ -643,20 +643,6 @@ end
643
643
  assert_equal 1, const_fail_meta.attributes.length
644
644
  end
645
645
 
646
- def test_parse_class_nested_superclass
647
- foo = RDoc::NormalModule.new 'Foo'
648
- foo.parent = @top_level
649
-
650
- util_parser "class Bar < Super\nend"
651
-
652
- tk = @parser.get_tk
653
-
654
- @parser.parse_class foo, RDoc::Parser::Ruby::NORMAL, tk, ''
655
-
656
- bar = foo.classes.first
657
- assert_equal 'Super', bar.superclass
658
- end
659
-
660
646
  def test_parse_class_nested_superclass
661
647
  util_top_level
662
648
  foo = @top_level.add_module RDoc::NormalModule, 'Foo'
@@ -570,12 +570,12 @@ Foo::Bar#bother
570
570
  end
571
571
 
572
572
  def test_name_regexp
573
- assert_equal /^RDoc::AnyMethod#new$/,
573
+ assert_equal %r%^RDoc::AnyMethod#new$%,
574
574
  @driver.name_regexp('RDoc::AnyMethod#new')
575
- assert_equal /^RDoc::AnyMethod::new$/,
575
+ assert_equal %r%^RDoc::AnyMethod::new$%,
576
576
  @driver.name_regexp('RDoc::AnyMethod::new')
577
577
 
578
- assert_equal /^RDoc::AnyMethod(#|::)new$/,
578
+ assert_equal %r%^RDoc::AnyMethod(#|::)new$%,
579
579
  @driver.name_regexp('RDoc::AnyMethod.new')
580
580
  end
581
581
 
@@ -145,6 +145,8 @@ The comments associated with
145
145
  end
146
146
 
147
147
  def test_strip_newlines_encoding
148
+ skip "Encoding not implemented" unless Object.const_defined? :Encoding
149
+
148
150
  assert_equal Encoding::UTF_8, ''.encoding, 'Encoding sanity check'
149
151
 
150
152
  text = " \n"
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
- - 3
9
- version: "3.3"
8
+ - 4
9
+ version: "3.4"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Eric Hodel
@@ -38,7 +38,7 @@ cert_chain:
38
38
  x52qPcexcYZR7w==
39
39
  -----END CERTIFICATE-----
40
40
 
41
- date: 2011-01-03 00:00:00 -08:00
41
+ date: 2011-01-06 00:00:00 -08:00
42
42
  default_executable:
43
43
  dependencies:
44
44
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- ~�:h�-ɓ����C^���
2
- /��sݦ�ϟS|Ѿ=��f�H��R_AN!�wK��8{&s}xN'�4�tk}z<�N“Q�W��èˢ����_���1�ĊB��l�k�� #�������������+�Ʃ|�w��|N�����{=u���b�q�7g�_$t���N�
1
+ .��d:��P� ��l���$���r�ɢ 8�����\FJ����5�l���n J���3Z��R��˸\s`����s(�蚯+�����
2
+ n ��-�PH6rZGThU~P}
3
+ �����]��� ! 5+��<"��E�-��F�ӣb]�z�'l�<�-V��#U��-c��/$����P��W)�[������IŦ�z��j �O����@�;�@_�L�����mu����5I��M-l*J$��Z