Class: YARD::Handlers::Chef::DependencyHandler
- Defined in:
- lib/yard-chef/handlers/dependency.rb
Overview
Handles “recipes” in a cookbook.
Instance Method Summary collapse
-
#name ⇒ String
Gets the recipe name from the metadata.rb.
-
#parse_docs ⇒ YARD::Docsting
Gets the docstring for the recipe.
- #process ⇒ Object
Methods inherited from Base
Instance Method Details
#name ⇒ String
Gets the recipe name from the metadata.rb.
43 44 45 |
# File 'lib/yard-chef/handlers/dependency.rb', line 43 def name statement.parameters.first.jump(:string_content, :ident).source end |
#parse_docs ⇒ YARD::Docsting
Gets the docstring for the recipe. The docstring is obtained from the description field in the recipe.
52 |
# File 'lib/yard-chef/handlers/dependency.rb', line 52 def parse_docs; end |
#process ⇒ Object
30 31 32 33 34 35 36 37 |
# 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 |