Sha256: 5fcdadc7b34f35dc72035f364e5df491e033e20cf9225daaf1ced96230a71c75

Contents?: true

Size: 875 Bytes

Versions: 83

Compression:

Stored size: 875 Bytes

Contents

module ANSI

  # = Terminal
  #
  # This library is based of HighLine's SystemExtensions
  # by James Edward Gray II.
  #
  # Copyright 2006 Gray Productions
  #
  # Distributed under the tems of the
  # {Ruby software license}[http://www.ruby-lang.org/en/LICENSE.txt].

  module Terminal

    module_function

    modes = %w{win32 termios curses stty}

    # This section builds character reading and terminal size functions
    # to suit the proper platform we're running on.
    #
    # Be warned: Here be dragons!
    #
    begin
      require 'ansi/terminal/' + (mode = modes.shift)
      CHARACTER_MODE = mode
    rescue LoadError
      retry
    end

    # Get the width of the terminal window.
    def terminal_width
      terminal_size.first
    end

    # Get the height of the terminal window.
    def terminal_height
      terminal_size.last
    end

  end

end

Version data entries

83 entries across 41 versions & 13 rubygems

Version Path
op_connect-0.1.2 vendor/bundle/ruby/3.1.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.1.0 vendor/bundle/ruby/2.7.0/gems/paynow_sdk-1.0.9/vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.1.0 vendor/bundle/ruby/2.7.0/gems/paynow_sdk-1.0.9/vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.1.0 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.1.0 vendor/bundle/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.1.0 vendor/bundle/ruby/2.7.0/gems/paynow_sdk-1.0.9/vendor/bundle/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.1.0 vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.9 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.9 vendor/bundle/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.9 vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.8 vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.8 vendor/bundle/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.8 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.7 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.7 vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.6 vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.6 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.5 vendor/cache/ruby/2.7.0/gems/paynow_sdk-1.0.0/vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb
paynow_sdk-1.0.5 vendor/cache/ruby/2.7.0/gems/ansi-1.5.0/lib/ansi/terminal.rb