From d42d6e690e3f553b971322eae783ac6b0d4d9692 Mon Sep 17 00:00:00 2001 From: hsbt Date: Fri, 5 Sep 2014 01:41:25 +0000 Subject: * lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(313287) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/stats/normal.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/rdoc/stats') diff --git a/lib/rdoc/stats/normal.rb b/lib/rdoc/stats/normal.rb index 32de631e2e..ef366a500e 100644 --- a/lib/rdoc/stats/normal.rb +++ b/lib/rdoc/stats/normal.rb @@ -1,4 +1,7 @@ -require 'io/console/size' +begin + require 'io/console/size' +rescue LoadError +end ## # Stats printer that prints just the files being documented with a progress @@ -22,7 +25,11 @@ class RDoc::Stats::Normal < RDoc::Stats::Quiet # Print a progress bar, but make sure it fits on a single line. Filename # will be truncated if necessary. - terminal_width = IO.console_size[1].to_i.nonzero? || 80 + terminal_width = if defined?(IO) && IO.respond_to?(:console_size) + IO.console_size[1].to_i.nonzero? || 80 + else + 80 + end max_filename_size = terminal_width - progress_bar.size if filename.size > max_filename_size then -- cgit v1.2.3