Skip to content

Nowaker/ruby-ansi-sys-revived

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

ansi-sys-revived is a library to render texts with ANSI escape sequences. Revived from RubyForge.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages