Announcing the Marginalise Ruby gem

As part of a much larger project I have made a simple gem for automatically realigning strings to an arbitrary right hand margin.

require “marginalise”
puts “This is a long string for the sake of testing the marginalise gem”.marginalise(10)
This is a
long
string
for the
sake of
testing
the
marginalise
gem

The full code is available here.

I might add more specific arguments (left and right margins) and inserting a hyphen in a phonetically sensible location in the future but don’t hold your breath.

By Ryan McCoskrie

I am a nerd trapped in the country side of North Canterbury, New Zealand trying to get an IT-related career off of the ground. Legal disclaimer: Ryan McCoskrie is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com I'm also signed up with Fishpond but they aren't as strict about this stuff.

Leave a comment