Sha256: e98887cc6b3097776dbad2b62d5d58f6c07c75ca0367f1a8b6dbd226c8292e32

Contents?: true

Size: 968 Bytes

Versions: 16

Compression:

Stored size: 968 Bytes

Contents

# frozen_string_literal: true

require "dry/cli"
require "zeitwerk"

module Hanami
  # Extensible command line interface for Hanami.
  #
  # @api public
  # @since 2.0.0
  module CLI
    # @api private
    # @since 2.0.0
    def self.gem_loader
      @gem_loader ||= Zeitwerk::Loader.new.tap do |loader|
        root = File.expand_path("..", __dir__)
        loader.tag = "hanami-cli"
        loader.inflector = Zeitwerk::GemInflector.new("#{root}/hanami-cli.rb")
        loader.push_dir(root)
        loader.ignore(
          "#{root}/hanami-cli.rb",
          "#{root}/hanami/cli/{errors,version}.rb"
        )
        loader.inflector.inflect("cli" => "CLI")
        loader.inflector.inflect("db" => "DB")
        loader.inflector.inflect("url" => "URL")
      end
    end

    gem_loader.setup
    require_relative "cli/commands"
    require_relative "cli/errors"
    require_relative "cli/version"

    extend Dry::CLI::Registry

    register_commands!
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
hanami-cli-2.2.1 lib/hanami/cli.rb
hanami-cli-2.2.0 lib/hanami/cli.rb
hanami-cli-2.2.0.rc1 lib/hanami/cli.rb
hanami-cli-2.2.0.beta2 lib/hanami/cli.rb
hanami-cli-2.2.0.beta1 lib/hanami/cli.rb
hanami-cli-2.1.1 lib/hanami/cli.rb
hanami-cli-2.1.0 lib/hanami/cli.rb
hanami-cli-2.1.0.rc3 lib/hanami/cli.rb
hanami-cli-2.1.0.rc2 lib/hanami/cli.rb
hanami-cli-2.1.0.rc1 lib/hanami/cli.rb
hanami-cli-2.1.0.beta2 lib/hanami/cli.rb
hanami-cli-2.1.0.beta1 lib/hanami/cli.rb
hanami-cli-2.0.3 lib/hanami/cli.rb
hanami-cli-2.0.2 lib/hanami/cli.rb
hanami-cli-2.0.1 lib/hanami/cli.rb
hanami-cli-2.0.0 lib/hanami/cli.rb