rdoc 3.10.pre.2 → 3.10.pre.3

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
@@ -19,7 +19,7 @@
19
19
  The default markup can be set via the <tt>--markup</tt> option.
20
20
 
21
21
  The format of documentation in a particular file can be specified by the
22
- +:markup:+ directive. If the :markup: directive is in the first comment
22
+ +:markup:+ directive. If the +:markup:+ directive is in the first comment
23
23
  it is used as the default for the entire file. For other comments it
24
24
  overrides the default markup format.
25
25
 
@@ -39,7 +39,7 @@
39
39
  <tt>RDoc::Markup@Links</tt>
40
40
 
41
41
  See RDoc::Markup@Links for further details.
42
- * RDoc now looks for a <tt>format: parser_name</tt> magic comment to choose
42
+ * RDoc now looks for a <tt>markup: parser_name</tt> magic comment to choose
43
43
  alternate documentation formats. The format comment must be in the first
44
44
  three lines of the file (to allow for a shebang or modeline).
45
45
  * RDoc makes an effort to syntax-highlight ruby code in verbatim sections.
@@ -1,14 +1,15 @@
1
1
  .autotest
2
2
  .document
3
- History.txt
3
+ History.rdoc
4
4
  LICENSE.rdoc
5
5
  Manifest.txt
6
- README.txt
7
- RI.txt
6
+ README.rdoc
7
+ RI.rdoc
8
8
  Rakefile
9
9
  TODO.rdoc
10
10
  bin/rdoc
11
11
  bin/ri
12
+ lib/gauntlet_rdoc.rb
12
13
  lib/rdoc.rb
13
14
  lib/rdoc/alias.rb
14
15
  lib/rdoc/anon_class.rb
@@ -24,7 +25,6 @@ lib/rdoc/context/section.rb
24
25
  lib/rdoc/cross_reference.rb
25
26
  lib/rdoc/encoding.rb
26
27
  lib/rdoc/erbio.rb
27
- lib/rdoc/gauntlet.rb
28
28
  lib/rdoc/generator.rb
29
29
  lib/rdoc/generator/darkfish.rb
30
30
  lib/rdoc/generator/json_index.rb
@@ -44,7 +44,6 @@ lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml
44
44
  lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml
45
45
  lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml
46
46
  lib/rdoc/generator/template/darkfish/class.rhtml
47
- lib/rdoc/generator/template/darkfish/fileinfo.rhtml
48
47
  lib/rdoc/generator/template/darkfish/images/add.png
49
48
  lib/rdoc/generator/template/darkfish/images/brick.png
50
49
  lib/rdoc/generator/template/darkfish/images/brick_link.png
@@ -1,10 +1,10 @@
1
1
  = \RDoc - Ruby Documentation System
2
2
 
3
- * {RDoc Project Page}[https://github.com/rdoc/rdoc/]
4
- * {RDoc Documentation}[http://docs.seattlerb.org/rdoc]
5
- * {RDoc Bug Tracker}[https://github.com/rdoc/rdoc/issues]
3
+ home :: https://github.com/rdoc/rdoc
4
+ rdoc :: http://docs.seattlerb.org/rdoc
5
+ bugs :: https://github.com/rdoc/rdoc/issues
6
6
 
7
- == DESCRIPTION:
7
+ == Description
8
8
 
9
9
  RDoc produces HTML and command-line documentation for Ruby projects. RDoc
10
10
  includes the +rdoc+ and +ri+ tools for generating and displaying online
@@ -12,7 +12,7 @@ documentation.
12
12
 
13
13
  See RDoc for a description of RDoc's markup and basic use.
14
14
 
15
- == SYNOPSIS:
15
+ == Synopsis
16
16
 
17
17
  To learn RDoc's syntax and directives for documenting your ruby project see
18
18
  RDoc::Markup. RDoc::Parser::Ruby and RDoc::Parser::C have additional
@@ -40,12 +40,12 @@ To generate documentation programmatically:
40
40
  rdoc.document options
41
41
  # see RDoc::RDoc
42
42
 
43
- == BUGS:
43
+ == Bugs
44
44
 
45
45
  If you find a bug, please report it at the RDoc project's
46
46
  {issues tracker}[https://github.com/rdoc/rdoc/issues] on github
47
47
 
48
- == LICENSE:
48
+ == License
49
49
 
50
50
  RDoc is Copyright (c) 2001-2003 Dave Thomas, The Pragmatic Programmers.
51
51
  Portions (c) 2007-2011 Eric Hodel. Portions copyright others, see individual
@@ -54,7 +54,7 @@ files for details.
54
54
  It is free software, and may be redistributed under the terms specified in
55
55
  LICENSE.txt.
56
56
 
57
- == WARRANTY:
57
+ == Warranty
58
58
 
59
59
  This software is provided "as is" and without any express or implied
60
60
  warranties, including, without limitation, the implied warranties of
data/RI.rdoc ADDED
@@ -0,0 +1,57 @@
1
+ = RI
2
+
3
+ +ri+ is a tool that allows Ruby documentation to be viewed on the command-line.
4
+
5
+ You can use +ri+ to look up information from either the command line or
6
+ interactively. When you run +ri+ without any arguments it will launch in
7
+ interactive mode. In interactive mode you can tab-complete class and method
8
+ names.
9
+
10
+ == Usage
11
+
12
+ To see information for a class, do:
13
+ ri ClassName
14
+
15
+ For example, for the Array class, do:
16
+ ri Array
17
+
18
+ To see information on a method on a class, do:
19
+ ri ClassName.method
20
+
21
+ This will show both instance and class methods. For example, the IO
22
+ class defines both IO::read and IO#read:
23
+ ri IO.read
24
+
25
+ To see information for an instance method, do:
26
+ ri ClassName#method_name
27
+
28
+ For example, for Array's +join+ method, do:
29
+ ri Array#join
30
+
31
+ To see information for a class method, do:
32
+ ri ClassName::method_name
33
+
34
+ For example, for Module's +private+ method, do:
35
+ ri Module::private
36
+
37
+ To read documentation for all +read+ methods, do:
38
+ ri read
39
+
40
+ == Options
41
+
42
+ +ri+ supports a variety of options, all of which can be viewed via +--help+.
43
+ Of particular interest, are:
44
+
45
+ [<tt>-f</tt>]
46
+ Outputs ri data using the selected formatter. You can see the available
47
+ formatters in <tt>ri --help</tt>
48
+ [<tt>-T</tt>]
49
+ Send output to stdout, rather than to a pager.
50
+
51
+ All options also can be specified through the +RI+ environment variable.
52
+ Command-line options always override those specified in the +RI+ environment
53
+ variable.
54
+
55
+ The +RI_PAGER+ environment variable allows you to choose a particular pager or
56
+ particular options for your pager.
57
+
data/Rakefile CHANGED
@@ -35,7 +35,16 @@ Depending on your version of ruby, you may need to install ruby rdoc/ri data:
35
35
  >= 1.9.2 : nothing to do! Yay!
36
36
  MESSAGE
37
37
 
38
+ self.readme_file = 'README.rdoc'
39
+ self.history_file = 'History.rdoc'
38
40
  self.testlib = :minitest
41
+ self.extra_rdoc_files += %w[
42
+ History.rdoc
43
+ LICENSE.rdoc
44
+ README.rdoc
45
+ RI.rdoc
46
+ TODO.rdoc
47
+ ]
39
48
 
40
49
  self.clean_globs += PARSER_FILES
41
50
 
data/TODO.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  Some file contains some things that might happen in RDoc, or might not
2
2
 
3
- === RDoc 3.11
3
+ === 3.11
4
4
 
5
5
  * Reload the RDoc tree from an RI store
6
6
  * Re-run generators
@@ -12,7 +12,7 @@ Some file contains some things that might happen in RDoc, or might not
12
12
  * Remove Public in HTML output if there are only public methods
13
13
  * Method markup support for rd documentation
14
14
 
15
- === RDoc 4
15
+ === 4
16
16
 
17
17
  API changes to RDoc
18
18
 
@@ -1,6 +1,6 @@
1
1
  $DEBUG_RDOC = nil
2
2
 
3
- # :main: README.txt
3
+ # :main: README.rdoc
4
4
 
5
5
  ##
6
6
  # RDoc is a Ruby documentation system which contains RDoc::RDoc for generating
@@ -61,7 +61,7 @@ $DEBUG_RDOC = nil
61
61
  # index page contain the documentation for the primary file. In our
62
62
  # case, we could type
63
63
  #
64
- # % rdoc --main README.txt
64
+ # % rdoc --main README.rdoc
65
65
  #
66
66
  # You'll find information on the various formatting tricks you can use
67
67
  # in comment blocks in the documentation this generates.
@@ -116,16 +116,6 @@ class RDoc::CrossReference
116
116
  def resolve name, text
117
117
  return @seen[name] if @seen.include? name
118
118
 
119
- # Find class, module, or method in class or module.
120
- #
121
- # Do not, however, use an if/elsif/else chain to do so. Instead, test
122
- # each possible pattern until one matches. The reason for this is that a
123
- # string like "YAML.txt" could be the txt() class method of class YAML (in
124
- # which case it would match the first pattern, which splits the string
125
- # into container and method components and looks up both) or a filename
126
- # (in which case it would match the last pattern, which just checks
127
- # whether the string as a whole is a known symbol).
128
-
129
119
  if /#{CLASS_REGEXP_STR}([.#]|::)#{METHOD_REGEXP_STR}/o =~ name then
130
120
  type = $2
131
121
  type = '' if type == '.' # will find either #method or ::method
@@ -150,12 +140,15 @@ class RDoc::CrossReference
150
140
 
151
141
  ref = case name
152
142
  when /^\\(#{CLASS_REGEXP_STR})$/o then
153
- ref = @context.find_symbol $1
143
+ @context.find_symbol $1
154
144
  else
155
- ref = @context.find_symbol name
145
+ @context.find_symbol name
156
146
  end unless ref
157
147
 
158
- ref = nil if RDoc::Alias === ref # external alias: can't link to it
148
+ # Try a page name
149
+ ref = RDoc::TopLevel.page name if not ref and name =~ /^\w+$/
150
+
151
+ ref = nil if RDoc::Alias === ref # external alias, can't link to it
159
152
 
160
153
  out = if name == '\\' then
161
154
  name
@@ -199,13 +199,13 @@ class RDoc::Generator::Darkfish
199
199
 
200
200
  @options.static_path.each do |path|
201
201
  unless File.directory? path then
202
- FileUtils.install path, @base_dir, fu_options.merge(:mode => 0644)
202
+ FileUtils.install path, @outputdir, fu_options.merge(:mode => 0644)
203
203
  next
204
204
  end
205
205
 
206
206
  Dir.chdir path do
207
207
  Dir[File.join('**', '*')].each do |entry|
208
- dest_file = @base_dir + entry
208
+ dest_file = @outputdir + entry
209
209
 
210
210
  if File.directory? entry then
211
211
  FileUtils.mkdir_p entry, fu_options
@@ -348,7 +348,7 @@ class RDoc::Generator::Darkfish
348
348
 
349
349
  debug_msg "Rendering the Table of Contents..."
350
350
 
351
- out_file = @base_dir + @options.op_dir + 'table_of_contents.html'
351
+ out_file = @outputdir + 'table_of_contents.html'
352
352
  # suppress 1.9.3 warning
353
353
  rel_prefix = rel_prefix = @outputdir.relative_path_from(out_file.dirname)
354
354
  @title = "Table of Contents"
@@ -470,12 +470,6 @@ pre {
470
470
 
471
471
  /* @group Source Code */
472
472
 
473
- .method-source-code pre {
474
- overflow: auto;
475
- }
476
-
477
- /* @group Ruby keyword styles */
478
-
479
473
  pre {
480
474
  overflow: auto;
481
475
  background: #262626;
@@ -499,61 +493,7 @@ pre {
499
493
  .ruby-value { color: #7fffd4; background: transparent; }
500
494
 
501
495
  /* @end */
502
- /* @end */
503
-
504
-
505
- /* @group File Popup Contents */
506
-
507
- .file-popup dl {
508
- font-size: 80%;
509
- padding: 0.75em;
510
- background-color: #dedede;
511
- color: #333;
512
- border: 1px solid #bbb;
513
- -moz-border-radius: 3px;
514
- -webkit-border-radius: 3px;
515
- }
516
- .file dt {
517
- font-weight: bold;
518
- padding-left: 22px;
519
- line-height: 20px;
520
- background: url(images/page_white_width.png) no-repeat left top;
521
- }
522
- .file dt.modified-date {
523
- background: url(images/date.png) no-repeat left top;
524
- }
525
- .file dt.requires {
526
- background: url(images/plugin.png) no-repeat left top;
527
- }
528
- .file dt.scs-url {
529
- background: url(images/wrench.png) no-repeat left top;
530
- }
531
-
532
- .file dl dd {
533
- margin: 0 0 1em 0;
534
- }
535
- .file #metadata dl dd ul {
536
- list-style: circle;
537
- margin-left: 20px;
538
- padding-top: 0;
539
- }
540
- .file #metadata dl dd ul li {
541
- }
542
-
543
- /*
544
- .file h2 {
545
- margin-top: 2em;
546
- padding: 0.75em 0.5em;
547
- background-color: #dedede;
548
- color: #333;
549
- font-size: 120%;
550
- border: 1px solid #bbb;
551
- -moz-border-radius: 3px;
552
- -webkit-border-radius: 3px;
553
- }
554
- */
555
496
 
556
- /* @end */
557
497
 
558
498
  /* @group search results */
559
499
  #search-results h1 {
@@ -150,7 +150,7 @@ class RDoc::Parser
150
150
  def self.for top_level, file_name, content, options, stats
151
151
  return if binary? file_name
152
152
 
153
- parser = use_format content
153
+ parser = use_markup content
154
154
 
155
155
  unless parser then
156
156
  # If no extension, look for shebang
@@ -180,10 +180,10 @@ class RDoc::Parser
180
180
  end
181
181
 
182
182
  ##
183
- # If there is a <tt>format: parser_name</tt> comment at the front of the
183
+ # If there is a <tt>markup: parser_name</tt> comment at the front of the
184
184
  # file, use it to determine the parser. For example:
185
185
  #
186
- # # format: rdoc
186
+ # # markup: rdoc
187
187
  # # Class comment can go here
188
188
  #
189
189
  # class C
@@ -194,17 +194,19 @@ class RDoc::Parser
194
194
  # If the content contains a shebang or editor modeline the comment may
195
195
  # appear on the second or third line.
196
196
  #
197
- # Any comment style may be used to hide the format comment.
197
+ # Any comment style may be used to hide the markup comment.
198
198
 
199
- def self.use_format content
200
- format = content.lines.first(3).grep(/format:\s+(\w+)/) { $1 }.first
199
+ def self.use_markup content
200
+ markup = content.lines.first(3).grep(/markup:\s+(\w+)/) { $1 }.first
201
201
 
202
- return unless format
202
+ return unless markup
203
203
 
204
- format = Regexp.escape format
204
+ return RDoc::Parser::Ruby if markup == 'tomdoc'
205
+
206
+ markup = Regexp.escape markup
205
207
 
206
208
  RDoc::Parser.parsers.find do |_, parser|
207
- /^#{format}$/i =~ parser.name.sub(/.*:/, '')
209
+ /^#{markup}$/i =~ parser.name.sub(/.*:/, '')
208
210
  end.last
209
211
  end
210
212
 
@@ -575,7 +575,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
575
575
  ##
576
576
  # Parses a class in +context+ with +comment+
577
577
 
578
- def parse_class(container, single, tk, comment)
578
+ def parse_class container, single, tk, comment
579
579
  offset = tk.seek
580
580
  line_no = tk.line_no
581
581
 
@@ -728,7 +728,8 @@ class RDoc::Parser::Ruby < RDoc::Parser
728
728
  read_documentation_modifiers con, RDoc::CONSTANT_MODIFIERS
729
729
 
730
730
  @stats.add_constant con
731
- container.add_constant con
731
+ con = container.add_constant con
732
+
732
733
  true
733
734
  end
734
735
 
@@ -1240,17 +1241,18 @@ class RDoc::Parser::Ruby < RDoc::Parser
1240
1241
  ##
1241
1242
  # Parses an RDoc::NormalModule in +container+ with +comment+
1242
1243
 
1243
- def parse_module(container, single, tk, comment)
1244
+ def parse_module container, single, tk, comment
1244
1245
  container, name_t, = get_class_or_module container
1245
1246
 
1246
1247
  name = name_t.name
1247
1248
 
1248
1249
  mod = container.add_module RDoc::NormalModule, name
1250
+ mod.ignore unless container.document_children
1249
1251
  mod.record_location @top_level
1250
1252
 
1251
1253
  read_documentation_modifiers mod, RDoc::CLASS_MODIFIERS
1252
1254
  mod.add_comment comment, @top_level
1253
- parse_statements(mod)
1255
+ parse_statements mod
1254
1256
 
1255
1257
  @top_level.add_to_classes_or_modules mod
1256
1258
  @stats.add_module mod
@@ -1344,11 +1346,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
1344
1346
  parse_class container, single, tk, comment
1345
1347
 
1346
1348
  when TkMODULE then
1347
- if container.document_children then
1348
- parse_module container, single, tk, comment
1349
- else
1350
- nest += 1
1351
- end
1349
+ parse_module container, single, tk, comment
1352
1350
 
1353
1351
  when TkDEF then
1354
1352
  parse_method container, single, tk, comment
@@ -1690,6 +1688,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
1690
1688
  catch :eof do
1691
1689
  begin
1692
1690
  parse_top_level_statements @top_level
1691
+
1693
1692
  rescue StandardError => e
1694
1693
  bytes = ''
1695
1694
 
@@ -352,7 +352,8 @@ class RDoc::Stats
352
352
  next if method.documented? and not param_report
353
353
  report << " # in file #{method.file.full_name}"
354
354
  report << param_report if param_report
355
- report << " def #{method.name}#{method.params}; end"
355
+ scope = method.singleton ? 'self.' : nil
356
+ report << " def #{scope}#{method.name}#{method.params}; end"
356
357
  report << nil
357
358
  end
358
359
 
@@ -231,6 +231,15 @@ class RDoc::TopLevel < RDoc::Context
231
231
  end
232
232
  end
233
233
 
234
+ ##
235
+ # Returns the RDoc::TopLevel that has the given +name+
236
+
237
+ def self.page name
238
+ @all_files_hash.each_value.find do |file|
239
+ file.text? and file.page_name == name
240
+ end
241
+ end
242
+
234
243
  ##
235
244
  # Removes from +all_hash+ the contexts that are nodoc or have no content.
236
245
  #
@@ -328,7 +337,7 @@ class RDoc::TopLevel < RDoc::Context
328
337
  ##
329
338
  # Adds +constant+ to +Object+ instead of +self+.
330
339
 
331
- def add_constant(constant)
340
+ def add_constant constant
332
341
  object_class.record_location self
333
342
  return constant unless @document_self
334
343
  object_class.add_constant constant
@@ -495,7 +504,7 @@ class RDoc::TopLevel < RDoc::Context
495
504
  # Is this TopLevel from a text file instead of a source code file?
496
505
 
497
506
  def text?
498
- @parser.ancestors.include? RDoc::Parser::Text
507
+ @parser and @parser.ancestors.include? RDoc::Parser::Text
499
508
  end
500
509
 
501
510
  def to_s # :nodoc:
@@ -6,6 +6,8 @@ class TestRDocContext < XrefTestCase
6
6
  super
7
7
 
8
8
  @context = RDoc::Context.new
9
+ @enumerator = # 1.8 vs 1.9
10
+ Object.const_defined?(:Enumerator) ? Enumerator : Enumerable::Enumerator
9
11
  end
10
12
 
11
13
  def test_initialize
@@ -365,7 +367,7 @@ class TestRDocContext < XrefTestCase
365
367
  end
366
368
 
367
369
  def test_each_method_enumerator
368
- assert_kind_of Enumerator, @c1.each_method
370
+ assert_kind_of @enumerator, @c1.each_method
369
371
  end
370
372
 
371
373
  def test_each_section
@@ -397,7 +399,7 @@ class TestRDocContext < XrefTestCase
397
399
  end
398
400
 
399
401
  def test_each_section_enumerator
400
- assert_kind_of Enumerator, @c1.each_section
402
+ assert_kind_of @enumerator, @c1.each_section
401
403
  end
402
404
 
403
405
  def test_find_attribute_named
@@ -707,7 +709,7 @@ class TestRDocContext < XrefTestCase
707
709
  @context = RDoc::Context.new
708
710
 
709
711
  @context.add_method RDoc::AnyMethod.new(nil, 'm')
710
- b = @context.add_section 'B'
712
+ @context.add_section 'B'
711
713
 
712
714
  assert_empty @context.section_contents
713
715
  end
@@ -16,6 +16,13 @@ class TestRDocCrossReference < XrefTestCase
16
16
  assert_equal name, @xref.resolve(name, name)
17
17
  end
18
18
 
19
+ def test_resolve_page
20
+ page = RDoc::TopLevel.new 'README.txt'
21
+ page.parser = RDoc::Parser::Simple
22
+
23
+ assert_ref page, 'README'
24
+ end
25
+
19
26
  def test_resolve_C2
20
27
  @xref = RDoc::CrossReference.new @c2
21
28
 
@@ -72,7 +72,6 @@ class TestRDocGeneratorDarkfish < RDoc::TestCase
72
72
 
73
73
  assert_file 'index.html'
74
74
  assert_file 'Object.html'
75
- assert_file 'file_rb.html'
76
75
  assert_file 'table_of_contents.html'
77
76
  assert_file 'js/search_index.js'
78
77
 
@@ -86,8 +85,6 @@ class TestRDocGeneratorDarkfish < RDoc::TestCase
86
85
  File.read('index.html'))
87
86
  assert_match(/<meta content="text\/html; charset=#{encoding}"/,
88
87
  File.read('Object.html'))
89
- assert_match(/<meta content="text\/html; charset=#{encoding}"/,
90
- File.read('file_rb.html'))
91
88
 
92
89
  refute_match(/Ignored/, File.read('index.html'))
93
90
  end
@@ -101,7 +98,6 @@ class TestRDocGeneratorDarkfish < RDoc::TestCase
101
98
 
102
99
  refute_file 'index.html'
103
100
  refute_file 'Object.html'
104
- refute_file 'file_rb.html'
105
101
  end
106
102
 
107
103
  def test_generate_static
@@ -81,9 +81,9 @@ class TestRDocParser < RDoc::TestCase
81
81
  assert_nil @RP.for(nil, @binary_dat, nil, nil, nil)
82
82
  end
83
83
 
84
- def test_class_for_format
84
+ def test_class_for_markup
85
85
  content = <<-CONTENT
86
- # coding: utf-8 format: rd
86
+ # coding: utf-8 markup: rd
87
87
  CONTENT
88
88
 
89
89
  parser = @RP.for @top_level, __FILE__, content, @options, nil
@@ -91,53 +91,63 @@ class TestRDocParser < RDoc::TestCase
91
91
  assert_kind_of @RP::RD, parser
92
92
  end
93
93
 
94
- def test_class_use_format
94
+ def test_class_use_markup
95
95
  content = <<-CONTENT
96
- # coding: utf-8 format: rd
96
+ # coding: utf-8 markup: rd
97
97
  CONTENT
98
98
 
99
- parser = @RP.use_format content
99
+ parser = @RP.use_markup content
100
100
 
101
101
  assert_equal @RP::RD, parser
102
102
  end
103
103
 
104
- def test_class_use_format_modeline
104
+ def test_class_use_markup_modeline
105
105
  content = <<-CONTENT
106
106
  # -*- coding: utf-8 -*-
107
- # format: rd
107
+ # markup: rd
108
108
  CONTENT
109
109
 
110
- parser = @RP.use_format content
110
+ parser = @RP.use_markup content
111
111
 
112
112
  assert_equal @RP::RD, parser
113
113
  end
114
114
 
115
- def test_class_use_format_modeline_shebang
115
+ def test_class_use_markup_modeline_shebang
116
116
  content = <<-CONTENT
117
117
  #!/bin/sh
118
118
  /* -*- coding: utf-8 -*-
119
- * format: rd
119
+ * markup: rd
120
120
  */
121
121
  CONTENT
122
122
 
123
- parser = @RP.use_format content
123
+ parser = @RP.use_markup content
124
124
 
125
125
  assert_equal @RP::RD, parser
126
126
  end
127
127
 
128
- def test_class_use_format_shebang
128
+ def test_class_use_markup_shebang
129
129
  content = <<-CONTENT
130
130
  #!/usr/bin/env ruby
131
- # coding: utf-8 format: rd
131
+ # coding: utf-8 markup: rd
132
132
  CONTENT
133
133
 
134
- parser = @RP.use_format content
134
+ parser = @RP.use_markup content
135
135
 
136
136
  assert_equal @RP::RD, parser
137
137
  end
138
138
 
139
- def test_class_use_format_none
140
- parser = @RP.use_format ''
139
+ def test_class_use_markup_tomdoc
140
+ content = <<-CONTENT
141
+ # coding: utf-8 markup: tomdoc
142
+ CONTENT
143
+
144
+ parser = @RP.use_markup content
145
+
146
+ assert_equal @RP::Ruby, parser
147
+ end
148
+
149
+ def test_class_use_markup_none
150
+ parser = @RP.use_markup ''
141
151
 
142
152
  assert_nil parser
143
153
  end
@@ -686,7 +686,7 @@ end
686
686
 
687
687
  foo = @top_level.modules.first
688
688
  assert_equal 'Foo', foo.full_name
689
- assert_equal 'my module', foo.comment.text
689
+ assert_empty foo.comment
690
690
  end
691
691
 
692
692
  def test_parse_class_colon3
@@ -2375,6 +2375,24 @@ end
2375
2375
  assert hidden.ignored?
2376
2376
  end
2377
2377
 
2378
+ def test_scan_stopdoc_class_alias
2379
+ util_parser <<-RUBY
2380
+ # :stopdoc:
2381
+ module A
2382
+ B = C
2383
+ end
2384
+ RUBY
2385
+
2386
+ @parser.scan
2387
+
2388
+ assert_empty RDoc::TopLevel.classes
2389
+
2390
+ assert_equal 1, RDoc::TopLevel.modules.length
2391
+ m = RDoc::TopLevel.modules.first
2392
+
2393
+ assert m.ignored?
2394
+ end
2395
+
2378
2396
  def test_stopdoc_after_comment
2379
2397
  util_parser <<-EOS
2380
2398
  module Bar
@@ -331,6 +331,40 @@ class C # is documented
331
331
  # in file file.rb
332
332
  def m1; end
333
333
 
334
+ end
335
+ EXPECTED
336
+
337
+ assert_equal expected, report
338
+ end
339
+
340
+ def test_report_method_class
341
+ c = @tl.add_class RDoc::NormalClass, 'C'
342
+ c.record_location @tl
343
+ c.add_comment 'C', @tl
344
+
345
+ m1 = RDoc::AnyMethod.new nil, 'm1'
346
+ m1.record_location @tl
347
+ m1.singleton = true
348
+ c.add_method m1
349
+
350
+ m2 = RDoc::AnyMethod.new nil, 'm2'
351
+ m2.record_location @tl
352
+ m2.singleton = true
353
+ c.add_method m2
354
+ m2.comment = 'm2'
355
+
356
+ RDoc::TopLevel.complete :public
357
+
358
+ report = @s.report
359
+
360
+ expected = <<-EXPECTED
361
+ The following items are not documented:
362
+
363
+ class C # is documented
364
+
365
+ # in file file.rb
366
+ def self.m1; end
367
+
334
368
  end
335
369
  EXPECTED
336
370
 
@@ -89,6 +89,15 @@ class TestRDocTopLevel < XrefTestCase
89
89
  refute_same tl1, tl3
90
90
  end
91
91
 
92
+ def test_class_page
93
+ page = RDoc::TopLevel.new 'PAGE.txt'
94
+ page.parser = RDoc::Parser::Simple
95
+
96
+ assert_nil RDoc::TopLevel.page 'no such page'
97
+
98
+ assert_equal page, RDoc::TopLevel.page('PAGE')
99
+ end
100
+
92
101
  def test_class_reset
93
102
  RDoc::TopLevel.reset
94
103
 
@@ -283,5 +292,13 @@ class TestRDocTopLevel < XrefTestCase
283
292
  assert simple.text?
284
293
  end
285
294
 
295
+ def test_text_eh_no_parser
296
+ refute @xref_data.text?
297
+
298
+ rd = RDoc::TopLevel.new 'rd_format.rd'
299
+
300
+ refute rd.text?
301
+ end
302
+
286
303
  end
287
304
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1923831869
4
+ hash: 1923831871
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 10
9
9
  - pre
10
- - 2
11
- version: 3.10.pre.2
10
+ - 3
11
+ version: 3.10.pre.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Eric Hodel
@@ -40,7 +40,7 @@ cert_chain:
40
40
  x52qPcexcYZR7w==
41
41
  -----END CERTIFICATE-----
42
42
 
43
- date: 2011-09-28 00:00:00 Z
43
+ date: 2011-10-01 00:00:00 Z
44
44
  dependencies:
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: json
@@ -147,23 +147,26 @@ executables:
147
147
  extensions: []
148
148
 
149
149
  extra_rdoc_files:
150
- - History.txt
151
150
  - Manifest.txt
152
- - README.txt
153
- - RI.txt
151
+ - History.rdoc
152
+ - LICENSE.rdoc
153
+ - README.rdoc
154
+ - RI.rdoc
155
+ - TODO.rdoc
154
156
  - Rakefile
155
157
  files:
156
158
  - .autotest
157
159
  - .document
158
- - History.txt
160
+ - History.rdoc
159
161
  - LICENSE.rdoc
160
162
  - Manifest.txt
161
- - README.txt
162
- - RI.txt
163
+ - README.rdoc
164
+ - RI.rdoc
163
165
  - Rakefile
164
166
  - TODO.rdoc
165
167
  - bin/rdoc
166
168
  - bin/ri
169
+ - lib/gauntlet_rdoc.rb
167
170
  - lib/rdoc.rb
168
171
  - lib/rdoc/alias.rb
169
172
  - lib/rdoc/anon_class.rb
@@ -179,7 +182,6 @@ files:
179
182
  - lib/rdoc/cross_reference.rb
180
183
  - lib/rdoc/encoding.rb
181
184
  - lib/rdoc/erbio.rb
182
- - lib/rdoc/gauntlet.rb
183
185
  - lib/rdoc/generator.rb
184
186
  - lib/rdoc/generator/darkfish.rb
185
187
  - lib/rdoc/generator/json_index.rb
@@ -199,7 +201,6 @@ files:
199
201
  - lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml
200
202
  - lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml
201
203
  - lib/rdoc/generator/template/darkfish/class.rhtml
202
- - lib/rdoc/generator/template/darkfish/fileinfo.rhtml
203
204
  - lib/rdoc/generator/template/darkfish/images/add.png
204
205
  - lib/rdoc/generator/template/darkfish/images/brick.png
205
206
  - lib/rdoc/generator/template/darkfish/images/brick_link.png
@@ -394,7 +395,7 @@ post_install_message: |
394
395
 
395
396
  rdoc_options:
396
397
  - --main
397
- - README.txt
398
+ - README.rdoc
398
399
  require_paths:
399
400
  - lib
400
401
  required_ruby_version: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file
data/RI.txt DELETED
@@ -1,58 +0,0 @@
1
- = RI
2
- == Background
3
- +ri+ is a tool that allows Ruby documentation to be viewed on the command-line.
4
- It is part of RDoc and is expected to work on any platform supported by Ruby.
5
-
6
- +ri+ will be a bit slow the first time that it runs (or any time that the
7
- underlying documentation changes) because it builds a cache in the +.ri+
8
- directory within the user's home directory in order to make future accesses
9
- faster.
10
-
11
- == Usage
12
- To see information for a class, do:
13
- ri class_name
14
-
15
- For example, for the +Array+ class, do
16
- ri Array
17
-
18
- To see information for an instance method, do:
19
- ri class_name#method_name
20
-
21
- For example, for Array's +join+ method, do:
22
- ri Array#join
23
-
24
- To see information for a class method, do:
25
- ri class_name.method_name
26
-
27
- For example, for Module's +private+ method, do:
28
- ri Module.private
29
-
30
- To search for all methods containing +read+, do:
31
- ri read
32
-
33
- To search for all methods starting with +read+, do:
34
- ri '^read'
35
-
36
- To search for all +read+ methods, do:
37
- ri '^read$'
38
-
39
- == Options
40
- +ri+ supports a variety of options, all of which can be viewed via +--help+.
41
- Of particular interest, are:
42
- [-d directory]
43
- List of directories from which to source documentation in addition to
44
- the standard directories. May be repeated. This can be used to specify
45
- the location of site-specific documentation (which can be generated with
46
- RDoc).
47
- [-i]
48
- This makes +ri+ go into interactive mode. When +ri+ is in interactive mode,
49
- it will allow the user to disambiguate lists of methods in case multiple
50
- methods match against a method search string. It also will allow the user
51
- to enter in a method name (with auto-completion, if readline is supported)
52
- when viewing a class.
53
- [-T]
54
- Send output to stdout, rather than to a pager.
55
-
56
- All options also can be specified through the +RI+ environment variable.
57
- Command-line options always override those specified in the +RI+ environment
58
- variable.
@@ -1,32 +0,0 @@
1
- <body class="file file-popup">
2
- <nav id="metadata">
3
- <dl>
4
- <dt class="modified-date">Last Modified
5
- <dd class="modified-date"><%= file.last_modified %>
6
-
7
- <% if file.requires %>
8
- <dt class="requires">Requires
9
- <dd class="requires">
10
- <ul>
11
- <% file.requires.each do |require| %>
12
- <li><%= require.name %>
13
- <% end %>
14
- </ul>
15
- <% end %>
16
-
17
- <% if @options.webcvs %>
18
- <dt class="scs-url">Trac URL
19
- <dd class="scs-url"><a target="_top"
20
- href="<%= file.cvs_url %>"><%= file.cvs_url %></a>
21
- <% end %>
22
- </dl>
23
- </nav>
24
-
25
- <div id="documentation">
26
- <% if file.comment %>
27
- <div class="description">
28
- <h2>Description</h2>
29
- <%= file.description %>
30
- </div>
31
- <% end %>
32
- </div>