Sha256: 8711862f84062436c5571c3970c568b6f94cb806bfb7306d7e52ca8a28aa44bd

Contents?: true

Size: 265 Bytes

Versions: 3

Compression:

Stored size: 265 Bytes

Contents

require 'dev/ui'
require 'io/console'

module Dev
  module UI
    module Terminal
      def self.width
        if console = IO.console
          console.winsize[1]
        else
          80
        end
      rescue Errno::EIO
        80
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dev-ui-0.1.0 lib/dev/ui/terminal.rb
dev-ui-0.0.2 lib/dev/ui/terminal.rb
dev-ui-0.0.1 lib/dev/ui/terminal.rb