Silence Some Stupid Warnings in Ruby 1.9

This commit is contained in:
Jacques Distler 2009-12-18 23:53:43 -06:00
parent 76f388f3e2
commit 9874650e4b
2 changed files with 4 additions and 2 deletions

View file

@ -71,7 +71,9 @@ module WikiChunk
attr_reader :escaped_text
unless defined? WIKI_WORD
WIKI_WORD = Regexp.new('(":)?(\\\\)?(' + WikiWords::WIKI_WORD_PATTERN + ')\b', 0, 'u')
WIKI_WORD = ''.respond_to?(:force_encoding) ?
Regexp.new('(":)?(\\\\)?(' + WikiWords::WIKI_WORD_PATTERN + ')\b', 0) :
Regexp.new('(":)?(\\\\)?(' + WikiWords::WIKI_WORD_PATTERN + ')\b', 0, 'u')
end
def self.pattern