Sha256: f6f70e579d5ce881b4eff2f2a165cabc68d506a608713d667d67779738e9eb8e

Contents?: true

Size: 1004 Bytes

Versions: 1

Compression:

Stored size: 1004 Bytes

Contents

require 'chef/provisioning/action_handler'

class Chef
module Provisioning
  class AddPrefixActionHandler
    extend Forwardable

    def initialize(action_handler, prefix)
      @action_handler = action_handler
      @prefix = prefix
    end

    attr_reader :action_handler
    attr_reader :prefix
    attr_reader :locally_updated

    def_delegators :@action_handler, :should_perform_actions, :updated!, :open_stream, :host_node

    def report_progress(description)
      @locally_updated = true
      action_handler.report_progress(Array(description).flatten.map { |d| "#{prefix}#{d}" })
    end

    def performed_action(description)
      @locally_updated = true
      action_handler.performed_action(Array(description).flatten.map { |d| "#{prefix}#{d}" })
    end

    def perform_action(description, &block)
      @locally_updated = true
      action_handler.perform_action(Array(description).flatten.map { |d| "#{prefix}#{d}" }, &block)
    end
  end
end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chef-provisioning-2.0.1 lib/chef/provisioning/add_prefix_action_handler.rb