wbailey / command_line_reporter

A gem for making it easy to produce a report while a ruby script is executing
Apache License 2.0
432 stars 23 forks source link

Command Line Reporter Build Status Code Climate Gem Version

This gem provides a DSL that makes it easy to write reports of various types in ruby. It eliminates the need to litter your source with puts statements, instead providing a more readable, expressive interface to your application. Some of the best features include:

The latest release, thanks to a contribution from Josh Brown, allows you to choose between UTF8 or ASCII for drawing tables. By default it will use UTF8 if your system supports it. Here is an example of output you can generate easily with "the reporter":

Screenshot

Installation

It is up on rubygems.org so add it to your bundle in the Gemfile

gem 'command_line_reporter', '>=3.0'

or do it the old fashioned way:

gem install command_line_reporter

Usage

The gem provides a mixin that can be included in your scripts.

require 'command_line_reporter'

class MyReport
  include CommandLineReporter
  ...
end

Wiki

The Wiki has all of the documentation necessary for getting you started.

API Reference

There are several methods the mixin provides that do not depend on the formatter used:

To Do

Contributors

License

Copyright (c) 2011-2017 Wes Bailey

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.