Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing search by existing comments

  • Loading branch information...
commit ea62967e3911ee3f597987df6413da3c6c93b8cb 1 parent 3de60d4
@americodls americodls authored
Showing with 3 additions and 6 deletions.
  1. 0  Changelog → CHANGELOG
  2. +3 −6 lib/magic_encoding.rb
View
0  Changelog → CHANGELOG
File renamed without changes
View
9 lib/magic_encoding.rb
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.