Sha256: 78db01f2f120828b02bee823bdcb2983390598a100ea8396537d686b80e27e46

Contents?: true

Size: 540 Bytes

Versions: 3

Compression:

Stored size: 540 Bytes

Contents

#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

#==========================
# utils.rb
#==========================
#
# Image utility functions to inspect text font metrics
#
# This file is part of RSyntaxTree, which is a ruby port of Andre Eisenbach's
# excellent program phpSyntaxTree.
#
# Copyright (c) 2007-2018 Yoichiro Hasebe <yohasebe@gmail.com>
# Copyright (c) 2003-2004 Andre Eisenbach <andre@ironcreek.net>

class String
  def contains_cjk?
    !!(self =~ /\p{Han}|\p{Katakana}|\p{Hiragana}|\p{Hangul}/)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rsyntaxtree-0.7.6 lib/rsyntaxtree/utils.rb
rsyntaxtree-0.7.5 lib/rsyntaxtree/utils.rb
rsyntaxtree-0.7.3 lib/rsyntaxtree/utils.rb