Sha256: 065adf179095d4c54f958b2cc45dceeeac3ee7e9b5d1fdf679f409b0c1779e5e

Contents?: true

Size: 726 Bytes

Versions: 8

Compression:

Stored size: 726 Bytes

Contents

module Inch
  # The CLI module is tasked with the deconstruction of CLI calls
  # into API calls.
  #
  # @see Inch::API
  module CLI
    class << self
      # Returns the columns of the terminal window
      # (defaults to 80)
      # @param default [Fixnum] default value for columns
      # @return [Fixnum]
      def get_term_columns(default = 80)
        str = `stty size`
        rows_cols = str.split(' ').map(&:to_i)
        rows_cols[1] || default
      rescue
        default
      end
    end
    COLUMNS = get_term_columns
  end
end

require_relative 'cli/arguments'
require_relative 'cli/sparkline_helper'
require_relative 'cli/trace_helper'
require_relative 'cli/yardopts_helper'

require_relative 'cli/command'

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
inch-0.4.4 lib/inch/cli.rb
inch-0.4.4.rc4 lib/inch/cli.rb
inch-0.4.4.rc3 lib/inch/cli.rb
inch-0.4.4.rc2 lib/inch/cli.rb
inch-0.4.4.rc1 lib/inch/cli.rb
inch-0.4.3 lib/inch/cli.rb
inch-0.4.3.rc2 lib/inch/cli.rb
inch-0.4.3.rc1 lib/inch/cli.rb