File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -208,15 +208,14 @@ def check_disclosure_date
208
208
end
209
209
end
210
210
211
- def check_title_format
212
- if @source =~ /'Name'\s +=>\s [\x22 \x27 ](.+)[\x22 \x27 ],\s *$/
213
- name = $1
211
+ def check_title_casing
212
+ if @source =~ /'Name'[[:space:]]*=>[[:space:]]*['|"](.+)['|"],*$/
214
213
words = $1. split
215
- [ words . first , words . last ] . each do |word |
216
- if word [ 0 , 1 ] =~ /[a-z]/ and word [ 1 , 1 ] !~ /[A-Z0-9]/
217
- next if word =~ /php[A-Z]/
218
- next if %w{ iseemedia activePDF freeFTPd osCommerce myBB qdPM inetd wallet.dat } . include? word
219
- warn ( "Improper capitalization in module title: '#{ word } ... '" )
214
+ words . each do |word |
215
+ if %w{ and or the for to in of as with a an } . include? ( word )
216
+ next
217
+ elsif word =~ /^[a-z]+$/
218
+ warn ( "Improper capitalization in module title: '#{ word } '" )
220
219
end
221
220
end
222
221
end
@@ -329,7 +328,7 @@ def run_checks(f_rel)
329
328
tidy . test_old_rubies ( f_rel )
330
329
tidy . check_ranking
331
330
tidy . check_disclosure_date
332
- tidy . check_title_format
331
+ tidy . check_title_casing
333
332
tidy . check_bad_terms
334
333
tidy . check_function_basics
335
334
tidy . check_lines
You can’t perform that action at this time.
0 commit comments