Write flexible, customisable tables in the console.
Installation
To install Tabbit via RubyGems:
$ gem install tabbit
Or add this line to your application's Gemfile:
gem 'tabbit'
And then execute:
$ bundle
Usage
To make a new Table initialise Tabbit, passing in the Headers as the params:
table = Tabbit.new('Name', 'Email', 'Phone No.')
To add an entry:
table.add_row('Tim Green', 'tiimgreen@gmail.com', '123-456-789')
To print the table:
puts table.to_s
require 'tabbit'
table = Tabbit.new('Name', 'Email', 'Phone No.')
10.times do |n|
table.add_row("Tim Green #{n}", "tiimgreen#{n}@gmail.com", "123-456-789")
end
puts table.to_s
Contributing
- Fork it (http://github.com/tiimgreen/tabbit/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request