Sha256: 7427dfd7e314f26e338a76d7a2069084c8f2edd40ce8872f8dba82c951ef67f8

Contents?: true

Size: 532 Bytes

Versions: 5

Compression:

Stored size: 532 Bytes

Contents

module Langusta
  module Codepoints
    GSUB_SELECTOR = RUBY_VERSION < "1.9" ? :gsub18 : :gsub19

    def self.gsub!(codepoint_array, regex, replacement)
      string = Langusta.cp2utf8(codepoint_array)
      string = send(GSUB_SELECTOR, string, regex, replacement)
      codepoint_array.replace(Langusta.utf82cp(string))
    end

    def self.gsub18(string, oregex, replacement)
      oregex.gsub(string, replacement)
    end

    def self.gsub19(string, regex, replacement)
      string.gsub(regex, replacement)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
langusta-0.2.4 lib/langusta/codepoints.rb
langusta-0.2.3 lib/langusta/codepoints.rb
langusta-0.2.2 lib/langusta/codepoints.rb
langusta-0.2.1 lib/langusta/codepoints.rb
langusta-0.2.0 lib/langusta/codepoints.rb