GithubHelp home page GithubHelp logo

initdc / ansi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rubyworks/ansi

0.0 1.0 0.0 1.81 MB

Set of ANSI Code based classes and modules for Ruby

Home Page: https://rubyworks.github.com/ansi

License: BSD 2-Clause "Simplified" License

Ruby 81.78% C++ 15.36% R 0.91% Makefile 1.95%

ansi's Introduction

ANSI

HOME · API · ISSUES · SOURCE

Build Status


The ANSI project is a collection of ANSI escape code related libraries enabling ANSI code based colorization and stylization of output. It is very nice for beautifying shell output.

This collection is based on a set of scripts spun-off from Ruby Facets. Included are Code (used to be ANSICode), Logger, ProgressBar and String. In addition the library includes Terminal which provides information about the current output device.

Features

  • ANSI::Code provides ANSI codes as module functions.
  • String#ansi makes common usage very easy and elegant.
  • ANSI::Mixin provides an alternative mixin (like +colored+ gem).
  • Very Good coverage of standard ANSI codes.
  • Additional clases for colorized columns, tables, loggers and more.

Synopsis

There are a number of modules and classes provided by the ANSI package. To get a good understanding of them it is best to pursue the QED documents or the API documentation.

At the heart of all the provided libraries lies the ANSI::Code module which defines ANSI codes as constants and methods. For example:

require 'ansi/code'

ANSI.red + "Hello" + ANSI.blue + "World"
=> "\e[31mHello\e[34mWorld"

Or in block form.

ANSI.red{ "Hello" } + ANSI.blue{ "World" }
=> "\e[31mHello\e[0m\e[34mWorld\e[0m"

The methods defined by this module are used throughout the rest of the system.

Installation

Bundler

Add the usual gem line to your project's Gemfile.

gem 'ansi'

And run then bundle command.

RubyGems

To install with RubyGems simply open a console and type:

$ sudo gem install ansi

Setup.rb (not recommended)

Local installation requires Setup.rb (gem install setup), then download the tarball package and type:

$ tar -xvzf ansi-1.0.0.tgz
$ cd ansi-1.0.0
$ sudo setup.rb all

Windows users use 'ruby setup.rb all'.

Release Notes

Please see HISTORY.md file.

License & Copyrights

Copyright (c) 2009 Rubyworks

This program is redistributable under the terms of the FreeBSD license.

Some pieces of the code are copyrighted by others.

See LICENSE.txt and NOTICE.md files for details.

ansi's People

Contributors

apotheon avatar deepj avatar grosser avatar junegunn avatar sixeight avatar trans avatar

Watchers

 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.