Sha256: 436df0fe3abb9afed344246a2c2baed9c0cfe3521fa7299b48facb066e365dff

Contents?: true

Size: 1.34 KB

Versions: 5

Compression:

Stored size: 1.34 KB

Contents

# frozen_string_literal: true

module Hanami
  module CLI
    module Commands
      # Commands made available when the `hanami` CLI is executed within an Hanami app.
      #
      # @api private
      # @since 2.0.0
      module App
        # @since 2.0.0
        # @api private
        def self.extended(base)
          base.module_eval do
            register "version", Commands::App::Version, aliases: ["v", "-v", "--version"]
            register "install", Commands::App::Install
            register "dev", Commands::App::Dev
            register "console", Commands::App::Console, aliases: ["c"]
            register "server", Commands::App::Server, aliases: ["s"]
            register "routes", Commands::App::Routes
            register "middleware", Commands::App::Middleware

            if Hanami.bundled?("hanami-assets")
              register "assets" do |prefix|
                prefix.register "compile", Assets::Compile
                prefix.register "watch", Assets::Watch
              end
            end

            register "generate", aliases: ["g"] do |prefix|
              prefix.register "slice", Generate::Slice
              prefix.register "action", Generate::Action
              prefix.register "view", Generate::View
              prefix.register "part", Generate::Part
            end
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hanami-cli-2.1.1 lib/hanami/cli/commands/app.rb
hanami-cli-2.1.0 lib/hanami/cli/commands/app.rb
hanami-cli-2.1.0.rc3 lib/hanami/cli/commands/app.rb
hanami-cli-2.1.0.rc2 lib/hanami/cli/commands/app.rb
hanami-cli-2.1.0.rc1 lib/hanami/cli/commands/app.rb