Silence Some Stupid Warnings in Ruby 1.9
This commit is contained in:
parent
76f388f3e2
commit
9874650e4b
|
@ -11,7 +11,7 @@ module Chunk
|
||||||
|
|
||||||
# Rails's default utf-8 support causes problems here. So, for Chunk::Abstract class, turn off
|
# Rails's default utf-8 support causes problems here. So, for Chunk::Abstract class, turn off
|
||||||
# multibyte character support.
|
# multibyte character support.
|
||||||
$KCODE = 'n'
|
$KCODE = 'n' unless ''.respond_to?(:force_encoding)
|
||||||
|
|
||||||
# automatically construct the array of derivatives of Chunk::Abstract
|
# automatically construct the array of derivatives of Chunk::Abstract
|
||||||
@derivatives = []
|
@derivatives = []
|
||||||
|
|
|
@ -71,7 +71,9 @@ module WikiChunk
|
||||||
attr_reader :escaped_text
|
attr_reader :escaped_text
|
||||||
|
|
||||||
unless defined? WIKI_WORD
|
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
|
end
|
||||||
|
|
||||||
def self.pattern
|
def self.pattern
|
||||||
|
|
Loading…
Reference in a new issue