Class: Hanami::RSpec::Commands::Generate::Mailer Private

Inherits:
CLI::Commands::App::Command
  • Object
show all
Defined in:
lib/hanami/rspec/commands.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.

Since:

  • 2.0.0

API:

  • private

Instance Method Summary collapse

Instance Method Details

#call(name: nil, slice: nil, skip_tests: false) ⇒ 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:

  • 2.0.0

API:

  • private



169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/hanami/rspec/commands.rb', line 169

def call(name: nil, slice: nil, skip_tests: false, **)
  return if skip_tests

  slice = inflector.underscore(Shellwords.shellescape(slice)) if slice
  key = inflector.underscore(Shellwords.shellescape(name))

  namespace = slice ? inflector.camelize(slice) : app.namespace
  base_path = slice ? "spec/slices/#{slice}" : "spec"

  generator = Generators::Mailer.new(fs:, inflector:)
  generator.call(key:, namespace:, base_path:)
end