Class: Hanami::CLI::Commands::Command Private

Inherits:
Hanami::CLI::Command
  • Object
show all
Defined in:
lib/hanami/cli/commands/command.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Abstract command

Since:

  • 1.1.0

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Renderer

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command_name:, out: $stdout, files: Utils::Files) ⇒ Command

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Command

Since:

  • 1.1.0


95
96
97
98
99
100
101
# File 'lib/hanami/cli/commands/command.rb', line 95

def initialize(command_name:, out: $stdout, files: Utils::Files)
  super(command_name: command_name)

  @out       = out
  @files     = files
  @templates = Templates.new(self.class)
end

Class Method Details

.inherited(component) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.1.0


23
24
25
26
27
28
29
30
31
# File 'lib/hanami/cli/commands/command.rb', line 23

def self.inherited(component)
  super

  component.class_eval do
    @_requirements = Concurrent::Array.new
    extend ClassMethods
    prepend InstanceMethods
  end
end