Module: Hanami::CLI::Commands::Command::InstanceMethods Private

Defined in:
lib/hanami/cli/commands/command.rb

Overview

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

Since:

  • 1.1.0

Instance Method Summary collapse

Instance Method Details

#call(**options) ⇒ 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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/hanami/cli/commands/command.rb', line 74

def call(**options)
  if self.class.requirements.any?
    environment = Hanami::Environment.new(options)
    environment.require_project_environment

    requirements.resolved('environment', environment)
    requirements.resolve(self.class.requirements)

    options = environment.to_options.merge(options)
  end

  super(**options)
rescue StandardError => e
  warn e.message
  warn e.backtrace.join("\n\t")
  exit(1)
end