Commit Graph

153 Commits

Author SHA1 Message Date
Will Hopper 6e3c973868 (PDOC-120) Update gh_pages task to allow publishing of _index.html
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.
2016-10-13 12:12:13 -07:00
Peter Huene 4f3f1e639e Merge pull request #111 from whopper/PDOC-95/master/multiple_defaultfor
(PDOC-95) Properly group and display multiple provider `defaultfor`s
2016-10-11 15:33:39 -07:00
Will Hopper d0f1fb7174 (PDOC-127) Strip whitespace from type feature docstrings 2016-10-11 14:48:02 -07:00
Will Hopper a5a3d6b48c (PDOC-95) Properly group and display multiple provider `defaultfor`s
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.
2016-10-11 13:57:00 -07:00
Will Hopper ca98890cdd (PDOC-122) Properly parse `newfunction` calls with newlines
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.
2016-10-10 15:27:23 -07:00
Peter Huene 7897c70a52
(maint) RuboCop fixes.
This commit fixes a few RuboCop related failures.
2016-09-15 17:15:54 -07:00
Peter Huene cf77ef1379
(PDOC-63) Add specs to test the new implementation.
This commit adds specs to cover parts of the new implementation of Puppet
Strings.
2016-09-15 17:15:54 -07:00
Peter Huene f2aa7d00c5
(PDOC-63) Implement the Puppet Strings rake tasks.
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.
2016-09-15 17:15:53 -07:00
Peter Huene 1be391ee87
(PDOC-63) Implement JSON output.
This commit implements the JSON output for Puppet strings.
2016-09-15 17:15:50 -07:00
Peter Huene f025efe557
(PDOC-63) Implement a Puppet function YARD handler.
This commit implements a YARD handler for Puppet functions and the
associated code object and templates.
2016-09-15 13:55:00 -07:00
Peter Huene b1a15bd43a
(PDOC-63) Implement a Puppet provider YARD handler.
This commit implements a YARD handler for Puppet providers and the
associated code object and templates.
2016-09-15 13:54:55 -07:00
Peter Huene 22396a13d0
(PDOC-63) Implement a Puppet resource type YARD handler.
This commit implements a YARD handler for Puppet resource types and the
associated code object and templates.
2016-09-15 13:54:50 -07:00
Peter Huene 187dec9cee
(PDOC-63) Implement a Puppet defined type YARD handler.
This commit implements a YARD handler for Puppet defined types and the
associated code object and templates.
2016-09-15 13:54:45 -07:00
Peter Huene 7c3cd5463c
(PDOC-63) Implement a Puppet class YARD handler.
This commit implements a YARD handler for Puppet classes and the associated
code object and templates.
2016-09-15 13:54:37 -07:00
Peter Huene f2e41a9c23
(PDOC-63) Implement the Puppet parser.
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.
2016-09-15 13:54:32 -07:00
Peter Huene d4bab8a5ab
(PDOC-63) Add initial YARD configuration.
This commit adds the initial YARD configuration.  Subsequent commits will
integrate the code objects, handlers, parsers, tags, and templates to support
Puppet code.
2016-09-15 13:54:27 -07:00
Peter Huene ea9dd0c846
(PDOC-63) Delete the old implementation.
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.
2016-09-15 13:54:18 -07:00
Peter Huene 56f266db4b
(maint) Rename puppetlab-strings to puppet-strings where appropriate.
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.
2016-09-14 13:42:28 -07:00
Henrik Lindberg 138dc25a7b Merge pull request #90 from baltimore-puppet-users-group/PDOC-71
(PDOC-71) Workaround for spurious error failures
2016-07-18 13:14:29 +02:00
Trevor Vaughan e39b4f3533 (PDOC-71) Workaround for spurious error failures
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.
2016-07-18 07:03:15 -04:00
David Danzilio 825614067a Handling existing doc directory 2016-07-05 15:52:06 -04:00
David Danzilio 84e6ade587 Adding GitHub Pages tasks 2016-07-05 15:52:06 -04:00
Jan Vansteenkiste 9f349dca9e PDOC-77: Add a new rake task which can be configured 2016-05-06 11:54:36 +02:00
Dmitry Ilyin 432eed1469 Add Puppet type name in front of the provider name
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.
2016-04-06 13:18:40 +03:00
Hailee Kenney 94e4efa6fa (maint) Fix 'type_expr' typo
Fix a typo where we were calling 'pop_param.type_exp' when we meant
to call 'pop_param.type_expr'.
2016-03-29 11:36:21 -07:00
Hailee Kenney 80e05bf6b1 Merge pull request #72 from garethr/output-json-from-rake-task
(PDOC-70) Always generate the JSON doc when running the rake task
2016-03-24 23:10:29 -07:00
Hailee Kenney e541e7c027 (PDOC-75) Work with both versions of 'interpret_any'
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.
2016-03-24 16:01:10 -07:00
Gareth Rushgrove 9160e6f970 (PDOC-70) Always generate the JSON doc when running the rake task
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.
2016-03-13 12:15:03 +00:00
Gareth Rushgrove 8bbbd7f698 Fix issue running strings:generate without a yardopts file
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.
2016-02-03 13:56:54 +01:00
Hailee Kenney 9e32817380 (maint) Fix ruby namespacing issue
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.
2015-12-08 12:00:58 -08:00
Julien Pivotto a2e622d2aa (maint) Delete .rb file that was probably commited by accident
Extension of the file is .rb but should be .erb, so I guess thir file
was committed by accident.
2015-10-26 16:28:01 +01:00
Ian Kronquist 86414df8de (PDOC-23) Polish JSON output command line behavior
Fix path where json is saved.
Suppress statistics when emitting json to stdout.
2015-10-16 15:50:04 -07:00
Ian Kronquist 0e1dbb17be (PDOC-23) Document JSON structure format 2015-10-16 15:50:04 -07:00
Ian Kronquist a9a387a05a (PDOC-23) Define JSON Structure for Puppet code 2015-10-16 15:50:04 -07:00
Ian Kronquist 0b0d3c9587 (PDOC-23) Add JSON Registry back end 2015-10-16 15:49:58 -07:00
Hailee Kenney d033183002 Merge pull request #54 from danzilio/gem
(PDOC-28) Make puppet strings available as a gem
2015-10-07 11:00:43 -07:00
Hailee Kenney d965d06bca Merge pull request #61 from iankronquist/same-name-type-and-provider
Same name type and provider
2015-09-21 16:47:34 -07:00
Ian Kronquist 97acd1b0b3 (PDOC-57) Get the content of the string
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`.
2015-09-18 16:17:29 -07:00
Ian Kronquist 3151e4e1b1 (PDOC-56) Fix type warning for defined types
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`.
2015-09-18 16:17:02 -07:00
Ian Kronquist 5dd65d3b5e (maint) Add newline for readability 2015-09-16 17:25:49 -07:00
Ian Kronquist 7814eeaf3c (PDOC-54) Providers & Types w/same name conflict
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.
2015-09-16 16:47:59 -07:00
Ian Kronquist 8aab1ea0a3 (maint) Remove debug statement on unusual path 2015-09-16 14:43:27 -07:00
David Danzilio 0431bc7735 (PDOC-28) Porting changes introduced in #46 2015-09-16 13:01:18 -04:00
David Danzilio aac19e67b7 (PDOC-28) Make puppet strings available as a gem 2015-09-16 13:00:00 -04:00
Hailee Kenney 3c885cf550 Merge pull request #59 from iankronquist/puppet-type-list-linebreak-pdoc-35
(PDOC-35) Format generated html properly
2015-09-15 15:39:36 -07:00
Ian Kronquist 7f4b81e77b (PDOC-53) Handle directives with no types
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, ...]
2015-09-15 09:57:46 -07:00
Ian Kronquist d2c178b59c (PDOC-52) Register docstring after object
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.
2015-09-15 09:55:50 -07:00
Ian Kronquist 1b421939d4 (PDOC-35) Format generated html properly
Shaigy Nixon on Jira:
"Just a trivial thing. Looks like one line break is missing from the type's
output html between the property and the allowed values for parameter. Rest all
looks great."
https://tickets.puppetlabs.com/browse/PDOC-35?focusedCommentId=215400&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-215400

As an aside, I would really like to rewrite this method to be a real erb
template and not this nonsense.
2015-09-14 12:03:43 -07:00
Ian Kronquist e26cb69d36 (PDOC-49) Improve warnings
1. Long warning should be broken onto multiple lines.
2. Warnings should begin with `[warn]:`
2015-09-11 14:30:14 -07:00
Ian Kronquist 1991475b4c (PDOC-35) Fix formatting from Nick's suggestions
* Float several namevars/ensurables to top of list
* Fix minor code style issues
2015-09-09 15:27:50 -07:00