@@ -36,8 +36,9 @@ def initialize(source_file)
36
36
37
37
##
38
38
#
39
- # The following two functions only print what you throw at them.
40
- # With an option of displaying the line number.
39
+ # The following two functions only print what you throw at them,
40
+ # with the option of displying the line number. error() is meant
41
+ # for mistakes that might actually break something.
41
42
#
42
43
##
43
44
@@ -61,21 +62,22 @@ def error(txt, line=0)
61
62
def check_badchars
62
63
badchars = %Q|&<=>|
63
64
64
- in_super = false
65
- in_author = false
65
+ in_super = false
66
+ in_author = false
67
+ is_text = false
68
+ is_comment = false
66
69
67
- # First off, we need to capture the "super()" code block.
68
- # That's where we want to check our badchars.
69
70
@source . each_line do |line |
70
71
#
71
72
# Mark our "super" code block
72
73
#
73
- if !in_super and line =~ /[\n \t ]+super\( /
74
+ if line =~ /^#/ or line =~ /^=begin/
75
+ next
76
+ elsif !in_super and line =~ /[\n \t ]+super\( /
74
77
in_super = true
75
- elsif in_super and line =~ /(.+)\) \n /
76
- if $1 !~ /#/
77
- in_super = false
78
- end
78
+ elsif in_super and line =~ /[[:space:]]*def \w +[\( \w +\) ]*/
79
+ in_super = false
80
+ break
79
81
end
80
82
81
83
#
@@ -193,7 +195,7 @@ def check_title_format
193
195
[ words . first , words . last ] . each do |word |
194
196
if word [ 0 , 1 ] =~ /[a-z]/ and word [ 1 , 1 ] !~ /[A-Z0-9]/
195
197
next if word =~ /php[A-Z]/
196
- next if %w{ iseemedia activePDF freeFTPd osCommerce myBB qdPM } . include? word
198
+ next if %w{ iseemedia activePDF freeFTPd osCommerce myBB qdPM inetd wallet.dat } . include? word
197
199
warn ( "Improper capitalization in module title: '#{ word } ...'" )
198
200
end
199
201
end
0 commit comments