Sha256: b75c215ee28c20a86bbcfd6d0ae28e34166a2202b35eb5c40813f9824439d807

Contents?: true

Size: 397 Bytes

Versions: 67

Compression:

Stored size: 397 Bytes

Contents

# fallback to console window size
def IO.default_console_size
  [
    ENV["LINES"].to_i.nonzero? || 25,
    ENV["COLUMNS"].to_i.nonzero? || 80,
  ]
end

begin
  require 'io/console'
rescue LoadError
  class IO
    alias console_size default_console_size
  end
else
  # returns console window size
  def IO.console_size
    console.winsize
  rescue NoMethodError
    default_console_size
  end
end

Version data entries

67 entries across 39 versions & 3 rubygems

Version Path
second_step-0.1.2 secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/gems/2.2.0/gems/second_step-0.1.1/secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/2.2.0/io/console/size.rb
second_step-0.1.2 secondstep-notify-1.0.0-osx/lib/ruby/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.60 bin/traveling-ruby-2.2.2/l64/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.60 bin/traveling-ruby-2.2.2/l32/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.60 bin/traveling-ruby-2.2.2/osx/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.60 bin/traveling-ruby-2.2.2/win/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.58 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.57 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.56 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.55 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.54 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.53 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.52 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.51 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.50 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.49 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.47 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.46 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.45 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb
rb2exe-0.1.44 bin/traveling-ruby-2.2.2/lib/ruby/2.2.0/io/console/size.rb