Module: Trailblazer::Developer::Debugger

Defined in:
lib/trailblazer/developer/debugger.rb,
lib/trailblazer/developer/debugger/normalizer.rb

Overview

Code in Debugger is only executed if the user wants to render the stack.

Defined Under Namespace

Modules: Normalizer Classes: Node, Trace

Constant Summary collapse

ATTRS =
[
  :id,
  :trace_node,
  :task,
  :activity,
  :compile_id,
  :runtime_id,
  :label,
  :data,
  :snapshot_before,
  :snapshot_after,
  :level,
  :incomplete?,
  :captured_node, # TODO: remove once macro is 2.2
]

Class Method Summary collapse

Class Method Details

.add_normalizer_step!(step, id:, normalizer: Normalizer::PIPELINES.last, **options) ⇒ Object

Public entry point to add Debugger::Node normalizer steps.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/trailblazer/developer/debugger/normalizer.rb', line 6

def self.add_normalizer_step!(step, id:, normalizer: Normalizer::PIPELINES.last, **options)
  task = Normalizer.Task(step)

  # We have a TaskWrap::Pipeline (a very simple style of "activity" used for normalizers) and
  # add another step using the "friendly interface" from {Activity::Adds}.
  options = {append: nil} unless options.any?

  pipeline_extension = Activity::TaskWrap::Extension.build([task, id: id, **options])

  Normalizer::PIPELINES << pipeline_extension.(normalizer)
end