No commit activity in last 3 years
No release in over 3 years
A library to render texts with ANSI escape sequences. Revived from RubyForge.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

ansi-sys-revived

Gem Version GPA Code coverage Build status Dependcies status

ansi-sys-revived is a Ruby library to render texts with ANSI escape sequences. Convert your colorful shell output to HTML code.

Original version, Ruby-ANSI.SYS, was developed on RubyForge. Original website is ansi-sys.rubyforge.org. kazz187 was the first to import the project to GitHub.

Installation

Add this line to your application's Gemfile:

gem 'ansi-sys-revived'

Then execute:

$ bundle

Gem works on Ruby 1.9.3, 2.0 and 2.1. Use original ansi-sys for Ruby 1.8.

Usage

Show with the default ANSI colors:

require 'ansisys'
terminal = AnsiSys::Terminal.new
terminal.echo("Hello \e[32mWorld\e[m")
terminal.render #=> HTML fragment

Or with brigher colors:

require 'ansisys'
terminal.render(:html, 80, nil, AnsiSys::Screen.default_css_colors(false, true))

Tests

You can run through spec files:

$ bundle exec rake spec

Contributing

  1. Fork it
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Create a pull request
  6. Include this text in the description: I hereby license the submitted code under GNU GPL v3.
  7. Thanks!

License

Copyright (c) 2014 StratusHost Damian Nowak

Licensed under GNU GPL v3. See LICENSE file.

Original copyright note:

Ruby-ANSI.SYS Copyright (C) 2007 zunda unless otherwise stated.

This program is free software. You can distribute/modify this program under the terms of the GNU LGPL, Lesser General Public License version 2.1.