Sha256: 15e8d287eb76778d0a8351bd89063d364f1d5e277f21643c84e232cd9e5203a6

Contents?: true

Size: 1.99 KB

Versions: 3

Compression:

Stored size: 1.99 KB

Contents

# frozen_string_literal: true

# Main config dir
CONFIG_DIR = '~/.config/howzit'

# Config file name
CONFIG_FILE = 'howzit.yaml'

# Color template name
COLOR_FILE = 'theme.yaml'

# Ignore file name
IGNORE_FILE = 'ignore.yaml'

# Available options for matching method
MATCHING_OPTIONS = %w[partial exact fuzzy beginswith].freeze

# Available options for multiple_matches method
MULTIPLE_OPTIONS = %w[first best all choose].freeze

# Available options for header formatting
HEADER_FORMAT_OPTIONS = %w[border block].freeze

require 'optparse'
require 'shellwords'
require 'pathname'
require 'readline'
require 'tempfile'
require 'yaml'

require_relative 'howzit/util'
require_relative 'howzit/hash'

require_relative 'howzit/version'
require_relative 'howzit/prompt'
require_relative 'howzit/colors'
require_relative 'howzit/stringutils'

require_relative 'howzit/console_logger'
require_relative 'howzit/config'
require_relative 'howzit/task'
require_relative 'howzit/topic'
require_relative 'howzit/buildnote'

require 'tty/screen'
require 'tty/box'
# require 'tty/prompt'

# Main module for howzit
module Howzit
  class << self
    attr_accessor :arguments, :named_arguments, :cli_args

    ##
    ## Holds a Configuration object with methods and a @settings hash
    ##
    ## @return     [Configuration] Configuration object
    ##
    def config
      @config ||= Config.new
    end

    ##
    ## Array for tracking inclusions and avoiding duplicates in output
    ##
    def inclusions
      @inclusions ||= []
    end

    ##
    ## Module storage for Howzit::Config.options
    ##
    def options
      config.options
    end

    ##
    ## Module storage for buildnote
    ##
    def buildnote
      @buildnote ||= BuildNote.new
    end

    ##
    ## Convenience method for logging with Howzit.console.warn, etc.
    ##
    def console
      @console ||= Howzit::ConsoleLogger.new(options[:log_level])
    end

    def has_read_upstream
      @has_read_upstream ||= false
    end

    attr_writer :has_read_upstream
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
howzit-2.1.14 lib/howzit.rb
howzit-2.1.13 lib/howzit.rb
howzit-2.1.12 lib/howzit.rb