Commit Graph

181 Commits

Author SHA1 Message Date
Hailee Kenney 26945eacf3 (PDOC-24) Fix comments and remove unneeded sections
Prior to this commit, some of the comments in the code were not as
clear as they should have been and in some places comments were not
present where they were needed. Clean up existing comments and
add some for sections of code that are not very clear.

Additionally, some sections of the template for puppet namespaces
didn't really make sense to include, especially since we want the source
of truth for documentation of 3x functions to be the :doc string which is
passed in (not the comment block above the function). Thus, remove some of
the unneeded sections from the puppet namespace template.
2015-01-28 16:25:22 -08:00
Hailee Kenney 121bcfd2a7 (PDOC-24) Add support for @param in 3x functions
Prior to this commit, the @param tag was not supported for 3x
functions since we could not derive any information about the
parameter from the code itself. Since we would still like users
to be able to document parameters if they wish, update the code so
that if a parameter is documented in the 3x :doc string it will be
displayed in the HTML.
2015-01-28 14:17:20 -08:00
Hailee Kenney b9da8b164f (PDOC-24) Create helper class for templates
Prior to this commit some of the logic used to extract data from
comments for templates was duplicated and a little messy. Create
the TemplateHelper class so that can be simplified and cleaned up
to make things more readable and efficient.
2015-01-22 22:26:58 -08:00
Hailee Kenney 60b2802f04 (PDOC-24) Clean up code for HTML generation
Prior to this commit there was a lot of duplicated code around
the generation of HTML for templates. Clean up and simplify code by
adding an HTMLHelper class with helper functions which can be used
in place of repeated logic.
2015-01-22 15:21:01 -08:00
Hailee Kenney 5f60c99bfd (PDOC-24) Add custom header for puppet functions
Prior to this commit, all the HTML for puppet functions was just
generated by YARD as if it were a regular method. Since we ultimately
want to have our own custom templates, lay out the groundwork for customizing
the templates for functions and update the page headers to be more
readable.

At the moment the code is functional but contains a lot of duplication which
needs to be cleaned up.
2015-01-21 16:03:35 -08:00
Henrik Lindberg 345d72b2d7 Merge pull request #21 from hkenney/issue/master/PDOC-17_add_support_for_yard_tags
(PDOC-17) Add support for YARD tags in puppet code
2015-01-06 12:47:31 -08:00
Hailee Kenney 1fae19e5ae (PDOC-17) htmlify class/defined type descriptions
Prior to this commit we were not calling htmlify on the docstring
for the description of a puppet class on defined type. This meant that
the raw string would be displayed without paying attention to any
potential markdown or rdoc formatting present.

Now the YARD method htmlify is being called on the docstring so that
it will be displayed properly.

Additionally clean up an unclear comment and fix a small bug in
the way parameter information is processed.
2015-01-06 10:59:30 -08:00
Hailee Kenney e85f58a64e (PDOC-17) Changed header and remove sub-header
Prior to this commit there was a header and a sub-header for
defined types and classes. This was a little redundant so rather
than doing that, remove the sub-header and make the main header
more readable.
2014-12-30 15:20:59 -08:00
Hailee Kenney 1f2d9a2d8a (PDOC-17) Clean up code and update README
Do a bit of renaming and add some comments to make the processing
of parameter details a bit more clear. Additionally, update the
example in the README so that it will actually be parsed properly
by YARD (since YARD does not expect the one line title before the
description).
2014-12-18 13:34:43 -08:00
Hailee Kenney d15269458e (PDOC-17) Add TBD for unspecified parameter types
Prior to this commit if the type for a parameter was not specified
in the comment, nothing would be printed. Since we'll soon be adding
functionality which will determine the type programmatically, it
made more since to leave a place holder rather than nothing at all.
As such, the type is now listed as "TBD" if it is not specified
by the user in the comment.
2014-12-18 10:40:22 -08:00
Hailee Kenney 1cdf7d41e9 (PDOC-17) Fix up parameter documentation
Prior to this commit there were a few issues in the way information
about parameters was collected. The previous implementation relied
on parameters and their corresponding comments to be listed in the
same order. Now the parameter is matched to the corresponding comment
using the parameter name in the comment.

Additionally, if a comment is present for a parameter that does
not actually exist in the method it will appear as strike through
in the HTML.
2014-12-17 16:39:56 -08:00
Hailee Kenney de3c1e776d (PDOC-17) Add support for YARD tags in puppet code
Prior to this commit, most of the HTML created for documenting
puppet code was auto-generated by YARD, meaning that it was not
always presented in a way that was consistent or easy to read.

Now we are explicitly defining the HTML and styling that we want
to use when generating documentation for defined types and classes.
This means that we can define exactly how we want the output to look
so that is more compatible with puppet code.
2014-11-25 14:44:49 -08:00
Andrew Parker 78ba39b08b Merge pull request #20 from hkenney/maint/master/pdoc-11_update_readme_with_examples_and_resources
(PDOC-13) Update README with examples and resources
2014-10-21 09:05:58 -07:00
Hailee Kenney eafe3eaa32 (maint) Exclude files that cause YARD errors
Running `puppet strings server` generates documentation for all
modules in your modulepath, meaning that it also generates HTML
for strings itself. Since there are parts of strings that are not
meant to be documented with YARD, exclude the files that cause
error messages so that `puppet strings server` is not needlessly
noisy.

Additionally, make a few suggested changes to the README to make
it clearer and easier to read.
2014-10-20 17:37:49 -07:00
Hailee Kenney 408d875986 (PDOC-13) Add documentation examples to README
In order to make it easier for users, give some basic examples
in the README of how write documentation that is compatible with
strings. Also provide a few resources for getting started.
2014-10-20 11:35:14 -07:00
Hailee Kenney 406432d15d (maint) Update metadata.json for 0.1.1 release 2014-10-16 14:02:32 -07:00
Hailee Kenney cbda14f093 (maint) Add build status to README.md
In order to make it easy to quickly tell if the Travis CI build is currently green,
add a badge to the README.
2014-10-16 13:37:47 -07:00
Hailee Kenney 62f080a589 (maint) Fix ironic misspelling of intelligence
intelligance -> intelligence in README.md
2014-10-15 15:53:27 -07:00
Henrik Lindberg 0a3c60a260 Merge pull request #19 from hkenney/issue/master/pdoc14_fix_strings_for_future_parser
(PDOC-14) Fix strings to work with future parser
2014-10-14 16:32:22 -07:00
Josh Cooper adae47b90f Merge remote-tracking branch 'upstream/pr/18'
* upstream/pr/18:
  (PDOC-8) Add rubocop to travis job
  (PDOC-8) Fix present rubocop offenses
  (PDOC-8) Add .rubocop.yml to project
2014-10-14 16:24:29 -07:00
Hailee Kenney 9d53a8091a (PDOC-14) Fix strings to work with future parser
Prior to this commit, two require statements were in the wrong
order, causing strings to fail when running against anything that
required the future parser.

Now, those requires have been flipped and strings can run with
`--parser future` successfully.
2014-10-13 08:29:15 -07:00
Hailee Kenney 1abca4705f (PDOC-8) Add rubocop to travis job
In order to ensure long term code quality, add a rubocop check to
the travis job which runs when a pull request is submitted. Do this
by adding a rake task for rubocop and setting up travis to run
both the spec rake task and the rubocop one.

Additionally, make a few changes to the .rubocop.yml file so it
will stop complaining about incorrect namespaces.
2014-10-08 14:15:29 -07:00
Hailee Kenney 999daa9c4c (PDOC-8) Fix present rubocop offenses
Since we want to run rubocop in travis when pull requests are
submitted, fix a few pre-existing rubocop offenses.
2014-10-08 11:36:21 -07:00
Hailee Kenney c7f3880d40 (PDOC-8) Add .rubocop.yml to project
Since we want to use rubocop to help maintain the code quality of
this project, add a .rubocop.yml file (borrowed from the puppet repo)
so that we can successfully enforce the things we want and disable
those we don't.
2014-10-07 16:40:51 -07:00
Hailee Kenney 96bb8c9219 Merge pull request #17 from adreyer/master
"project_page" should point to the source.
2014-10-07 14:09:56 -07:00
Alex Dreyer eb8496bb16 "project_page" should point to the source. 2014-10-07 14:05:42 -07:00
Hailee Kenney 70cea041d0 Merge pull request #15 from sbadia/fix-typo
(maint) readme: Fix puppet server typo
2014-10-07 13:39:00 -07:00
Henrik Lindberg a456f2348b Typo in Readme.md 2014-10-07 13:02:06 -07:00
Sebastien Badia 81887932cf readme: Fix puppet server typo
Fix server typo and remove whitespaces.
2014-10-07 20:51:27 +02:00
Hailee Kenney e9ee2c39a9 (maint) Add forge link to README
To make it easier for users to find the strings module on the forge,
add a link to the module's forge page in the README.
2014-10-07 11:44:39 -07:00
Hailee Kenney d4810a7f25 Merge pull request #14 from mhaskel/metadata_fixes
Make metadata match file generated by pmt
2014-10-07 10:22:44 -07:00
Morgan Haskel cb630bf639 Make metadata match file generated by pmt 2014-10-07 13:14:36 -04:00
Hailee Kenney 78cc103d91 (maint) Use requirements instead of dependencies
In the previous commit, the metadata.json file was changed to have
puppet as a dependency rather than a requirement. This caused the
module to try to install puppet from the Forge which was not the
desired behavior for many reasons. Therefor, update the metadata
file to use requirements instead of dependencies.
2014-10-06 16:26:40 -07:00
Hailee Kenney 637deb6979 (maint) Update metadata.json for 0.1.0 release 2014-10-06 15:51:23 -07:00
Andrew Parker 67c42a2f49 Merge pull request #13 from hkenney/issue/master/pdoc9_add-full-system-test
(PDOC-9) Add full system test
2014-10-06 15:29:49 -07:00
Hailee Kenney d4059b6857 (PDOC-9) Update acceptance take task for Jenkins
In order to allow for multiple platforms on Jenkins, use the
platform environment variable in the rake task for acceptance tests
to determine which platform to run on.
2014-10-06 15:25:36 -07:00
Hailee Kenney aea5c9537f (PDOC-9) Switch to metadata.json for test module
Prior to this commit, the test module used in testing was using
a Modulefile rather than metadata.json. Switch to metadata.json
instead since Modulefile is deprecated and was causing a deprecation
warning during acceptance testing.
2014-10-06 10:21:58 -07:00
Hailee Kenney ee6997cd24 (PDOC-9) Add preliminary full system test
In order to help ensure that the strings module is not broken
during development, add a full system integration test which can
run at regular intervals to ensure that the module is working as
expected.

The test installs the string module as well as a test module which
contains the different types of puppet and ruby code that the strings
module can document. It then runs strings and ensures that the HTML
generated is correct.

Additionally, make some changes to the Gemfile to allow strings to
be run as a gem even if it isn't installed in the modulepath. Also
make a few changes to the unit tests to make them compatible with
the version of rspec required by Beaker.
2014-10-06 10:08:30 -07:00
Andrew Parker b07fc4a661 Merge branch 'hkenney-maint/master/add_committers_and_contributing_md'
* hkenney-maint/master/add_committers_and_contributing_md:
  (maint) Remove reference to other platforms
  (maint) Remove references to stable in COMMITTERS
  (maint) Add COMMITTERS.md and CONTRIBUTING.md

Closes GH-11
2014-10-03 17:15:33 -07:00
Andrew Parker b696882239 (maint) Remove reference to other platforms
The "other platforms" is language from puppet where we don't always have
access to various OS and version combinations. Strings is much simpler
and so it isn't really relevant.
2014-10-03 17:14:14 -07:00
Andrew Parker bf24ae2092 Merge branch 'hkenney-maint/master/pdoc-10_update_readme_md'
* hkenney-maint/master/pdoc-10_update_readme_md:
  (PDOC-10) Try to simplify the installation
  (maint) Add LICENSE file
  (PDOC-10) Update README.md to be more detailed
2014-10-03 15:01:18 -07:00
Andrew Parker 92a3bd902c (PDOC-10) Try to simplify the installation
The instructions for installation provided a lot of different
alternatives. In order to quickly answer the question of "how do I use
this" we can just give the most common ways of getting it installed.
2014-10-03 14:59:55 -07:00
Hailee Kenney 4abb0d04d3 (maint) Add LICENSE file
Add an Apache License for this project to be consistent with other
puppetlabs modules.
2014-10-01 14:49:19 -07:00
Hailee Kenney 2ed04c616f (PDOC-10) Update README.md to be more detailed
Since puppet strings will soon release a 0.1.0 version, update the
README.md file to include the necessary details about the project.
2014-10-01 14:37:13 -07:00
Hailee Kenney fa8af6693d (maint) Fix incorrectly resolved merge conflict
Due to a merge conflict that was not properly resolved, a method
which did not exist was being called in the server action, causing
the action to fail. Remove the unneeded method call so that the
server action will work as intended.
2014-10-01 11:32:12 -07:00
Hailee Kenney 3c826a0ca8 (maint) Remove references to stable in COMMITTERS
Since puppet strings is a very small project, at the moment we
don't need to maintain a master and a stable branch. As a result,
the COMMITTERS.md guide should not contain references to the stable
branch or include information around dealing with both the master
and stable branch. Remove these references so that COMMITTERS is
consistent with our approach to the strings repository.
2014-10-01 09:42:57 -07:00
Andrew Parker 970b60481f Merge pull request #7 from hkenney/PDOC-3_refactor-prototype-code
(PDOC-3) Refactor prototype code to make it more readable
2014-09-30 14:57:35 -07:00
Hailee Kenney 6d1d5b496d (PDOC-3) Relocate plugin configuration
The plugin.rb file really only did configuration of components that were already loaded.
By relocating to the strings.rb file, it provides a central place for all of the loading
and configuration of the strings components.
2014-09-30 14:21:20 -07:00
Hailee Kenney 14571c098d (PDOC-3) Make references to YARD explicit
The specs were including YARD into the Kernel, which allowed shorter references to the Registry, but also obscured that
the Registry is part of YARD.
2014-09-30 14:02:31 -07:00
Hailee Kenney 5159a7b778 (PDOC-3) Move requires to top level scope
Prior to this commit, the requires for the puppetx portion of this
project were dealt with in each individual file. In order to make
the code more readable and the requires more clear, move them all
into the strings file.
2014-09-30 13:55:11 -07:00