descriptionCombining many of the benefits of Arrays and Strings, StringRay allows you to treat a String as an Array of words in many cases.
homepage URLhttp://github.com/elliottcable/stringray
ownerrepo.or.cz@elliottcable.com
last changeWed, 17 Jun 2009 04:49:02 +0000 (16 20:49 -0800)
content tags
add:
README.markdown

StringRay

StringRay exposes a powerful method to split a String into an Array of words, and further allows you to include Enumerable, thus exposing many of the most useful Array methods on your Strings.

Usage

Basic usage is really simple. Just take a normal String (the StringRay magic has already been included for you) and enumerate over it, just as you are used to doing with Arrays. By default, this enumerates over the "words" in the string.

"Oi! I'm a string, do something fun with me!".enumerate do |word|
  p word
end

"Who, what, when, where, why? The questions these are.".map do |word|
  word << word[0]
end

You can gain a lot more fine-grained control over how the string is treated by passing arguments to the enumerator methods, or by explicitly creating a StringRay enumerator and modifying it.

TODO: More examples and usage summaries!

Getting

The authoritative source for this project is available at <http://github.com/elliottcable/stringray>. You can clone your own copy with the following command:

git clone git://github.com/elliottcable/stringray.git

If you want to make changes to the codebase, you need to fork your own GitHub repository for said changes. Send a pullrequest to elliottcable when you've got something ready for the master branch that you think should be merged.

Requirements

To use StringRay, you need... nothing!

Contributing

To develop and contribute to StringRay, you need...

Mirrors

If GitHub is unavailable, or you prefer to fork one one of the following sources, they are also available:

shortlog
2009-06-17 elliottcableUpdated the README with more relevant data.master
2009-06-17 elliottcableRemoved the useless core_ext. Back down to two files...
2009-06-17 elliottcableCompletely re-worked the Rakefile, using a lot from...
2009-06-12 elliottcableNo need to do this on #included.
2009-06-12 elliottcableMoved #enumerate onto StringRay. Now String#enumerate...
2009-06-12 elliottcableAdding a few more (cleaned) specs
2009-06-12 elliottcableAdding a prettier inspect
2009-06-12 elliottcableMaking the convenience methods into class methods
2009-06-12 elliottcableGetting rid of a ton of spec cruft, and starting over...
2009-06-12 elliottcableMoving a ton of the includables into their own file
2009-06-11 elliottcableMoving a chunk of functionality into Stringray::Includes
2009-06-11 elliottcableVersion bump to 3
2009-06-11 elliottcableChanged the version constant from VERSION to Version
2009-06-11 elliottcablePushing a Ruby warning when overriding String#each...
2009-06-11 elliottcableThe old and broken String#each doesn't exist in Ruby...
2009-06-11 elliottcableUh, was I retarded? ::new isn't an instance method.
...
heads
14 years ago master