Previously, due to Jekyll's default rule of not allowing files beginning
with an '_' to be published, the gh_pages rake task led to broken links.
This commit adds a step to the task which adds a _config.yml file to the
`doc` directory of the gh-pages branch which explicitly allows the file
to be published.
Prior to this commit, strings did not properly handle providers
which had multiple related `defaultfor`s. In code, these are written
as comma-separated constraints. This commit updates strings' puppet
provider handler, as well as the template which generates HTML for
`defaultfor` statements.
Note that it was necessary to make a breaking change to the JSON
schema to accomodate multiple AND'ed defaults. Previously, provider
defaults were contained in a single key-value map. Now, they are
contained in an array of key-value lists, which allows multiple
constraints to be associated with each other.
When `newfunction` is separated from the Puppet::Parser::Functions module name by a
newline, YARD ignores the namespace and uses `newfunction` as the source of the
first statement.
Prior to this commit, strings didn't recognize this case, and 3.x functions written
in this way were not parsed as functions. This commit updates the ruby function handler
to identify and properly parse 3.x functions that include a newline between the
Puppet::Parser::Function namespace and the newfunction method call.
This commit implements the `strings:generate` and `strings:gh_pages:update`
rake tasks.
The `strings:generate` task is responsible for generating Puppet Strings
documentation.
The `strings:gh_pages:update` task is responsible for updating the `gh_pages`
branch of a GitHub repository with the latest Puppet Strings documentation.
This commit implements the Puppet language parser that future handlers will use
to generate YARD code objects for classes, defined types, and functions written
in Puppet.
This commit adds the initial YARD configuration. Subsequent commits will
integrate the code objects, handlers, parsers, tags, and templates to support
Puppet code.
This commit deletes the old implementation to assist in cleaner code reviews of
the upcoming reimplementation.
This commit also moves YARD to version 0.9.5 and lays down a bare bones
implementation of Puppet Strings that currently does nothing.
This commit changes the source and documentation to reference this project as
`puppet-strings` rather than `puppetlabs-strings`.
This makes the source and project match the gem name.
This patch catches and reports on issues that have occurred during YARD
processing of the data to be processed.
The issue itself is not resolved but this does provide you with as much
documentation as can be reasonably generated for your materials without
crashing the build.
This was the result of the Baltimore Puppet Users Group Meetup of 22
June 2016.
It will prevent providers of different types but with
the same name from merging together.
For example:
type1:ruby
type2:ruby
type3:ruby
Will be different providers instead of the one "ruby" provider.
Prior to this commit, strings would fail with puppet 4.4.0 and
newer. This was because strings was making use of a method that was
marked API private and thus subject to change. The method was changed
in 4.4.0 release of puppet to take two variables, meaning that strings
much adjust how it calls the method based on the version of puppet
it's running with.
I'm super enthusiastic about the potential for folks to build things on
top of the JSON output, we've had several related conversations at
Config Management Camp and on puppet-dev recently. I think this is a
sane default, and calling the file strings.json seems a nice
reinforcement.
Without a .yardopts options array.pop is nil, and everything explodes
with an exception. Applying this patch allowed for running rake
strings:generate cleanly.
Note that this did not affect strings:serve.
Prior to this commit, strings would raise an error when the server
command was run against a module directory that contained the strings
module. This was due to the fact that we were trying to reference
the YARD namespace but our own namespace was being prepending to the
front, making Ruby think the two class were the same.
In order to stop this from happening, prepend a :: to the front of the
YARD version of the class to tell Ruby that we mean the YARD namespace.
We used to extract the string from the source code. We should have extracted
the content of the string. This is the difference between `"String"` and
`String`.
Puppet defined types would print the string representation of the ruby object,
and not representation you would see in puppet. This is the difference between
`Puppet::Pops::Types::PStringType` and `String`.
If a provider and a type with the same name conflict strings will overwrite the
documentation of one of them with the other. That is if both a provider and a
type are named apt_key, strings will write the type to doc/apt_key.html and the
provider to doc/apt_key.html. The fix is to write the provider to
doc/apt_key_provider.html and the type to doc/apt_key_type.html.
Parameter directives with no types will have `tag.type` set to nil. We cannot
append nil to an array, so instead, place it in the array and flatten the
array. If the property is empty the second entry in the array will be nil, as
we expect. If the `tag.type` is an array of types we will have and array with
the form:
[tag.text, type1, type2, type3, ...]
In a Puppet type if the user documents a parameter with the directive, then
Yard will read the parameter and think there is an empty docstring there. This
will overwrite the docstring we extracted.
The fix is simple -- overwrite our docstring with theirs, if our docstring
exists at all.