diff options
Diffstat (limited to 'lib/rdoc/stats')
-rw-r--r-- | lib/rdoc/stats/normal.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/rdoc/stats/normal.rb b/lib/rdoc/stats/normal.rb index f32db48005..ba00b6cbdf 100644 --- a/lib/rdoc/stats/normal.rb +++ b/lib/rdoc/stats/normal.rb @@ -1,8 +1,5 @@ # frozen_string_literal: false -begin - require 'io/console/size' -rescue LoadError -end +require 'io/console/size' ## # Stats printer that prints just the files being documented with a progress @@ -26,11 +23,7 @@ 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 = if defined?(IO) && IO.respond_to?(:console_size) - IO.console_size[1].to_i.nonzero? || 80 - else - 80 - end + terminal_width = IO.console_size[1].to_i.nonzero? || 80 max_filename_size = terminal_width - progress_bar.size if filename.size > max_filename_size then @@ -57,4 +50,3 @@ class RDoc::Stats::Normal < RDoc::Stats::Quiet end end - |