Commit Graph

382 Commits

Author SHA1 Message Date
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
David Danzilio 4845bc2a0d (PDOC-28) Naming this gem puppet-strings instead of puppetlabs-strings. 2015-09-18 07:32:43 -04:00
Ian Kronquist 5dd65d3b5e (maint) Add newline for readability 2015-09-16 17:25:49 -07:00
Ian Kronquist c8eec8ded3 (maint) Fix typo in README 2015-09-16 16:49:25 -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 023c95ff62 (PDOC-28) Adding email to gemspec 2015-09-16 13:01:15 -04:00
David Danzilio 3974d20612 (PDOC-28) Being picky about spacing 2015-09-16 13:01:10 -04:00
David Danzilio 0dc8d95ce4 (PDOC-28) Adding syntax higlighting. Refactoring the gemspec a bit. 2015-09-16 13:00:59 -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
Hailee Kenney 7c109b231b Merge pull request #60 from iankronquist/types-and-providers-fixes
Types and providers fixes
2015-09-15 15:38:47 -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 3a2f70026e (PDOC-52) Fix section on Type directives
This confusion persists from a very old attempt at implementing support for
types and providers.
2015-09-15 09:56:49 -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 6581da0424 (maint) Update changelog for 0.3.0 release 2015-09-15 09:53:30 -07:00
Ian Kronquist cbc39d758a (maint) Fix README formatting
It was bugging me that the subheader wasn't on its own line.
2015-09-14 12:06:26 -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
Hailee Kenney 782fee5d0b Merge pull request #57 from iankronquist/improve-warnings-pdoc-49
(PDOC-49) Improve warnings
2015-09-11 14:50:04 -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 b00a6cc587 Merge pull request #56 from ferventcoder/ticket/master/PDOC-35-documentation-fixes
(PDOC-35) Clarify types and providers example
2015-09-10 10:54:40 -07:00
Rob Reynolds 0883beadeb (PDOC-35) Clarify types and providers example
- Clarify how desc/doc strings are automatically extracted
- Clarify in the example where my_parameter comes from
- add subheadings to Writing Compatible Documentation
2015-09-10 10:47:12 -05:00
Hailee Kenney 811df7d84d Merge pull request #47 from iankronquist/types-and-providers-docs
(PDOC-35) Document documenting puppet providers
2015-09-09 15:38:07 -07:00
Hailee Kenney 623011fd4a Merge pull request #46 from iankronquist/defined-types-and-providers-pdoc-35
(PDOC-35) Support types and providers
2015-09-09 15:33:33 -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
Ian Kronquist 0206c78ee0 (PDOC-35) Document types & providers separately
* Dunno, I just plowed through a bunch of features
* Expect puppet provider in stats output
* Fetch default values for Type params and props
* Detect allowed values
* Add allowed values to test
* htmlify scrubbed text
* Add features to Type html output
* Add infrastructure for types
* Add methods for generating lists, etc.
* Add provider code object
* Add provider handler
* Generate list for puppet provider dropdown
* Add puppet provider template
* Add provider details to puppet type template
* Get description properly for types
2015-09-09 14:35:45 -07:00
Ian Kronquist 798cd5b816 (PDOC-35) Add a directive for puppet parameters
* Print yard documentation statistics for providers
* Define a directive which takes a type and a name
2015-09-09 14:35:23 -07:00
Ian Kronquist 676364bd17 (PDOC-35) First pass at documenting providers
Adding a provider page and menu
* Add categories to html search bar
* Require provider handler and object classes
* Fetch provider code objects from registry
* Add function to generate the provider list
* Fetch providers from registry in monkey patches
* Add provider templates
* Add provider code object
* Add provider handler
* Add erb file to populate the provider list
* Don't emit type information for providers in html
* Add tests for provider handler

Refactor heredoc:
* Remove heredoc annotations
* Move heredoc functions into a heredoc helper
* Add heredoc helper class
2015-09-09 14:35:02 -07:00
Henrik Lindberg d6c8bc507c Merge pull request #50 from iankronquist/choke-yard-warnings
(PDOC-38) Prevent warnings from being issued twice
2015-09-07 05:28:34 -07:00
Henrik Lindberg eeeb89f565 Merge pull request #53 from iankronquist/fix-defined-function-crash
(PDOC-45) Puppet 4x functions handle unusual names
2015-09-07 05:25:16 -07:00
Ian Kronquist 11e016e81e (PDOC-38) Prevent warnings from being issued twice
Since we threw away all of Yard's warnings we are no longer checking that the
parameter names match for Ruby methods. Thus we need to override Yard's
method_details template with our own to trigger our warning function. However,
there's a catch. If this ruby method is in a Puppet 4x function, we don't want
our warning function to trigger because the user has already been warned. Look
in the registry to see if there is already a Puppet 4x function with the same
name registered.

Also, print errors to stderr instead of using log.warn.
2015-09-04 14:45:08 -07:00
Ian Kronquist c4a1a10c67 (PDOC-45) Test Puppet 4x functions don't throw
Parsing puppet 4x functions with symbols for their names like :'defined' should
not raise ParseErrorWithIssue, or anything for that matter.
2015-09-01 15:42:37 -07:00
Ian Kronquist 84a215d599 (PDOC-45) Puppet 4x functions handle unusual names
`lib/puppet/functions/defined.rb` has some unusual syntax:

	Puppet::Functions.create_function(:'defined', ....

It runs, so apparently this is legal.
2015-09-01 15:31:13 -07:00
Ian Kronquist 346832a5f8 Merge pull request #51 from roidelapluie/master
(MAINT) Add a space between a parameter name type and its description
2015-08-31 09:48:44 -07:00
Julien Pivotto 005a3112c9 (MAINT) Add a space between a parameter name type and its description
Before this commit:

    packages (Array[String])- A list of packages to be installed

With this commit:

    packages (Array[String]) - A list of packages to be installed
2015-08-31 12:27:28 +02:00
Ian Kronquist f052675088 (PDOC-38) Add parameter mismatch warnings for 4.x 2015-08-21 10:36:31 -07:00
Ian Kronquist fe2420bc01 (PDOC-38) Monkey patch Yard's logger
Redirect Yard command line warnings to a log file called `.yardwarns`.
Yard warnings may be irrelevant, spurious, or may not conform with our
styling and UX design. They are also printed on stdout by default.
2015-08-21 10:36:31 -07:00
Hailee Kenney 2a11a85787 Merge pull request #49 from iankronquist/duplicate-warnings
(PDOC-21) Duplicate warnings
2015-08-19 10:58:01 -07:00
Ian Kronquist f5c4c4c861 (PDOC-21) Test for duplicate hostclass warnings
* Add testing file based off shaigy's tests.
* Refactor using_module into a helper class.
* Expect that the warnings printed to stdout are *exactly* what I want to see
  and nothing else.
2015-08-19 10:50:03 -07:00
Ian Kronquist bd8d159016 (PDOC-21) Fix duplicate warnings for hostclasses
Host classes inherit behavior from defined types. I didn't realize this when I
was first implementing this functionality.
2015-08-19 10:47:32 -07:00
Hailee Kenney aebdda4acd Merge pull request #48 from iankronquist/double-hostclass-params/PDOC-21
(PDOC-21) Only create HostClass parameters once
2015-08-12 10:31:46 -07:00
Ian Kronquist badd019364 (PDOC-21) Only create HostClass parameters once
You can pass a block to the constructor of the hostclass. For some reason Yard
is yielding the block twice. Our code is not yielding the block because we only
use yield in one place which is unrelated. I don't think this is intended
behavior on yard's part, it certainly seems odd, but we can dodge the question
and not have to wait for an upstream patch by extracting the logic from the
block and running it after the object has been initialized.
2015-08-12 10:18:31 -07:00
Ian Kronquist 9b8777c1b4 (PDOC-35) Document documenting puppet providers
Add instructions on how to use the `@!puppet.provider.param` directive to
document parameters which are created via metaprogramming.
2015-08-11 11:53:01 -07:00
Hailee Kenney 05f489fcee Merge pull request #45 from iankronquist/extraneous-true
(maint) Don't print extraneous "true".
2015-08-04 16:09:17 -07:00
Ian Kronquist f7165d6634 (maint) Don't print extraneous "true".
Suppress it by printing an empty string instead.
2015-08-04 15:34:13 -07:00
Hailee Kenney c33f911f09 Merge pull request #44 from iankronquist/defined-types-mismatched-types
(PDOC-21) Check mismatched types in defined types
2015-08-03 15:49:29 -07:00
Ian Kronquist c7af917c35 (PDOC-21) Check mismatched types in defined types
Check that the types for defined types match those specified in the
documentation. This is already being done for classes.
2015-08-03 14:12:32 -07:00
Hailee Kenney b1b27a33d3 Merge pull request #41 from iankronquist/nested-classes/pdoc-35
Nested classes/pdoc 35
2015-07-30 14:07:10 -07:00
Kylo Ginsberg a9781d65bd Merge pull request #43 from iankronquist/yard-install-instructions/pdoc-33
(PDOC-33) Inform reader how to install yard gem
2015-07-29 13:17:56 -07:00