Permalink
Browse files

Prepare for release.

Add LICENSE and gemspec. Update README.
  • Loading branch information...
1 parent a864ebc commit 52ea938b3b9f4bbd505cc84e303719119fbb6c93 @Manfred committed Nov 24, 2008
Showing with 102 additions and 3 deletions.
  1. +18 −0 LICENSE
  2. +61 −3 README
  3. +23 −0 unichars.gemspec
View
18 LICENSE
@@ -0,0 +1,18 @@
+Copyright (c) 2008 Manfred Stienstra, Fingertips <manfred@fngtps.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
64 README
@@ -1,7 +1,65 @@
-OSX
+-%{ 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
-DEBIAN
+Or maybe:
-$ apt-get install libglib2.0-dev
+ class String
+ def chars
+ Unichars.new(self)
+ end
+ end
View
@@ -0,0 +1,23 @@
+require 'rubygems'
+
+Gem::Specification.new do |spec|
+ spec.name = 'Unichars'
+ spec.version = '0.1'
+
+ spec.author = "Manfred Stienstra"
+ spec.email = "manfred@fngtps.com"
+
+ spec.description = <<-EOF
+ Unichars is a wrapper around Glib2 UTF8 functions.
+ EOF
+ spec.summary = <<-EOF
+ Unichars is a wrapper around Glib2 UTF8 functions. It was written to speed up ActiveSupport::Multibyte, but I'm sure
+ people can find other uses for it.
+ EOF
+
+ spec.files = Dir['lib/**/*.rb']
+
+ spec.has_rdoc = true
+ spec.extra_rdoc_files = ['README', 'LICENSE']
+ spec.rdoc_options << "--charset=utf-8"
+end

0 comments on commit 52ea938

Please sign in to comment.