# encoding: utf-8 require 'forkforge/internal/code_point' require 'forkforge/internal/unicode_data' require 'forkforge/internal/special_casing' module Forkforge class UnicodeException < Exception end module Unicode [:uppercase, :lowercase, :titlecase].each { |method| class_eval %Q{ def #{method}(s, lang = nil, context = nil) s.each_codepoint.map { |cp| pretendent = SpecialCasing::#{method}(cp, lang, context) (pretendent.codepoints.count == 1 && pretendent.codepoints.first == cp) ? \ UnicodeData::to_char(cp, :#{method}_mapping) : pretendent }.join end } } def camel_to_underscore s, constant = false result = s.gsub(/(?