Sha256: df233015b84bdcb7e98ef6fb05301d7ca4c1291b263acb4e26b4ab3da1e98c72

Contents?: true

Size: 1.09 KB

Versions: 14

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

require 'kubs_cli/file_helper'
require 'kubs_cli/configuration'
require 'kubs_cli/version'
require 'kubs_cli/cli'
require 'kubs_cli/install'
require 'kubs_cli/copy'
require 'kubs_cli/pull'

# Top level class
module KubsCLI
  # Location of default config and dependencies
  EXAMPLES = File.join(File.expand_path(__dir__), 'examples')

  class Error < StandardError; end
  # Specifies class methods
  class << self
    attr_accessor :errors

    # Allows users to specify various configurations based on their liking
    attr_writer :configuration

    # Adds an error to KubsCLI#errors
    # @param e [Error] Error raised
    # @param msg [String] Message to display
    # return Array<Error> Implicitly reutrns the array of errors
    def add_error(e:, msg: nil)
      KubsCLI.errors << e.exception(msg)
    end

    # Prints the errors when finished running
    def print_errors
      KubsCLI.errors.each { |e| puts e.message }
    end

    # Resets errors to a blank array
    def clear_errors
      @errors = []
    end
  end

  # Allows access via KubsCLI.errors
  @errors ||= []
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kubs_cli-0.2.2 lib/kubs_cli.rb
kubs_cli-0.2.1 lib/kubs_cli.rb
kubs_cli-0.2.0 lib/kubs_cli.rb
kubs_cli-0.1.15 lib/kubs_cli.rb
kubs_cli-0.1.14 lib/kubs_cli.rb
kubs_cli-0.1.13 lib/kubs_cli.rb
kubs_cli-0.1.12 lib/kubs_cli.rb
kubs_cli-0.1.9 lib/kubs_cli.rb
kubs_cli-0.1.8 lib/kubs_cli.rb
kubs_cli-0.1.7 lib/kubs_cli.rb
kubs_cli-0.1.6 lib/kubs_cli.rb
kubs_cli-0.1.5 lib/kubs_cli.rb
kubs_cli-0.1.4 lib/kubs_cli.rb
kubs_cli-0.1.2 lib/kubs_cli.rb