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.
This commit changes the metadata.json to use the
SPDX licence short identifier in the metadata.json.
SPDX is an effort from the Linux foundation to easily
parse and identify open-source licenses. Some tools
in the Puppet Ecosystem relies on those short
identifiers, like the metadata-json-lint project.
- https://spdx.org/licenses
- https://github.com/puppet-community/metadata-json-lint
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.