New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

tablegen

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tablegen

  • 0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Table Generator

Plain text table generator for ruby.

Main features:

  • Choose column/header alignment (left, center or right)
  • CJK characters support
  • Embed progress bars (example in the documentation)
  • Insert text in the table
  • Minimum column length
  • Optional size constraint
  • Per column data formatter (data is separated from the layout)
  • Scale down large tables with collapsible columns
  • Scale up small tables with stretchable columns
  • Unlimited border length

Installation

Add this line to your application's Gemfile:

gem 'tablegen'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tablegen

Documentation

The documentation is hosted at http://rubydoc.info/gems/tablegen/TableGen.

Basic Usage

require 'tablegen'

table = TableGen.new
table.header 'Browser Name', 'Layout Engine', 'License'
table.separator
table.row 'Chromium', 'Blink', 'BSD'
table.row 'dwb', 'WebKit', 'GNU GPLv3'
table.row 'Internet Explorer', 'Trident', 'Proprietary'
table.row 'Mozilla Firefox', 'Gecko', 'MPL'
puts table

Output:

Browser Name      Layout Engine License
===========================================
Chromium          Blink         BSD
dwb               WebKit        GNU GPLv3
Internet Explorer Trident       Proprietary
Mozilla Firefox   Gecko         MPL

Set the size constraint and stretch the first column:

table.width = 50
table.column 0 do |col|
  col.stretch = true
end
puts table

Output:

Browser Name             Layout Engine License
==================================================
Chromium                 Blink         BSD
dwb                      WebKit        GNU GPLv3
Internet Explorer        Trident       Proprietary
Mozilla Firefox          Gecko         MPL

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Test your changes (rake)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request

FAQs

Package last updated on 15 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc