Sha256: e804ade00a2db1e6f53c5fd9a8043cece5327e7e263411615574fbc5f0783267
Contents?: true
Size: 428 Bytes
Versions: 3
Compression:
Stored size: 428 Bytes
Contents
# frozen_string_literal: false # 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
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
ruby-compiler-0.1.1 | vendor/ruby/ext/io/console/lib/console/size.rb |
io-console-0.4.6 | lib/console/size.rb |
io-console-0.4.5 | lib/console/size.rb |