lib/tty/terminal/pager/system.rb in tty-0.0.11 vs lib/tty/terminal/pager/system.rb in tty-0.1.0
- old
+ new
@@ -1,13 +1,11 @@
-# -*- encoding: utf-8 -*-
+# encoding: utf-8
module TTY
class Terminal
-
# A class responsible for paging text
class SystemPager < Pager
-
# Use system command to page output text
#
# @api public
def page
read_io, write_io = IO.pipe
@@ -22,18 +20,17 @@
Kernel.select [TTY.shell.stdin]
begin
Kernel.exec(Pager.command)
rescue
- Kernel.exec "/bin/sh", "-c", command
+ Kernel.exec '/bin/sh', '-c', command
end
else
# child process
write_io.write(text)
write_io.close
read_io.close
end
end
-
end # SystemPager
end # Terminal
end # TTY