Method: VMC::Cli::Command::Base#resolve_symbol

Defined in:
lib/cli/commands/base.rb

#resolve_symbol(sym, ctx) ⇒ Object



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/cli/commands/base.rb', line 122

def resolve_symbol(sym, ctx)
  case sym
  when "target-base"
    target_base(ctx)

  when "target-url"
    target_url(ctx)

  when "random-word"
    "%04x" % [rand(0x0100000)]

  else
    found = find_symbol(sym, ctx)

    if found
      resolve_lexically(found, ctx)
      found
    else
      err(sym, "Unknown symbol in manifest: ")
    end
  end
end