summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-12-14 08:09:49 -0300
committerAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-12-14 08:09:49 -0300
commitda1cdee25d4cae9ec3f85ae131a5dfbc306ba97c (patch)
treecc04aabd937e4b387e6f14213e58f28a9a2e9742
parent9edb18767c8bbf397e6ed9723d72bbc624e91980 (diff)
downloadhighline-da1cdee25d4cae9ec3f85ae131a5dfbc306ba97c.tar.gz
Migrate NCurses code to new Terminal api and improve documentation
-rw-r--r--lib/highline/terminal/ncurses.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/highline/terminal/ncurses.rb b/lib/highline/terminal/ncurses.rb
index db9163c..dda193a 100644
--- a/lib/highline/terminal/ncurses.rb
+++ b/lib/highline/terminal/ncurses.rb
@@ -1,25 +1,26 @@
# coding: utf-8
class HighLine
- module SystemExtensions
-
- # @todo Code to be discussed.
- # Will we maintain an ncurses version of HighLine::Terminal?
- # If so, port it to the new api.
- module NCurses
+ class Terminal
+ # NCurses HighLine::Terminal
+ # @note Code migrated +UNTESTED+ from the old code base to the new terminal api.
+ class NCurses < Terminal
require 'ffi-ncurses'
CHARACTER_MODE = "ncurses" # For Debugging purposes only.
+ # (see Terminal#raw_no_echo_mode)
def raw_no_echo_mode
FFI::NCurses.initscr
FFI::NCurses.cbreak
end
+ # (see Terminal#restore_mode)
def restore_mode
FFI::NCurses.endwin
end
#
+ # (see Terminal#terminal_size)
# A ncurses savvy method to fetch the console columns, and rows.
#
def terminal_size