duplication of comments #8

Merged
merged 1 commit into from Sep 11, 2012
File renamed without changes.
@@ -34,12 +34,9 @@ def self.process(options)
lines = file.readlines
# remove current encoding comment(s)
- while lines[0] && (
- lines[0].starts_with?(comment_style.sub('{text}', 'encoding')) ||
- lines[0].starts_with?(comment_style.sub('{text}', 'coding')) ||
- lines[0].starts_with?(comment_style.sub('{text}', '-*- encoding')))
- lines.shift
- end
+ while lines[0].match(/^-?# ?(-\*-)? ?(en)?coding/)
+ lines.shift
+ end
# set current encoding
lines.insert(0,comment_style.sub('{text}', prefix))