lib/tty/terminal.rb in tty-0.1.1 vs lib/tty/terminal.rb in tty-0.1.2
- old
+ new
@@ -20,10 +20,11 @@
#
# @api public
def initialize(options = {})
@color = Pastel.new
@echo = TTY::Terminal::Echo.new
+ @raw = TTY::Terminal::Raw.new
@pager = TTY::Terminal::Pager
@home = Home.new
end
# Switch echo on
@@ -45,9 +46,32 @@
# @param [Boolean] is_on
#
# @api public
def echo(is_on = true, &block)
@echo.echo(is_on, &block)
+ end
+
+ # Switch raw mode on
+ #
+ # @api public
+ def raw_on
+ @raw.on
+ end
+
+ # Switch raw mode off
+ #
+ # @api public
+ def raw_off
+ @raw.off
+ end
+
+ # Use raw mode in the given block
+ #
+ # @param [Boolean] is_on
+ #
+ # @api public
+ def raw(is_on = true, &block)
+ @raw.raw(is_on, &block)
end
# Find user home directory
#
# @return [String]