[ANN] Text::Reform 0.2

K

Kaspar Schiess

Proud to announce the first release (0.2) of Text::Reform.

Text::Reform is a port of the Perl Text/Reform library. The original
port is done by me, Austin Ziegler has helped me getting the release
ready thereby avoiding public disgrace. This is why he gets public
thanks.

Version number will bump up to 1.0 once I judge the interface and
the code to be beautiful Ruby, right now it's just another port.

What does it do ?
-----------------

Reform#format takes a series of format (or "picture") strings followed
by replacement values, interpolates those values into each picture
string, and returns the result.

In examples:
# numbers...
r.format("]]]].[[", "1234\n123")

#> 1234.0
#> 123.0

# strings...
r.format("[[[[[[[[[[[[[[", "The Newton-Raphson methodology")

#> The Newton-Ra-
#> phson methodo-
#> logy

# and combinations:
text = "A big long piece of text to be formatted exquisitely"
count = 1
output = ''
output << r.format(" |||| <<<<<<<<<< ", count, text)
output << r.format(" ---------------- ",
" ^^^^ ]]]]]]]]]]| ", count+11, text)

#> 1 A big long
#> ----------------
#> 12 piece of|
#> text to be|
#> formatted|
#> exquisite-|
#> ly|

Where can I get it ?
--------------------

As a gem:

gem install text-reform

Or as a source tar.gz:

http://rubyforge.org/frs/?group_id=294

What can I do for you ?
-----------------------

You can send me feedback and/or post bugs on our
Text-Formatting rubyforge page located at

http://rubyforge.org/projects/text-format

You can also join our mailing lists and discuss your text formatting
needs with us.

Enjoy !

kaspar
on behalf of the Text Formatting project team

www.tua.ch/ruby
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top