~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to lib/rdoc/parser/simple.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
##
2
2
# Parse a non-source file. We basically take the whole thing as one big
3
 
# comment. If the first character in the file is '#', we strip leading pound
4
 
# signs.
 
3
# comment.
5
4
 
6
5
class RDoc::Parser::Simple < RDoc::Parser
7
6
 
32
31
    @top_level
33
32
  end
34
33
 
35
 
  def remove_private_comments(comment)
36
 
    comment.gsub(/^--\n.*?^\+\+/m, '').sub(/^--\n.*/m, '')
 
34
  ##
 
35
  # Removes comments wrapped in <tt>--/++</tt>
 
36
 
 
37
  def remove_private_comments text
 
38
    text.gsub(/^--\n.*?^\+\+/m, '').sub(/^--\n.*/m, '')
37
39
  end
38
40
 
 
41
  ##
 
42
  # Removes the encoding magic comment from +text+
 
43
 
39
44
  def remove_coding_comment text
40
45
    text.sub(/\A# .*coding[=:].*$/, '')
41
46
  end