lib/bolt/plugin.rb
# Evaluates a single reference. The value returned may be another
# reference.
Evaluates a single reference. The value returned may be another
reference.
Evaluates a single reference . The value returned may be another reference .
def resolve_single_reference(reference)
      plugin_cache = if cache?(reference)
                       cache = Bolt::Plugin::Cache.new(reference,
                                                       @config.project.plugin_cache_file,
                                                       @config.plugin_cache)
                       entry = cache.read_and_clean_cache
                       return entry unless entry.nil?
                       cache
                     end
      plugin_name = reference['_plugin']
      hook = get_hook(plugin_name, :resolve_reference)
      begin
        validate_proc = get_hook(plugin_name, :validate_resolve_reference)
      rescue PluginError
        validate_proc = proc { |*args| } 
      end
      validate_proc.call(reference)
      result = begin
        hook.call(reference)
      rescue StandardError => e
        loc = "resolve_reference in #{plugin_name}"
        raise PluginError::ExecutionError.new(e.message, plugin_name, loc)
      end
      plugin_cache.write_cache(result) if cache?(reference)
      result
    end
def resolve_single_reference ( reference ) plugin_cache = if cache? ( reference ) cache = Bolt :: Plugin :: Cache . new ( reference , @config . project . plugin_cache_file , @config . plugin_cache ) entry = cache . read_and_clean_cache return entry unless entry . nil? cache end plugin_name = reference [ '_plugin' ] hook = get_hook ( plugin_name , :resolve_reference ) begin validate_proc = get_hook ( plugin_name , :validate_resolve_reference ) rescue PluginError validate_proc = proc { | * args | } end validate_proc . call ( reference ) result = begin hook . call ( reference ) rescue StandardError => e loc = "resolve_reference in #{plugin_name}" raise PluginError :: ExecutionError . new ( e . message , plugin_name , loc ) end plugin_cache . write_cache ( result ) if cache? ( reference ) result end
Evaluates a single reference.
Evaluates a single reference .
# Nothing to do # Evaluate the plugin and then recursively evaluate any plugin returned by it.
reference
<not_specific>