Sha256: 01d840e4b8ba3dea1ffaaf5fe1f988aa67ae7cec019367b81848f5372afb6534
Contents?: true
Size: 416 Bytes
Versions: 6
Compression:
Stored size: 416 Bytes
Contents
require 'rabbit/utils' module Rabbit class Searcher def initialize(canvas) @canvas = canvas end def regexp(text) unless text == @text @text = text @regexp = nil end @regexp ||= internal_regexp end private def internal_regexp begin /#{@text}/iu rescue RegexpError /#{Regexp.escape(@text)}/iu end end end end
Version data entries
6 entries across 6 versions & 1 rubygems