summaryrefslogtreecommitdiff
path: root/lib/highline/terminal.rb
diff options
context:
space:
mode:
authorAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-12-14 08:10:29 -0300
committerAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-12-14 08:29:16 -0300
commitc66300ef64f0fb22b819625d41e403a157f9c4d1 (patch)
treef4144645370841d5c092ffa5dccb386603b925f9 /lib/highline/terminal.rb
parentda1cdee25d4cae9ec3f85ae131a5dfbc306ba97c (diff)
downloadhighline-c66300ef64f0fb22b819625d41e403a157f9c4d1.tar.gz
Improve HighLine::Terminal and childs documentation
Diffstat (limited to 'lib/highline/terminal.rb')
-rwxr-xr-xlib/highline/terminal.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/highline/terminal.rb b/lib/highline/terminal.rb
index 77020f5..ac06b3b 100755
--- a/lib/highline/terminal.rb
+++ b/lib/highline/terminal.rb
@@ -55,16 +55,18 @@ class HighLine
@output = output
end
- # An initialization callback to be overloaded by other classes.
+ # An initialization callback.
# It is called by {.get_terminal}.
def initialize_system_extensions
end
- # @return [Array] two value terminal size
+ # @return [Array<Integer, Integer>] two value terminal
+ # size like [columns, lines]
def terminal_size
+ [80, 24]
end
- # Enter Raw No Echo mode. To be overloaded by other classes.
+ # Enter Raw No Echo mode.
def raw_no_echo_mode
end
@@ -82,6 +84,7 @@ class HighLine
end
# Get one character from the terminal
+ # @return [String] one character
def get_character
end
@@ -150,6 +153,8 @@ class HighLine
highline.input.gets
end
+ # @!group Enviroment queries
+
# Running on JRuby?
def jruby?
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
@@ -165,6 +170,8 @@ class HighLine
defined?(RUBY_PLATFORM) && (RUBY_PLATFORM =~ /mswin|mingw|cygwin/)
end
+ # @!endgroup
+
private
# Yield a block using stty shell commands to preserve the terminal state.