Class: Strata::CLI::Generators::Group::QuietActionsShell

Inherits:
Thor::Shell::Color
  • Object
show all
Defined in:
lib/strata/cli/generators/group.rb

Constant Summary collapse

DEFAULT_ALLOWED_STATUSES =
%w[
  created
  setup
  clone
  success
  adapter
  gem
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(verbose: false, allowed_statuses: DEFAULT_ALLOWED_STATUSES) ⇒ QuietActionsShell

Returns a new instance of QuietActionsShell.



22
23
24
25
26
# File 'lib/strata/cli/generators/group.rb', line 22

def initialize(verbose: false, allowed_statuses: DEFAULT_ALLOWED_STATUSES)
  super()
  @verbose = verbose
  @allowed_statuses = allowed_statuses
end

Instance Method Details

#say_status(status, message, log_status = true) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/strata/cli/generators/group.rb', line 28

def say_status(status, message, log_status = true)
  return super if @verbose
  return if log_status == false

  s = status.to_s
  return super if @allowed_statuses.include?(s)

  nil
end