Sha256: 71df24a6fe95a34571ab2051f143b2b12c2578fc4d7b0f782a05e5819b8171d6

Contents?: true

Size: 640 Bytes

Versions: 11

Compression:

Stored size: 640 Bytes

Contents

module Chef::Validation
  module ContextExt
    class << self
      # Returns a single cookbook from the given run context of the given name.
      #
      # @param [Chef::RunContext] context
      # @param [String] name
      #
      # @return [Chef::CookbookVersion]
      def cookbook(context, name)
        context.cookbook_collection[name]
      end

      # Returns all loaded cookbooks from the given run context.
      #
      # @param [Chef::RunContext] context
      #
      # @return [Array<Chef::CookbookVersion>]
      def cookbooks(context)
        context.cookbook_collection.collect { |k, v| v }
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
chef-validation-0.2.3 lib/chef/validation/ext/context.rb
chef-validation-0.2.2 lib/chef/validation/ext/context.rb
chef-validation-0.2.1 lib/chef/validation/ext/context.rb
chef-validation-0.2.0 lib/chef/validation/ext/context.rb
chef-validation-0.1.6 lib/chef/validation/ext/context.rb
chef-validation-0.1.5 lib/chef/validation/ext/context.rb
chef-validation-0.1.4 lib/chef/validation/ext/context.rb
chef-validation-0.1.3 lib/chef/validation/ext/context.rb
chef-validation-0.1.2 lib/chef/validation/ext/context.rb
chef-validation-0.1.1 lib/chef/validation/ext/context.rb
chef-validation-0.1.0 lib/chef/validation/ext/context.rb