0.0
No commit activity in last 3 years
No release in over 3 years
A utility for handling some curses stuff more easily. Split out from everyday-cli-utils.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 12.3

Runtime

~> 1.3, >= 1.3.1
~> 1.8, >= 1.8.7.2
 Project Readme

EverydayCurses

A utility for handling some curses stuff more easily. Split out from everyday-cli-utils.

Installation

Add this line to your application's Gemfile:

gem 'everyday-curses'

And then execute:

$ bundle

Or install it yourself as:

$ gem install everyday-curses

Usage

EverydayCurses::MyCurses

Encapsulates the code for dealing with the curses library.

Fields:

MyCurses.headers

An array storing the header lines that will be printed out with MyCurses.myprints.

MyCurses.bodies

An array storing the body lines that will be printed out with MyCurses.myprints.

MyCurses.footers

An array storing the footer lines that will be printed out with MyCurses.myprints.

Methods:

MyCurses.new(use_curses, linesh, linesf)

Initializes the class and sets the basic options.

Parameters
  • use_curses: true to use curses, false to use puts
  • linesh: the number of header lines
  • linesf: the number of footer lines

MyCurses.clear

Clear the headers, bodies, and footers arrays

MyCurses.myprints

Print out all of the lines stored in the headers, bodies, and footers arrays. If use_curses is true, it will use curses and allow for scrolling. Otherwise, it will just print out all of the lines with puts

MyCurses.read_ch

Update the character from the body pad.

MyCurses.clear_ch

Clear out any newline, ENTER, UP, or DOWN characters from the queue.

MyCurses.scroll_iteration

Update the display (including doing any scrolling) and read the next character.

MyCurses.header_live_append(str)

Append str to the header pad immediately and update it. Does not modify the headers array.

Parameters
  • str: the string to append

MyCurses.body_live_append(str)

Append str to the body pad immediately and update it. Does not modify the bodies array.

Parameters
  • str: the string to append

MyCurses.footer_live_append(str)

Append str to the footer pad immediately and update it. Does not modify the footers array.

Parameters
  • str: the string to append

MyCurses.dispose

Close out the curses screen if curses was used.

Contributing

  1. Fork it ( http://github.com//everyday-curses/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request