Sha256: 621827fc21f3d0568388a3560151f12e34b530cbe238d0e8411f1fff36d1fde9

Contents?: true

Size: 869 Bytes

Versions: 2

Compression:

Stored size: 869 Bytes

Contents

# frozen_string_literal: true

require_relative "gorails/version"
require "cli/ui"
require "cli/kit"

CLI::UI::StdoutRouter.enable

module Gorails
  class Error < StandardError; end

  extend CLI::Kit::Autocall

  TOOL_NAME = "gorails"
  ROOT = File.expand_path("../..", __FILE__)
  LOG_FILE = "/tmp/myproject.log"

  autoload(:EntryPoint, "gorails/entry_point")
  autoload(:Commands, "gorails/commands")

  autocall(:Config) { CLI::Kit::Config.new(tool_name: TOOL_NAME) }
  autocall(:Command) { CLI::Kit::BaseCommand }

  autocall(:Executor) { CLI::Kit::Executor.new(log_file: LOG_FILE) }
  autocall(:Resolver) do
    CLI::Kit::Resolver.new(
      tool_name: TOOL_NAME,
      command_registry: Gorails::Commands::Registry
    )
  end

  autocall(:ErrorHandler) do
    CLI::Kit::ErrorHandler.new(
      log_file: LOG_FILE,
      exception_reporter: nil
    )
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gorails-0.1.2 lib/gorails.rb
gorails-0.1.1 lib/gorails.rb