Sha256: e17d57efdafe04f541ba58dccb737febfa7af2723399e0125f95c233762f0226

Contents?: true

Size: 969 Bytes

Versions: 42

Compression:

Stored size: 969 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

42 entries across 42 versions & 1 rubygems

Version Path
chef-provisioning-2.7.6 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.7.4 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.7.2 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.7.1 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.7.0 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.6.0 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.5.0 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.4.0 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.3.2 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.3.1 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.3.0 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.2.1 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.2.0 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.1.1 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.1.0 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.0.2 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-2.0.0 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-1.9.1 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-1.9.0 lib/chef/provisioning/add_prefix_action_handler.rb
chef-provisioning-1.8.1 lib/chef/provisioning/add_prefix_action_handler.rb