summaryrefslogtreecommitdiff
path: root/lib/rdoc/stats/normal.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 01:41:25 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 01:41:25 +0000
commitd42d6e690e3f553b971322eae783ac6b0d4d9692 (patch)
tree2004bf4517ee7b81466c300cf30092e62e65467e /lib/rdoc/stats/normal.rb
parent670c6e8ce9d4a12bb4832e10fab27365398649bf (diff)
* 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
Diffstat (limited to 'lib/rdoc/stats/normal.rb')
-rw-r--r--lib/rdoc/stats/normal.rb11
1 files changed, 9 insertions, 2 deletions
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