summaryrefslogtreecommitdiff
path: root/lib/highline/terminal.rb
diff options
context:
space:
mode:
authorAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-04-27 00:14:12 -0300
committerAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-04-29 23:43:38 -0300
commitc63b55db00ba3266a8b71e013d93185e4acfc4b5 (patch)
tree6a0bc3b86cbe1804b8f129960590f1a7e4624ca9 /lib/highline/terminal.rb
parent3e352b1fc7b2db1210410d8ea4df7c8d095f1e1b (diff)
downloadhighline-c63b55db00ba3266a8b71e013d93185e4acfc4b5.tar.gz
Indent only
Diffstat (limited to 'lib/highline/terminal.rb')
-rwxr-xr-xlib/highline/terminal.rb92
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