Class: Psych::TreeBuilder

Inherits:
Handler
  • Object
show all
Defined in:
lib/adlint/prelude.rb

Overview

NOTE: To support environment variable substitution in YAML file.

Syntax of embedding environment variable is below;
  env_var_specifier : '$' env_var_name
                    | '$' '{' env_var_name '}'
  env_var_name      : [A-Za-z_][0-9A-Za-z_]*

Examples of environment variable as any scalar value;
  string_item: $VAR
  boolean_item: $VAR
  decimal_item: $VAR

Examples of embedding environment variable in string;
  string_item: "foo${VAR}baz"

Instance Method Summary collapse

Instance Method Details

#_orig_scalarObject



334
# File 'lib/adlint/prelude.rb', line 334

alias :_orig_scalar :scalar

#scalar(value, anchor, tag, plain, quoted, style) ⇒ Object



335
336
337
338
# File 'lib/adlint/prelude.rb', line 335

def scalar(value, anchor, tag, plain, quoted, style)
  _orig_scalar(substitute_environment_variables(value),
               anchor, tag, plain, quoted, style)
end