Pager: use TerminalInfo API for `::page_size`

Fix issue #829 (NoMethodError: undefined method `winsize'
for #<IO:<STDOUT>>, The Same Error as #549 But On The Latest Version
(0.9.11.4))
This commit is contained in:
Kyrylo Silin 2013-01-27 01:31:06 +02:00
parent b3d525b15a
commit 584aea188f
1 changed files with 2 additions and 6 deletions

View File

@ -24,12 +24,8 @@ class Pry::Pager
end
def self.page_size
@page_size ||= begin
require 'io/console'
$stdout.winsize.first
rescue LoadError
27
end
rows = Pry::TerminalInfo.screen_size
@page_size ||= (rows && rows.first || 27)
end
def initialize(text)