From fa9bab923ec279980371c19794bfd997df4fd033 Mon Sep 17 00:00:00 2001 From: elliottcable Date: Thu, 5 Mar 2009 21:56:00 -0900 Subject: [PATCH] Cleaned up the initialization routines. --- examples/initialization.rb | 2 +- lib/nfoiled.rb | 28 ++++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/examples/initialization.rb b/examples/initialization.rb index 02f4565..42f3597 100644 --- a/examples/initialization.rb +++ b/examples/initialization.rb @@ -9,7 +9,7 @@ require 'nfoiled' # First, we need to ensure that Ncurses will exit cleanly (that is, we don't # want an interrupt or fatal error to screw up the terminal output after the # program exists). -at_exit { ::Ncurses.endwin } +Nfoiled::initialize # Second, the actual initialization of Ncurses. This allocates the necessary # memory and initializes all variables. diff --git a/lib/nfoiled.rb b/lib/nfoiled.rb index 537afbe..b096ebb 100644 --- a/lib/nfoiled.rb +++ b/lib/nfoiled.rb @@ -5,24 +5,44 @@ require 'ncurses' module Nfoiled VERSION = 0 + class <