Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

utils_drawer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

utils_drawer

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

UtilsDrawer

Helper for drawing utils on CLI.

Description

UtilsDrawer will help to draw utils such as a table or graph.

Supporting the simple drawing by using Ruby's Block syntax.

Installation

Add this line to your application's Gemfile:

gem 'utils_drawer'

Usage

Table Drawer

Adjeust the column width at first row. The column width is 10 by the default. It is also possible to specify the column width in UtilsDrawer.column second argument.

require 'utils_drawer'

include UtilsDrawer

table do
  row do
    column('NAME')
    column('SCORE', 20)
    column('AGE')
  end
  row do
    column('kaihara')
    column('100,000,000')
    column('22')
  end
  row do
    column('hogefugahara')
    column('200,000,000')
    column('33')
  end
end

If the number of characters exceeds the column width, it is omitted.

table

If you want to change the column width of the default:

...

table(20) do
...
end

Graph Drawer

UtilsDrawer.data accepts the data label in the first argument, the value in the second argument. The value is the bar length. The color of the bar is determined by the bar length.

require 'utils_drawer'

include UtilsDrawer

graph do
  data('foo', 10)
  data('hoge', 17)
  data('nullpo', 0)
  data('nullnull', 0)
  data('nuller', 0)
  data('nullest', 0)
  data('bar', 7)
  data('fuga', 24)
end

Be omitted value is 0 to continue.

graph1

If you don't want to omit:

...

graph({ omission: false }) do
...
end

graph2

FAQs

Package last updated on 15 Oct 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