Skip to content

Shadowsith/cli-textformat-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cli-textformat-cpp

Textformat-ruby is a lightweight ruby library to write colored and formated code onto the linux terminal/cli.
It is capusled as good as possible to has no overhead for the library user and uses the 'Text' module as namespace.

Motivation

I was inspired by this stackoverflow post to make a good color/simple format library for Ruby error and test messages on linux terminal.

Features

  • Coloring text (black, red, green, yellow, blue, magenta, cyan, white)
    • foreground and background support
  • bold, underline and inverse text
  • multiline support

Installation

  • Copy src/textformat.rb to your project

Examples

The test.rb file shows how you can use the library.

Below are also some examples:

format = Text::Format.new

puts format.green("Hello World!")
puts format.green("Multiline example", true)
puts "Test"
puts "Hello" + format.disable_multiline
puts "Normal"
puts format.bold(format.underline(format.red("Error Message:")))

TODO

  • port to other languages when finished

Support

If some errors appears please write a issue that I can fix it.

See also

License

MIT

About

Ruby lib to dye messages that are printed to the linux-cli

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages