lib/tty/pager/null.rb in tty-pager-0.8.0 vs lib/tty/pager/null.rb in tty-pager-0.9.0
- old
+ new
@@ -1,13 +1,16 @@
-# coding: utf-8
+# encoding: utf-8
+# frozen_string_literal: true
module TTY
class Pager
class NullPager < Pager
# Pass output directly to stdout
#
# @api public
def page(text, &callback)
+ return text unless output.tty?
+
output.puts(text)
end
end
end # Pager
end # TTY