Installing UnicodeUtils¶ ↑
The easiest way to install UnicodeUtils is with RubyGems:
$ gem install unicode_utils
Manual installation¶ ↑
Two kinds of files must be installed:
-
The library code. All files under
lib/andlib/unicode_utils/with suffix.rb. The whole tree underlib/must be on the load path. -
The compiled Unicode data files under
cdata/. UnicodeUtils loads them from theUnicodeUtils::CDATA_DIRdirectory, which is defined inread_cdata.rb.
The best strategy is to copy the library files to Ruby's
sitelibdir. You can get that by running:
$ ruby -r rbconfig -e "puts Config::CONFIG['sitelibdir']"
Then copy all files under cdata/ to
<sitelibdir>/unicode_utils. And last but not least,
change the definition of CDATA_DIR in
<sitelibdir>/unicode_utils/read_cdata.rb to
File.absolute_path(File.dirname(_\FILE\_)).
In fact, UnicodeUtils comes with an install.rb script that does all that:
$ ruby install.rb install
or:
$ ruby install.rb install /some/other/dir