Parent

RDoc::Parser::Simple

Parse a non-source file. We basically take the whole thing as one big comment. If the first character in the file is ’#’, we strip leading pound signs.

Public Class Methods

new(top_level, file_name, content, options, stats) click to toggle source

Prepare to parse a plain file

    # File lib/rdoc/parser/simple.rb, line 15
15:   def initialize(top_level, file_name, content, options, stats)
16:     super
17: 
18:     preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include
19: 
20:     preprocess.handle @content, @top_level
21:   end

Public Instance Methods

remove_coding_comment(text) click to toggle source
    # File lib/rdoc/parser/simple.rb, line 39
39:   def remove_coding_comment text
40:     text.sub(/\A# .*coding[=:].*$/, '')
41:   end
remove_private_comments(comment) click to toggle source
    # File lib/rdoc/parser/simple.rb, line 35
35:   def remove_private_comments(comment)
36:     comment.gsub(/^--\n.*?^\+\+/, '').sub(/^--\n.*/, '')
37:   end
scan() click to toggle source

Extract the file contents and attach them to the TopLevel as a comment

    # File lib/rdoc/parser/simple.rb, line 26
26:   def scan
27:     comment = remove_coding_comment @content
28:     comment = remove_private_comments comment
29: 
30:     @top_level.comment = comment
31:     @top_level.parser = self.class
32:     @top_level
33:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.