Commit Graph

8 Commits

Author SHA1 Message Date
Charlie Sharpsteen 0eb6ec1158 Support Ruby 1.8.7 using backports
The YARD plugin is currently architected using `require_relative` so that it
can be loaded outside of Puppet. Unfortunately, `require_relative` first
appeared in Ruby 1.9.1.

Achieve compatibility using the Backports gem.
2014-05-24 16:49:54 -07:00
Charlie Sharpsteen b4e2ed0e5c Re-work require statements
Use `require_relative` for all components under Puppetx. This makes it possible
to load `pupetx/yardoc/yard/plugin` outside of Puppet as a YARD plugin.

Also fix the `yardoc` face so that Puppetx bits are loaded _after_ feature
checks.
2014-05-24 16:46:37 -07:00
Charlie Sharpsteen 545a8a0c5e Add YARD plugin
A simple file that registers the parser and handlers with YARD.
2014-05-22 23:46:07 -07:00
Charlie Sharpsteen c56bc426be Add simple handlers
Add a base handler class and a handler that processes `HostClassDefinition`
instances.
2014-05-22 23:45:08 -07:00
Charlie Sharpsteen 9ef57b594e Trim comment characters from docstrings
A very naive attempt. Simple removes any leading whitespace, the comment
character and then one space.
2014-05-22 23:42:10 -07:00
Charlie Sharpsteen 66af766dba Add YARDStatement class
The `YARDStatement` class is an adaptor that composes a `Pops::Model` instance
along with applicable `Pops::Adapter` and presents a familiar interface for
`YARD::Handler` objects to work with.
2014-05-22 22:44:15 -07:00
Charlie Sharpsteen c8d318b161 Re-architect around a YARD parser
Start building a YARD parser. Parsing and comment extraction has been moved out
of the yardoc face and into the new `Puppetx::Yardoc::YARD::PuppetParser`
class. The old `Commentor` class from the Util module has been renamed to
`Puppetx::Yardoc::Pops::YARDTransformer`.

`puppet yardoc` is still capable of extracting docstrings for node, class and
type definitions from a single manifest file.
2014-05-22 22:23:34 -07:00
Charlie Sharpsteen f53cbed1bb Add rudimentary comment extractor
With this patch, the `yardoc` face will parse a manifest file and then extract
any comments associated with each node, class and type definition.
2014-05-21 22:14:53 -07:00