fixes a couple of regexps, the suite showed warnings about them

A couple of things worth mentioning here:

 - "{" is a metacharacter, should be escaped
   if it is meant to match a "{". The code
   worked, though, because the regexp engine
   is tolerant to this, but issued warnings.

 - gsub accepts a string as first argument.
   That's the best idiom to use when your
   pattern has no metacharacters, since gsub
   interprets the string as an exact substring
   to look for, rather than a regexp. The
   benefit is that your pattern is crystal
   clear and needs no backslashes.
This commit is contained in:
Xavier Noria 2011-03-27 20:45:23 +02:00
parent cc6fa2f4d7
commit b2d94322e6

@ -157,8 +157,8 @@ def build_query(path, exts)
query.gsub!(/\:#{ext}/, "{#{variants.compact.uniq.join(',')}}")
}
query.gsub!(/\.{html,/, ".{html,text.html,")
query.gsub!(/\.{text,/, ".{text,text.plain,")
query.gsub!('.{html,', '.{html,text.html,')
query.gsub!('.{text,', '.{text,text.plain,')
File.expand_path(query, @path)
end