This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
unichars /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
LICENSE | Mon Nov 24 10:50:40 -0800 2008 | |
| |
README | Mon Nov 24 10:50:40 -0800 2008 | |
| |
Rakefile | ||
| |
ext/ | ||
| |
lib/ | ||
| |
test/ | ||
| |
unichars.gemspec |
README
-%{ Unichars }%-
Unichars is a simple wrapper around Glib2. It was originally written to speed up ActiveSupport::Multibyte on Ruby 1.8
but it can probably used for other things as well.
--^^--^^- INSTALLING -^^--^^--
INSTALLING ON MAC OS X
$ port install glib2
$ gem install unichars
INSTALLING ON DEBIAN
$ apt-get install libglib2.0-dev
$ gem install unichars
--^^--^^- EXAMPLES -^^--^^--
FOR USE WITH RAILS
In config/environment.rb add:
config.gem 'unichars'
Add config/initializers/unichars.rb:
ActiveSupport::Multibyte.proxy_class = Unichars
After that you can just use Unichars through the character proxy on String:
'¡Ay Dios mío!'.chars.reverse
FOR USE WITH ACTIVESUPPORT WITHOUT RAILS
Note that you probably want to load ActiveSupport before loading Unichars because Unichars subclasses itself from
ActiveSupport::Multibyte::Chars when you do so.
require 'rubygems' rescue LoadError
require 'activesupport'
require 'unichars'
ActiveSupport::Multibyte.proxy_class = Unichars
After that you can just use Unichars through the character proxy on String:
'¡Ay Dios mío!'.chars.reverse
FOR USE WITHOUT ACTIVESUPPORT
Yeah, so, ehm. Yeah.
require 'rubygems' rescue LoadError
require 'unichars'
After that you can do:
Unichars.new('¡Ay Dios mío!').reverse
Or maybe:
class String
def chars
Unichars.new(self)
end
end







