Class: SpecForge::Forge::Store

Inherits:
Action
  • Object
show all
Defined in:
lib/spec_forge/forge/actions/store.rb

Overview

Action for the store: step attribute

Resolves attribute values and stores them as variables for use by subsequent steps. Can store literal values or extract values from the response using template syntax.

Instance Attribute Summary

Attributes inherited from Action

#step

Instance Method Summary collapse

Methods inherited from Action

#initialize

Constructor Details

This class inherits a constructor from SpecForge::Forge::Action

Instance Method Details

#run(forge) ⇒ void

This method returns an undefined value.

Stores all configured values in the forge's variables

Parameters:

  • forge (Forge)

    The forge instance



20
21
22
23
24
25
26
27
28
# File 'lib/spec_forge/forge/actions/store.rb', line 20

def run(forge)
  step.store.each do |name, value|
    event = forge.variables.key?(name) ? "Update" : "Store"

    forge.display.action("#{event} #{name.in_quotes}", symbol: :flag, symbol_styles: :bright_cyan)

    forge.variables[name] = value.resolved
  end
end