class YARD::Handlers::Chef::DependencyHandler

Handles “recipes” in a cookbook.

Public Instance Methods

name() click to toggle source

Gets the recipe name from the metadata.rb.

@return [String] the recipe name

# File lib/yard-chef/handlers/dependency.rb, line 43
def name
  statement.parameters.first.jump(:string_content, :ident).source
end
parse_docs() click to toggle source

Gets the docstring for the recipe. The docstring is obtained from the description field in the recipe.

@return [YARD::Docsting] the docstring

# File lib/yard-chef/handlers/dependency.rb, line 52
def parse_docs; end
process() click to toggle source
# File lib/yard-chef/handlers/dependency.rb, line 30
def process
  path_array = statement.file.to_s.split('/')
  return unless path_array.include?('metadata.rb')

  # Recipe declaration in metadata.rb
  dependency_obj = ChefObject.register(cookbook, name, :dependency)
  dependency_obj.docstring = statement.docstring
end