Giter Club home page Giter Club logo

lovely_rufus's Introduction

Lovely Rufus

Lovely Rufus is an executable and a Ruby library for wrapping paragraphs of text in the spirit of Par.

Usage

Lovely Rufus can be used from the command-line by piping text through the lovely-rufus executable:

$ echo 'The Ballyshannon foundered off the coast of Cariboo, And down in fathoms many went the captain and the crew;' | lovely-rufus
The Ballyshannon foundered off the coast of Cariboo,
And down in fathoms many went the captain and the crew;

Lovely Rufus can also be used from Ruby code through the wrap method:

$ irb
>> require 'lovely_rufus'
>> text = 'The Ballyshannon foundered off the coast of Cariboo, And down in fathoms many went the captain and the crew;'
>> puts LovelyRufus.wrap(text)
The Ballyshannon foundered off the coast of Cariboo,
And down in fathoms many went the captain and the crew;

Note that wrap can take optional desired width:

$ irb
>> require 'lovely_rufus'
>> text = 'The Ballyshannon foundered off the coast of Cariboo, And down in fathoms many went the captain and the crew;'
>> puts LovelyRufus.wrap(text, width: 15)
The
Ballyshannon
foundered off
the coast of
Cariboo, And
down in fathoms
many went the
captain and
the crew;

Features

Currently, Lovely Rufus sports the following features:

  • paragraphs are wrapped to the specified width,
  • one-letter words are not left at ends of lines,
  • email quotes (>) are handled properly and normalised (> > >>>>),
  • email-quoted paragraph breaks are cleared,
  • code comments (starting with # and //) are handled properly,
  • multiple paragraphs are wrapped independently.

Name and history

Lovely Rufus was created as a Ruby Mendicant University project and is named after a certain Love Actually character who’s exceptionally good at wrapping.


© MMX-MMXIX Piotr Szotkowski [email protected], licensed under AGPL-3.0 (see LICENCE)

lovely_rufus's People

Contributors

chastell avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.