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

bogo-ui

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bogo-ui

  • 0.4.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Bogo UI

Simple CLI output helpers.

Bogo::Ui

Output formatted information to the CLI.

require 'bogo/ui'

ui = Bogo::Ui.new(
  app_name: 'TestApp'
)

ui.info 'This is information'
ui.warn 'This is a warning'
ui.error 'This is an error'

ui.info "This is information with #{ui.color('color', :bold, :green)}"

result = ui.ask('Type a word')
ui.info "You provided: #{result}"

Bogo::Ui::Table

This is a table helper. Under the hood it uses the Command Line Reporter with a few modifications. Direct usage:

require 'bogo/ui'

ui = Bogo::Ui.new(app_name: 'TestApp')
Bogo::Ui::Table.new(ui) do
  table do
    row do
      column 'Name'
      column 'Age'
    end
    row do
      column 'me'
      column '100'
    end
  end
end.display

This helper allows for appending data to an existing table. Useful for when polling for updates and wanting to keep the existing table structure:

require 'bogo/ui'

ui = Bogo::Ui.new(app_name: 'TestApp')
tbl = Bogo::Ui::Table.new(ui) do
  table do
    row do
      column 'Name'
      column 'Age'
    end
    row do
      column 'me'
      column '100'
    end
  end
end

tbl.display

tbl.update do
  row do
    column 'you'
    column '50'
  end
end

tbl.display

Info

  • Repository: https://github.com/spox/bogo-ui
  • Command Line Reporter: https://github.com/wbailey/command_line_reporter

FAQs

Package last updated on 04 Jul 2022

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