1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

lib/unicode_normalize.rb: Importing from

https://github.com/duerst/eprun/blob/master/lib/string_normalize.rb.
(removing trailing whitespace, fixing EOLs and adding EOL property)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2014-10-19 01:04:10 +00:00
parent deeb1313bc
commit e4f71908d6
2 changed files with 28 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Sun Oct 19 10:04:04 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
* lib/unicode_normalize.rb: Importing from
https://github.com/duerst/eprun/blob/master/lib/string_normalize.rb.
(removing trailing whitespace, fixing EOLs and adding EOL property)
Sun Oct 19 09:56:56 2014 Martin Duerst <duerst@it.aoyama.ac.jp>
* tool/unicode_norm_gen.rb: Changed module name.

22
lib/unicode_normalize.rb Normal file
View file

@ -0,0 +1,22 @@
# coding: utf-8
# Copyright 2010-2013 Ayumu Nojima (野島 歩) and Martin J. Dürst (duerst@it.aoyama.ac.jp)
# available under the same licence as Ruby itself
# (see http://www.ruby-lang.org/en/LICENSE.txt)
require File.dirname(__FILE__) + '/normalize'
class String
def normalize(form = :nfc)
Normalize.normalize(self, form)
end
def normalize!(form = :nfc)
replace(self.normalize(form))
end
def normalized?(form = :nfc)
Normalize.normalized?(self, form)
end
end