diff options
author | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-04-27 00:14:12 -0300 |
---|---|---|
committer | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-04-29 23:43:38 -0300 |
commit | c63b55db00ba3266a8b71e013d93185e4acfc4b5 (patch) | |
tree | 6a0bc3b86cbe1804b8f129960590f1a7e4624ca9 /lib/highline | |
parent | 3e352b1fc7b2db1210410d8ea4df7c8d095f1e1b (diff) | |
download | highline-c63b55db00ba3266a8b71e013d93185e4acfc4b5.tar.gz |
Indent only
Diffstat (limited to 'lib/highline')
-rwxr-xr-x | lib/highline/terminal.rb | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/lib/highline/terminal.rb b/lib/highline/terminal.rb index c7422b3..b3a235a 100755 --- a/lib/highline/terminal.rb +++ b/lib/highline/terminal.rb @@ -15,62 +15,62 @@ class HighLine class Terminal def get_terminal - JRUBY = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' + JRUBY = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby' - if JRUBY - require 'highline/terminal/jruby' - return HighLine::Terminal::JRuby - end + if JRUBY + require 'highline/terminal/jruby' + return HighLine::Terminal::JRuby + end - extend self + extend self - # - # This section builds character reading and terminal size functions - # to suit the proper platform we're running on. Be warned: Here be - # dragons! - # - if RUBY_PLATFORM =~ /mswin(?!ce)|mingw|bccwin/i - begin - require 'highline/terminal/windows_fiddle' - return HighLine::Terminal::WindowsFiddle - rescue LoadError - require 'highline/terminal/windows_dl_import' - return HighLine::Terminal::WindowsDlImport - end + # + # This section builds character reading and terminal size functions + # to suit the proper platform we're running on. Be warned: Here be + # dragons! + # + if RUBY_PLATFORM =~ /mswin(?!ce)|mingw|bccwin/i + begin + require 'highline/terminal/windows_fiddle' + return HighLine::Terminal::WindowsFiddle + rescue LoadError + require 'highline/terminal/windows_dl_import' + return HighLine::Terminal::WindowsDlImport + end - require 'highline/terminal/windows' - return HighLine::Terminal::Windows - else # If we're not on Windows try... - begin - require 'highline/terminal/unix_termios' - return HighLine::Terminal::UnixTermios - rescue LoadError # If our first choice fails, try using JLine - if JRUBY # if we are on JRuby. JLine is bundled with JRuby. - require 'highline/terminal/jruby_jline' - return HighLine::Terminal::JRubyJLine - else # If we are not on JRuby, try ncurses - begin - require 'highline/terminal/ncurses' - return HighLine::Terminal::NCurses - rescue LoadError # Finally, if all else fails, use stty - require 'highline/terminal/stty' - return HighLine::Terminal::Stty + require 'highline/terminal/windows' + return HighLine::Terminal::Windows + else # If we're not on Windows try... + begin + require 'highline/terminal/unix_termios' + return HighLine::Terminal::UnixTermios + rescue LoadError # If our first choice fails, try using JLine + if JRUBY # if we are on JRuby. JLine is bundled with JRuby. + require 'highline/terminal/jruby_jline' + return HighLine::Terminal::JRubyJLine + else # If we are not on JRuby, try ncurses + begin + require 'highline/terminal/ncurses' + return HighLine::Terminal::NCurses + rescue LoadError # Finally, if all else fails, use stty + require 'highline/terminal/stty' + return HighLine::Terminal::Stty + end end end - end - # For termios and stty - if not method_defined?(:terminal_size) - require 'highline/terminal/unix_stty' - return HighLine::Terminal::UnixStty + # For termios and stty + if not method_defined?(:terminal_size) + require 'highline/terminal/unix_stty' + return HighLine::Terminal::UnixStty + end end - end - if not method_defined?(:get_character) - def get_character( input = STDIN ) - input.getbyte + if not method_defined?(:get_character) + def get_character( input = STDIN ) + input.getbyte + end end end end - end end |