Project

cork

1.61
No commit activity in last 3 years
No release in over 3 years
A delightful CLI UI module.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.1
~> 1.3
>= 10.0

Runtime

~> 3.1
 Project Readme

Cork

A delightful CLI UI module.

Usage

board = Cork::Board.new()

You can use Cork to print simple messages.

board.puts('Hello World')

You can use notice to print notices to the user colored in green.

board.notice("We're out of 🍷.")

This is an example of Cork used to build a simple list.

board.section('Types of Wine') do
  board.labeled('Red', ['Shiraz', 'Merlot'])
  board.labeled('White', ['Gewürztraminer', 'Riesling'])
end
Types of Wine
  - Red:
    - Shiraz
    - Merlot
  - White:
    - Gewürztraminer
    - Riesling

This is an example of Cork used to print a warning with actions the user can take.

board.warn('Merlot is down to 1 oz', [
  'Purchase some more.'
])

board.print_warnings
[!] Merlot is down to 1 oz
    - Purchase some more.