2014-09-30 21:21:20 +00:00
|
|
|
require 'puppet'
|
|
|
|
require 'puppet/pops'
|
|
|
|
require 'puppet/util/docs'
|
|
|
|
require 'yard'
|
2014-09-16 16:07:59 +00:00
|
|
|
|
2015-02-03 23:06:30 +00:00
|
|
|
module PuppetX
|
|
|
|
end
|
|
|
|
|
2014-09-16 16:07:59 +00:00
|
|
|
# Nothing to see here except forward declarations.
|
2015-02-03 23:06:30 +00:00
|
|
|
module PuppetX::PuppetLabs
|
2014-09-16 16:07:59 +00:00
|
|
|
module Strings
|
2014-09-30 21:21:20 +00:00
|
|
|
# This submodule contains bits that operate on the Pops module produced by
|
|
|
|
# the Future parser.
|
|
|
|
module Pops
|
2015-02-03 23:06:30 +00:00
|
|
|
require 'puppet_x/puppetlabs/strings/pops/yard_statement'
|
|
|
|
require 'puppet_x/puppetlabs/strings/pops/yard_transformer'
|
2014-09-30 21:21:20 +00:00
|
|
|
end
|
2014-09-16 16:07:59 +00:00
|
|
|
|
|
|
|
# This submodule contains bits that interface with the YARD plugin system.
|
|
|
|
module YARD
|
2015-02-03 23:06:30 +00:00
|
|
|
require 'puppet_x/puppetlabs/strings/yard/monkey_patches'
|
|
|
|
require 'puppet_x/puppetlabs/strings/yard/parser'
|
2014-09-29 22:49:05 +00:00
|
|
|
|
2015-08-10 17:16:26 +00:00
|
|
|
module Tags
|
|
|
|
require 'puppet_x/puppetlabs/strings/yard/tags/directives'
|
|
|
|
end
|
|
|
|
|
2014-09-30 20:34:57 +00:00
|
|
|
# This submodule contains code objects which are used to represent relevant
|
|
|
|
# aspects of puppet code in YARD's Registry
|
2014-09-29 22:49:05 +00:00
|
|
|
module CodeObjects
|
2015-02-03 23:06:30 +00:00
|
|
|
require 'puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object'
|
|
|
|
require 'puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object'
|
|
|
|
require 'puppet_x/puppetlabs/strings/yard/code_objects/host_class_object'
|
2015-07-31 21:59:15 +00:00
|
|
|
require 'puppet_x/puppetlabs/strings/yard/code_objects/provider_object'
|
2014-09-30 20:34:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# This submodule contains handlers which are used to extract relevant data about
|
|
|
|
# puppet code from the ASTs produced by the Ruby and Puppet parsers
|
|
|
|
module Handlers
|
|
|
|
# This utility library contains some tools for working with Puppet docstrings
|
2015-02-03 23:06:30 +00:00
|
|
|
require 'puppet_x/puppetlabs/strings/yard/handlers/base'
|
|
|
|
require 'puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler'
|
|
|
|
require 'puppet_x/puppetlabs/strings/yard/handlers/host_class_handler'
|
|
|
|
require 'puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler'
|
|
|
|
require 'puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler'
|
2015-07-31 21:59:15 +00:00
|
|
|
require 'puppet_x/puppetlabs/strings/yard/handlers/provider_handler'
|
2014-09-29 22:49:05 +00:00
|
|
|
end
|
2014-09-16 16:07:59 +00:00
|
|
|
|
2014-09-30 21:21:20 +00:00
|
|
|
::YARD::Parser::SourceParser.register_parser_type(:puppet,
|
2015-02-03 23:06:30 +00:00
|
|
|
PuppetX::PuppetLabs::Strings::YARD::PuppetParser,
|
2014-09-30 21:21:20 +00:00
|
|
|
['pp'])
|
|
|
|
::YARD::Handlers::Processor.register_handler_namespace(:puppet,
|
2015-02-03 23:06:30 +00:00
|
|
|
PuppetX::PuppetLabs::Strings::YARD::Handlers)
|
2014-09-30 21:21:20 +00:00
|
|
|
|
|
|
|
# FIXME: Might not be the best idea to have the template code on the Ruby
|
|
|
|
# LOAD_PATH as the contents of this directory really aren't library code.
|
|
|
|
::YARD::Templates::Engine.register_template_path(
|
|
|
|
File.join(File.dirname(__FILE__), 'strings', 'yard', 'templates'))
|
2014-09-16 16:07:59 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|