Class: CMDx::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/cmdx/configuration.rb

Overview

Global defaults used by every task unless the task overrides via ‘Task.settings`/register DSL. A fresh `Task` subclass inherits the current configuration’s registries (via ‘#dup`) at the time its accessor is first called, so changes to configuration only apply to tasks that haven’t cached their copy yet.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/cmdx/configuration.rb', line 17

def initialize
  @middlewares = Middlewares.new
  @callbacks   = Callbacks.new
  @coercions   = Coercions.new
  @validators  = Validators.new
  @executors   = Executors.new
  @mergers     = Mergers.new
  @retriers    = Retriers.new
  @deprecators = Deprecators.new
  @telemetry   = Telemetry.new

  @correlation_id    = nil
  @default_locale    = "en"
  @strict_context    = false
  @backtrace_cleaner = nil
  @log_exclusions    = EMPTY_ARRAY
  @log_formatter     = nil
  @log_level         = nil

  @logger = Logger.new(
    $stdout,
    progname: "cmdx",
    formatter: LogFormatters::Line.new,
    level: Logger::INFO
  )
end

Instance Attribute Details

#backtrace_cleanerObject

Returns the value of attribute backtrace_cleaner.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def backtrace_cleaner
  @backtrace_cleaner
end

#callbacksObject

Returns the value of attribute callbacks.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def callbacks
  @callbacks
end

#coercionsObject

Returns the value of attribute coercions.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def coercions
  @coercions
end

#correlation_idObject

Returns the value of attribute correlation_id.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def correlation_id
  @correlation_id
end

#default_localeObject

Returns the value of attribute default_locale.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def default_locale
  @default_locale
end

#deprecatorsObject

Returns the value of attribute deprecators.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def deprecators
  @deprecators
end

#executorsObject

Returns the value of attribute executors.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def executors
  @executors
end

#log_exclusionsObject

Returns the value of attribute log_exclusions.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def log_exclusions
  @log_exclusions
end

#log_formatterObject

Returns the value of attribute log_formatter.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def log_formatter
  @log_formatter
end

#log_levelObject

Returns the value of attribute log_level.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def log_level
  @log_level
end

#loggerObject

Returns the value of attribute logger.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def logger
  @logger
end

#mergersObject

Returns the value of attribute mergers.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def mergers
  @mergers
end

#middlewaresObject

Returns the value of attribute middlewares.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def middlewares
  @middlewares
end

#retriersObject

Returns the value of attribute retriers.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def retriers
  @retriers
end

#strict_contextObject

Returns the value of attribute strict_context.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def strict_context
  @strict_context
end

#telemetryObject

Returns the value of attribute telemetry.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def telemetry
  @telemetry
end

#validatorsObject

Returns the value of attribute validators.



12
13
14
# File 'lib/cmdx/configuration.rb', line 12

def validators
  @validators
end