summaryrefslogtreecommitdiff
path: root/lib/chef/mixin/provides.rb
blob: 5885752752dfca8a03ece01163a60a054164adc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

require "chef/mixin/descendants_tracker"

class Chef
  module Mixin
    module Provides
      # TODO no longer needed, remove or deprecate?
      include Chef::Mixin::DescendantsTracker

      def provides(short_name, opts={}, &block)
        raise NotImplementedError, :provides
      end

      # Check whether this resource provides the resource_name DSL for the given
      # node.  TODO remove this when we stop checking unregistered things.
      def provides?(node, resource)
        raise NotImplementedError, :provides?
      end

      # Get the list of recipe DSL this resource is responsible for on the given
      # node.
      def provided_as(node)
        node_map.list(node)
      end
    end
  end
end