Sha256: dc4a7751cc700dd2e4c5c5278c6a40ef4510e62cbeb117c266079824dc67c5f2
Contents?: true
Size: 890 Bytes
Versions: 7
Compression:
Stored size: 890 Bytes
Contents
require 'toolshed' module Toolshed # Command not found class CommandNotFound < RuntimeError end # CLI is responsible for executing the initial command class CLI def execute(command_class, args, options = {}) load_config(command_class) begin command_class.new.execute(args, options) rescue Toolshed::Error => e Toolshed.logger.fatal "An error occurred: #{e.message}" rescue RuntimeError => e Toolshed.logger.fatal "An error occurred: #{e.message}" end end def load_config(command_class) Toolshed.add_file_log_source(command_class.class.name) Toolshed.logger.info "Credentials loaded from #{File.absolute_path(Toolshed::Client.instance.toolshedrc_path)}" # rubocop:disable Metrics/LineLength rescue => e Toolshed.logger.fatal "Error loading your credentials: #{e.message}" end end end
Version data entries
7 entries across 7 versions & 1 rubygems