From 56f266db4b8ca65bd240dcdaf3e80d8e4f01a4ed Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Tue, 23 Aug 2016 12:55:40 -0700 Subject: [PATCH] (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. --- .rubocop.yml | 2 +- .yardopts | 4 +- CHANGELOG.md | 4 +- COMMITTERS.md | 14 ++-- CONTRIBUTING.md | 6 +- README.md | 22 +++---- lib/puppet-strings/rake_tasks.rb | 6 +- lib/puppet-strings/rake_tasks/generate.rb | 12 ++-- lib/puppet/face/strings.rb | 10 +-- lib/puppet_x/puppet/strings.rb | 64 +++++++++++++++++++ .../{puppetlabs => puppet}/strings/actions.rb | 4 +- .../strings/pops/yard_statement.rb | 2 +- .../strings/pops/yard_transformer.rb | 6 +- .../{puppetlabs => puppet}/strings/util.rb | 10 +-- .../yard/code_objects/defined_type_object.rb | 2 +- .../yard/code_objects/host_class_object.rb | 4 +- .../yard/code_objects/method_object.rb | 0 .../yard/code_objects/provider_object.rb | 2 +- .../code_objects/puppet_namespace_object.rb | 2 +- .../strings/yard/code_objects/type_object.rb | 2 +- .../strings/yard/core_ext/yard.rb | 3 +- .../strings/yard/handlers/base.rb | 6 +- .../yard/handlers/defined_type_handler.rb | 2 +- .../strings/yard/handlers/heredoc_helper.rb | 4 +- .../yard/handlers/host_class_handler.rb | 2 +- .../strings/yard/handlers/provider_handler.rb | 4 +- .../handlers/puppet_3x_function_handler.rb | 4 +- .../handlers/puppet_4x_function_handler.rb | 6 +- .../strings/yard/handlers/type_handler.rb | 8 +-- .../strings/yard/json_registry_store.rb | 0 .../strings/yard/monkey_patches.rb | 0 .../strings/yard/parser.rb | 8 +-- .../default/definedtype/html/docstring.erb | 0 .../default/definedtype/html/header.erb | 0 .../definedtype/html/parameter_details.erb | 0 .../default/definedtype/html/setup.rb | 0 .../templates/default/definedtype/setup.rb | 0 .../default/fulldoc/html/full_list_class.erb | 0 .../html/full_list_puppet_manifest.erb | 0 .../fulldoc/html/full_list_puppet_plugin.erb | 0 .../html/full_list_puppet_provider.erb | 0 .../fulldoc/html/full_list_puppet_type.erb | 0 .../templates/default/fulldoc/html/setup.rb | 2 +- .../default/hostclass/html/box_info.erb | 0 .../templates/default/hostclass/html/setup.rb | 0 .../default/hostclass/html/subclasses.erb | 0 .../yard/templates/default/hostclass/setup.rb | 0 .../yard/templates/default/html_helper.rb | 0 .../templates/default/layout/html/setup.rb | 0 .../default/method_details/html/header.erb | 0 .../templates/default/method_details/setup.rb | 2 +- .../default/method_details/text/header.erb | 0 .../default/provider/html/command_details.erb | 0 .../default/provider/html/confine_details.erb | 0 .../default/provider/html/default_details.erb | 0 .../default/provider/html/docstring.erb | 0 .../default/provider/html/feature_details.erb | 0 .../default/provider/html/header.erb | 0 .../templates/default/provider/html/setup.rb | 0 .../yard/templates/default/provider/setup.rb | 0 .../default/puppetnamespace/html/box_info.erb | 0 .../default/puppetnamespace/html/header.erb | 0 .../html/method_details_list.erb | 0 .../puppetnamespace/html/method_summary.erb | 0 .../default/puppetnamespace/html/setup.rb | 0 .../default/puppetnamespace/setup.rb | 0 .../yard/templates/default/template_helper.rb | 0 .../templates/default/type/html/docstring.erb | 0 .../templates/default/type/html/header.erb | 0 .../default/type/html/parameter_details.erb | 0 .../default/type/html/provider_details.erb | 0 .../yard/templates/default/type/html/setup.rb | 0 .../yard/templates/default/type/setup.rb | 0 lib/puppet_x/puppetlabs/strings.rb | 64 ------------------- .../strings/yard/tags/directives.rb | 9 --- puppet-strings.gemspec | 6 +- spec/spec_helper.rb | 2 +- .../strings/pops_spec.rb | 10 +-- .../strings/yard/defined_type_handler_spec.rb | 4 +- .../lib/test.rb | 0 .../lib/test.rb | 0 .../test-param-names-differ/lib/test.rb | 0 .../lib/test.rb | 0 .../lib/test.rb | 0 .../test-param-names-match/lib/test.rb | 0 .../yard/examples/test/manifests/init.pp | 0 .../strings/yard/host_class_handler_spec.rb | 4 +- .../yard/puppet_3x_function_handler_spec.rb | 4 +- .../yard/puppet_4x_function_handler_spec.rb | 4 +- .../strings/yard/template_helper_spec.rb | 16 ++--- .../strings/yard/type_handler_spec.rb | 4 +- 91 files changed, 173 insertions(+), 183 deletions(-) create mode 100644 lib/puppet_x/puppet/strings.rb rename lib/puppet_x/{puppetlabs => puppet}/strings/actions.rb (97%) rename lib/puppet_x/{puppetlabs => puppet}/strings/pops/yard_statement.rb (97%) rename lib/puppet_x/{puppetlabs => puppet}/strings/pops/yard_transformer.rb (84%) rename lib/puppet_x/{puppetlabs => puppet}/strings/util.rb (85%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/code_objects/defined_type_object.rb (84%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/code_objects/host_class_object.rb (77%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/code_objects/method_object.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/code_objects/provider_object.rb (82%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/code_objects/puppet_namespace_object.rb (93%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/code_objects/type_object.rb (91%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/core_ext/yard.rb (97%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/handlers/base.rb (56%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/handlers/defined_type_handler.rb (88%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/handlers/heredoc_helper.rb (95%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/handlers/host_class_handler.rb (94%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/handlers/provider_handler.rb (95%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/handlers/puppet_3x_function_handler.rb (90%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/handlers/puppet_4x_function_handler.rb (97%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/handlers/type_handler.rb (97%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/json_registry_store.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/monkey_patches.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/parser.rb (64%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/definedtype/html/docstring.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/definedtype/html/header.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/definedtype/html/parameter_details.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/definedtype/html/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/definedtype/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/fulldoc/html/full_list_class.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/fulldoc/html/full_list_puppet_manifest.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/fulldoc/html/setup.rb (94%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/hostclass/html/box_info.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/hostclass/html/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/hostclass/html/subclasses.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/hostclass/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/html_helper.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/layout/html/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/method_details/html/header.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/method_details/setup.rb (91%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/method_details/text/header.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/provider/html/command_details.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/provider/html/confine_details.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/provider/html/default_details.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/provider/html/docstring.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/provider/html/feature_details.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/provider/html/header.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/provider/html/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/provider/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/puppetnamespace/html/box_info.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/puppetnamespace/html/header.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/puppetnamespace/html/method_details_list.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/puppetnamespace/html/method_summary.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/puppetnamespace/html/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/puppetnamespace/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/template_helper.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/type/html/docstring.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/type/html/header.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/type/html/parameter_details.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/type/html/provider_details.erb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/type/html/setup.rb (100%) rename lib/puppet_x/{puppetlabs => puppet}/strings/yard/templates/default/type/setup.rb (100%) delete mode 100644 lib/puppet_x/puppetlabs/strings.rb delete mode 100644 lib/puppet_x/puppetlabs/strings/yard/tags/directives.rb rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/pops_spec.rb (79%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/defined_type_handler_spec.rb (93%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/examples/test-param-names-differ-with-dispatch/lib/test.rb (100%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/examples/test-param-names-differ-with-types/lib/test.rb (100%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/examples/test-param-names-differ/lib/test.rb (100%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/examples/test-param-names-match-with-dispatch/lib/test.rb (100%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/examples/test-param-names-match-with-types/lib/test.rb (100%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/examples/test-param-names-match/lib/test.rb (100%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/examples/test/manifests/init.pp (100%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/host_class_handler_spec.rb (95%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/puppet_3x_function_handler_spec.rb (91%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/puppet_4x_function_handler_spec.rb (97%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/template_helper_spec.rb (84%) rename spec/unit/puppet_x/{puppetlabs => puppet}/strings/yard/type_handler_spec.rb (92%) diff --git a/.rubocop.yml b/.rubocop.yml index 56eb8da..dd88b39 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ AllCops: Exclude: # Ignore HTML related things - '**/*.erb' - - 'lib/puppetx/puppetlabs/strings/yard/templates/**/*' + - 'lib/puppetx/puppet/strings/yard/templates/**/*' Lint/ConditionPosition: Enabled: true diff --git a/.yardopts b/.yardopts index e30cb06..bddb273 100644 --- a/.yardopts +++ b/.yardopts @@ -1,2 +1,2 @@ ---exclude lib/puppetx/puppetlabs/strings/yard/templates/ ---exclude lib/puppetx/puppetlabs/strings/yard/code_objects/host_class_object.rb +--exclude lib/puppetx/puppet/strings/yard/templates/ +--exclude lib/puppetx/puppet/strings/yard/code_objects/host_class_object.rb diff --git a/CHANGELOG.md b/CHANGELOG.md index 413df44..0e91af0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,8 @@ All related tickets can be found under the [PDOC][PDOC JIRA] JIRA project with t ###Features - Support for JSON output **(PDOC-23)** - Strings now has the ability to produce a JSON representation of a given puppet module - - The details of the JSON schema can be found [here](https://github.com/puppetlabs/puppetlabs-strings/blob/master/json_dom.md) - - For details on how to generate JSON, see the [README](https://github.com/puppetlabs/puppetlabs-strings/blob/master/README.md#running-puppet-strings) + - The details of the JSON schema can be found [here](https://github.com/puppetlabs/puppet-strings/blob/master/json_dom.md) + - For details on how to generate JSON, see the [README](https://github.com/puppetlabs/puppet-strings/blob/master/README.md#running-puppet-strings) - Migrate to ruby gems as a distribution method **(PDOC-28)** - This is the last release of strings that will be available as a puppet module - The 0.4.0 release will be released concurrently as a ruby gem diff --git a/COMMITTERS.md b/COMMITTERS.md index b7a6b77..03a2a64 100644 --- a/COMMITTERS.md +++ b/COMMITTERS.md @@ -53,9 +53,9 @@ merged. **security** - Where critical security fixes are merged. These change sets will then be merged into release branches independently from one another. (i.e. no merging up). Please do not submit pull requests against the security branch -and instead report all security related issues to security@puppetlabs.com as +and instead report all security related issues to security@puppet.com as per our security policy published at -[https://puppetlabs.com/security/](https://puppetlabs.com/security/). +[https://puppet.com/security/](https://puppet.com/security/). Committer Guide ==== @@ -84,8 +84,8 @@ applied to earlier minor releases of a major release, but the patches should first be merged into the `security` branch. Security patches should be merged by Puppet Labs staff members. Pull requests should not be submitted with the security branch as the base branch. Please send all security related -information or patches to security@puppetlabs.com as per our [Security -Policy](https://puppetlabs.com/security/). +information or patches to security@puppet.com as per our [Security +Policy](https://puppet.com/security/). The CI systems are configured to run against `master`. Over time, this branch will refer to different versions, but its name will remain fixed to avoid having @@ -118,7 +118,7 @@ This section aims to provide guidelines for being a good commit citizen by paying attention to our automated build tools. * Don’t push on a broken build. (A broken build is defined as a failing job - in the [Puppet FOSS](https://jenkins.puppetlabs.com/view/Puppet%20FOSS/) + in [Puppet Strings](https://jenkins.puppetlabs.com/job/platform_puppet-strings_unit-ruby_master/) page.) * Watch the build until your changes have gone through green * Update the ticket status and target version. The target version field in @@ -143,7 +143,7 @@ First, the committer pulls down the branch using the `hub` gem. This tool automates the process of adding the remote repository and creating a local branch to track the remote branch. - $ hub checkout https://github.com/puppetlabs/puppetlabs-strings/pull/123 + $ hub checkout https://github.com/puppetlabs/puppet-strings/pull/123 Branch jeffmccune-pdoc-34_fix_foo_error set up to track remote branch pdoc-34-fix_foo_error from jeffmccune. Switched to a new branch 'jeffmccune-pdoc-34_fix_foo_error' @@ -178,7 +178,7 @@ Please note, the checklist should be complete at this point. It's helpful to mak sure your local branches are up to date to avoid one of the branches failing to fast forward while the other succeeds. - $ git push puppetlabs master:master + $ git push origin master:master That's it! The committer then updates the pull request, updates the issue in our issue tracker, and keeps an eye on the [build diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed3c7c3..f366645 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,7 +68,7 @@ a ticket number. ## Submitting Changes -* Sign the [Contributor License Agreement](http://links.puppetlabs.com/cla). +* Sign the [Contributor License Agreement](http://links.puppet.com/cla). * Push your changes to a topic branch in your fork of the repository. * Submit a pull request to the repository in the puppetlabs organization. * Update your Jira ticket to mark that you have submitted code and are ready for it to be reviewed (Status: Ready for Merge). @@ -81,9 +81,9 @@ a ticket number. # Additional Resources -* [More information on contributing](http://links.puppetlabs.com/contribute-to-puppet) +* [More information on contributing](http://links.puppet.com/contribute-to-puppet) * [Bug tracker (Jira)](http://tickets.puppetlabs.com) -* [Contributor License Agreement](http://links.puppetlabs.com/cla) +* [Contributor License Agreement](http://links.puppet.com/cla) * [General GitHub documentation](http://help.github.com/) * [GitHub pull request documentation](http://help.github.com/send-pull-requests/) * #puppet-dev IRC channel on freenode.org diff --git a/README.md b/README.md index 37acad8..f5e2ce2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Puppet Strings ============= -[![Build Status](https://travis-ci.org/puppetlabs/puppetlabs-strings.png?branch=master)](https://travis-ci.org/puppetlabs/puppetlabs-strings) [![Gem Version](https://badge.fury.io/rb/puppet-strings.svg)](https://badge.fury.io/rb/puppet-strings) +[![Build Status](https://travis-ci.org/puppetlabs/puppet-strings.png?branch=master)](https://travis-ci.org/puppetlabs/puppet-strings) [![Gem Version](https://badge.fury.io/rb/puppet-strings.svg)](https://badge.fury.io/rb/puppet-strings) A Puppet Face and plugin built on the [YARD Documentation Tool](http://yardoc.org/) and the Puppet 4 Parser. It is uses YARD and the Puppet Parser to generate HTML documentation about Puppet code and Puppet extensions written in Ruby. It will eventually replace the `puppet doc` command once feature parity has been achieved. @@ -13,12 +13,12 @@ A Puppet Face and plugin built on the [YARD Documentation Tool](http://yardoc.or | *Change log* | [CHANGELOG.md][changelog] | | *Contributing* | [CONTRIBUTING.md][contributing] and [COMMITTERS.md][committers]| -[repo]: https://github.com/puppetlabs/puppetlabs-strings +[repo]: https://github.com/puppetlabs/puppet-strings [JIRA]: https://tickets.puppetlabs.com/browse/PDOC -[LICENSE]: https://github.com/puppetlabs/puppetlabs-strings/blob/master/LICENSE -[changelog]: https://github.com/puppetlabs/puppetlabs-strings/blob/master/CHANGELOG.md -[contributing]: https://github.com/puppetlabs/puppetlabs-strings/blob/master/CONTRIBUTING.md -[committers]: https://github.com/puppetlabs/puppetlabs-strings/blob/master/COMMITTERS.md +[LICENSE]: https://github.com/puppetlabs/puppet-strings/blob/master/LICENSE +[changelog]: https://github.com/puppetlabs/puppet-strings/blob/master/CHANGELOG.md +[contributing]: https://github.com/puppetlabs/puppet-strings/blob/master/CONTRIBUTING.md +[committers]: https://github.com/puppetlabs/puppet-strings/blob/master/COMMITTERS.md Installation ------------ @@ -46,8 +46,6 @@ $ puppet resource package yard provider=gem Installing Strings Itself ------------------------- -**PLEASE NOTE** that Strings was previously distributed via the puppetlabs-strings module. This is no longer the preferred method of installation as the module will not longer receive updates. So even though there is still a module on the Puppet Forge, please use the RubyGem. - Strings can be installed using the [puppet-strings RubyGem](https://rubygems.org/gems/puppet-strings). To ensure it is installed in right place, it is best to install it using Puppet. For Puppet 4.x: @@ -91,7 +89,7 @@ It can also print the JSON to stdout: $ puppet strings yardoc some_manifest.pp --emit-json-stdout ``` -The schema for the JSON which Strings emits is [well documented](https://github.com/puppetlabs/puppetlabs-strings/blob/master/json_dom.md). +The schema for the JSON which Strings emits is [well documented](https://github.com/puppetlabs/puppet-strings/blob/master/json_dom.md). Processing is delegated to the `yardoc` tool so some options listed in `yard help doc` are available. However, Puppet Faces do not support passing arbitrary options through a face so these options must be specified in a `.yardopts` file. @@ -184,7 +182,7 @@ end Here are a few other good resources for getting started with documentation: - * [Module README Template](https://docs.puppetlabs.com/puppet/latest/reference/modules_documentation.html) + * [Module README Template](https://docs.puppet.com/puppet/latest/reference/modules_documentation.html) * [YARD Getting Started Guide](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md) * [YARD Tags Overview](http://www.rubydoc.info/gems/yard/file/docs/Tags.md) @@ -196,7 +194,7 @@ This module is also available as a Gem and makes three rake tasks (`strings:gene In addition to generating the usual 'doc' directory of HTML documentation, the `strings:generate` rake task will also drop a strings.json file containing a JSON representation of the module into the directory the rake task was run from. ```ruby -gem 'puppet-strings', :git => 'https://github.com/puppetlabs/puppetlabs-strings.git' +gem 'puppet-strings', :git => 'https://github.com/puppetlabs/puppet-strings.git' ``` To use the rake tasks, `require puppet-strings/rake_tasks` in your `Rakefile`: @@ -231,7 +229,7 @@ This task aims to keep the `gh-pages` branch up to date with the current code an Developing and Contributing ----- -We love contributions from the community! If you'd like to contribute to the strings module, check out [CONTRIBUTING.md](https://github.com/puppetlabs/puppetlabs-strings/blob/master/CONTRIBUTING.md) to get information on the contribution process. +We love contributions from the community! If you'd like to contribute to the strings module, check out [CONTRIBUTING.md](https://github.com/puppetlabs/puppet-strings/blob/master/CONTRIBUTING.md) to get information on the contribution process. Running Specs ----- diff --git a/lib/puppet-strings/rake_tasks.rb b/lib/puppet-strings/rake_tasks.rb index eda4b5c..d35e402 100644 --- a/lib/puppet-strings/rake_tasks.rb +++ b/lib/puppet-strings/rake_tasks.rb @@ -1,19 +1,19 @@ require 'rake' require 'rake/tasklib' require 'puppet/face' -require 'puppet_x/puppetlabs/strings/util' +require 'puppet_x/puppet/strings/util' namespace :strings do desc 'Generate Puppet documentation with YARD.' task :generate do - PuppetX::PuppetLabs::Strings::Util.generate([ + PuppetX::Puppet::Strings::Util.generate([ {emit_json: 'strings.json'} ]) end desc 'Serve YARD documentation for modules.' task :serve do - PuppetX::PuppetLabs::Strings::Util.serve + PuppetX::Puppet::Strings::Util.serve end namespace :gh_pages do diff --git a/lib/puppet-strings/rake_tasks/generate.rb b/lib/puppet-strings/rake_tasks/generate.rb index e435c41..ba6bdbd 100644 --- a/lib/puppet-strings/rake_tasks/generate.rb +++ b/lib/puppet-strings/rake_tasks/generate.rb @@ -1,6 +1,6 @@ require 'rake' require 'rake/tasklib' -require 'puppet_x/puppetlabs/strings/util' +require 'puppet_x/puppet/strings/util' module PuppetStrings module RakeTasks @@ -8,7 +8,7 @@ module PuppetStrings # # @attr [String] name the name of the rake task. # @attr [Array] module_resourcefiles globs used to specify which files to document. - # Defaults to {PuppetX::PuppetLabs::Strings::Util::MODULE_SOURCEFILES} + # Defaults to {PuppetX::Puppet::Strings::Util::MODULE_SOURCEFILES} # @attr [Array] excludes a list of paths or patterns of files and directories to ignore. # @attr [Array, nil] paths list of paths to generate documentation for. # If this value is nil, uses the default paths for puppet strings. @@ -26,7 +26,7 @@ module PuppetStrings # mimic the current default behaviour. def initialize(*args, &task_block) @name = args.shift || 'strings:generate' - @module_sourcefiles = PuppetX::PuppetLabs::Strings::Util::MODULE_SOURCEFILES + @module_sourcefiles = PuppetX::Puppet::Strings::Util::MODULE_SOURCEFILES @paths = nil @options = {emit_json: 'strings.json'} @excludes = [] @@ -52,7 +52,7 @@ module PuppetStrings private # Converts all attributes and options to an arguments array that can be passed - # through to {PuppetX::PuppetLabs::Strings::Util #generate}. + # through to {PuppetX::Puppet::Strings::Util #generate}. # # If paths is not nil, we expand them with the module_sourcefiles patterns. def generate_task_args @@ -78,10 +78,10 @@ module PuppetStrings prefix_paths.map {|path| patterns.map {|p| "#{path}/**/#{p}" } }.flatten end - # call {PuppetX::PuppetLabs::Strings::Util #generate} + # call {PuppetX::Puppet::Strings::Util #generate} # @param [Array] args Arguments. Last element should be a Hash. def execute_task(args) - PuppetX::PuppetLabs::Strings::Util.generate(args) + PuppetX::Puppet::Strings::Util.generate(args) end end end diff --git a/lib/puppet/face/strings.rb b/lib/puppet/face/strings.rb index a695acb..72626ee 100644 --- a/lib/puppet/face/strings.rb +++ b/lib/puppet/face/strings.rb @@ -1,5 +1,5 @@ require 'puppet/face' -require 'puppet_x/puppetlabs/strings/yard/tags/directives' +require 'puppet_x/puppet/strings/yard/tags/directives' Puppet::Face.define(:strings, '0.0.1') do summary "Generate Puppet documentation with YARD." @@ -34,9 +34,9 @@ Puppet::Face.define(:strings, '0.0.1') do when_invoked do |*args| check_required_features - require 'puppet_x/puppetlabs/strings/util' + require 'puppet_x/puppet/strings/util' - PuppetX::PuppetLabs::Strings::Util.generate(args) + PuppetX::Puppet::Strings::Util.generate(args) # Puppet prints the return value of the action. The return value of this # action is that of the yardoc_actions invocation, which is the boolean @@ -56,9 +56,9 @@ Puppet::Face.define(:strings, '0.0.1') do when_invoked do |*args| check_required_features - require 'puppet_x/puppetlabs/strings/util' + require 'puppet_x/puppet/strings/util' - PuppetX::PuppetLabs::Strings::Util.serve(args) + PuppetX::Puppet::Strings::Util.serve(args) end end end diff --git a/lib/puppet_x/puppet/strings.rb b/lib/puppet_x/puppet/strings.rb new file mode 100644 index 0000000..96543e5 --- /dev/null +++ b/lib/puppet_x/puppet/strings.rb @@ -0,0 +1,64 @@ +require 'puppet' +require 'puppet/pops' +require 'puppet/util/docs' +require 'yard' + +module PuppetX +end + +# Nothing to see here except forward declarations. +module PuppetX::Puppet + module Strings + # This submodule contains bits that operate on the Pops module produced by + # the Future parser. + module Pops + require 'puppet_x/puppet/strings/pops/yard_statement' + require 'puppet_x/puppet/strings/pops/yard_transformer' + end + + # This submodule contains bits that interface with the YARD plugin system. + module YARD + require 'puppet_x/puppet/strings/yard/monkey_patches' + require 'puppet_x/puppet/strings/yard/parser' + + module Tags + require 'puppet_x/puppet/strings/yard/tags/directives' + end + + # This submodule contains code objects which are used to represent relevant + # aspects of puppet code in YARD's Registry + module CodeObjects + require 'puppet_x/puppet/strings/yard/code_objects/puppet_namespace_object' + require 'puppet_x/puppet/strings/yard/code_objects/method_object' + require 'puppet_x/puppet/strings/yard/code_objects/defined_type_object' + require 'puppet_x/puppet/strings/yard/code_objects/host_class_object' + require 'puppet_x/puppet/strings/yard/code_objects/type_object' + require 'puppet_x/puppet/strings/yard/code_objects/provider_object' + end + + # This submodule contains handlers which are used to extract relevant data about + # puppet code from the ASTs produced by the Ruby and Puppet parsers + module Handlers + # This utility library contains some tools for working with Puppet docstrings + require 'puppet_x/puppet/strings/yard/handlers/base' + require 'puppet_x/puppet/strings/yard/handlers/defined_type_handler' + require 'puppet_x/puppet/strings/yard/handlers/host_class_handler' + require 'puppet_x/puppet/strings/yard/handlers/puppet_3x_function_handler' + require 'puppet_x/puppet/strings/yard/handlers/puppet_4x_function_handler' + require 'puppet_x/puppet/strings/yard/handlers/type_handler' + require 'puppet_x/puppet/strings/yard/handlers/provider_handler' + end + + ::YARD::Parser::SourceParser.register_parser_type(:puppet, + PuppetX::Puppet::Strings::YARD::PuppetParser, + ['pp']) + ::YARD::Handlers::Processor.register_handler_namespace(:puppet, + PuppetX::Puppet::Strings::YARD::Handlers) + + # FIXME: Might not be the best idea to have the template code on the Ruby + # LOAD_PATH as the contents of this directory really aren't library code. + ::YARD::Templates::Engine.register_template_path( + File.join(File.dirname(__FILE__), 'strings', 'yard', 'templates')) + end + end +end diff --git a/lib/puppet_x/puppetlabs/strings/actions.rb b/lib/puppet_x/puppet/strings/actions.rb similarity index 97% rename from lib/puppet_x/puppetlabs/strings/actions.rb rename to lib/puppet_x/puppet/strings/actions.rb index 50da802..dbbd87f 100644 --- a/lib/puppet_x/puppetlabs/strings/actions.rb +++ b/lib/puppet_x/puppet/strings/actions.rb @@ -1,6 +1,6 @@ -require 'puppet_x/puppetlabs/strings' +require 'puppet_x/puppet/strings' -class PuppetX::PuppetLabs::Strings::Actions +class PuppetX::Puppet::Strings::Actions # Creates a new instance of the Actions class by determining # whether or not debug and backtrace arguments should be sent diff --git a/lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb b/lib/puppet_x/puppet/strings/pops/yard_statement.rb similarity index 97% rename from lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb rename to lib/puppet_x/puppet/strings/pops/yard_statement.rb index f978d2c..f618bf3 100644 --- a/lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb +++ b/lib/puppet_x/puppet/strings/pops/yard_statement.rb @@ -6,7 +6,7 @@ require 'ostruct' # FIXME: Inhertiting from OpenStruct is a bit of a hack. It allows attributes # to be declared as needed but in the long run understandibility of the code # would be improved by having a concrete model. -class PuppetX::PuppetLabs::Strings::Pops::YARDStatement < OpenStruct +class PuppetX::Puppet::Strings::Pops::YARDStatement < OpenStruct attr_reader :pops_obj, :comments def initialize(pops_obj) diff --git a/lib/puppet_x/puppetlabs/strings/pops/yard_transformer.rb b/lib/puppet_x/puppet/strings/pops/yard_transformer.rb similarity index 84% rename from lib/puppet_x/puppetlabs/strings/pops/yard_transformer.rb rename to lib/puppet_x/puppet/strings/pops/yard_transformer.rb index 0a47435..01cbd0d 100644 --- a/lib/puppet_x/puppetlabs/strings/pops/yard_transformer.rb +++ b/lib/puppet_x/puppet/strings/pops/yard_transformer.rb @@ -4,7 +4,7 @@ # # @note Currently, this class only extracts node, host class and type # definitions. -class PuppetX::PuppetLabs::Strings::Pops::YARDTransformer +class PuppetX::Puppet::Strings::Pops::YARDTransformer def initialize @transform_visitor = Puppet::Pops::Visitor.new(self, 'transform') end @@ -26,7 +26,7 @@ class PuppetX::PuppetLabs::Strings::Pops::YARDTransformer # Extract comments from type definitions and class definitions. Wrap them # into YARDStatement objects that provide an interface for YARD handlers. def transform_NamedDefinition(o) - obj = PuppetX::PuppetLabs::Strings::Pops::YARDStatement.new(o) + obj = PuppetX::Puppet::Strings::Pops::YARDStatement.new(o) obj.parameters = o.parameters.map do |p| param_tuple = [transform(p)] param_tuple << ( p.value.nil? ? nil : transform(p.value) ) @@ -37,7 +37,7 @@ class PuppetX::PuppetLabs::Strings::Pops::YARDTransformer # Catch-all visitor. def transform_Positioned(o) - PuppetX::PuppetLabs::Strings::Pops::YARDStatement.new(o) + PuppetX::Puppet::Strings::Pops::YARDStatement.new(o) end # nil in... nil out! diff --git a/lib/puppet_x/puppetlabs/strings/util.rb b/lib/puppet_x/puppet/strings/util.rb similarity index 85% rename from lib/puppet_x/puppetlabs/strings/util.rb rename to lib/puppet_x/puppet/strings/util.rb index 8d48c62..b99749c 100644 --- a/lib/puppet_x/puppetlabs/strings/util.rb +++ b/lib/puppet_x/puppet/strings/util.rb @@ -1,10 +1,10 @@ -require 'puppet_x/puppetlabs/strings/actions' +require 'puppet_x/puppet/strings/actions' -module PuppetX::PuppetLabs::Strings::Util +module PuppetX::Puppet::Strings::Util MODULE_SOURCEFILES = ['manifests/**/*.pp', 'lib/**/*.rb'] def self.generate(args = []) - yardoc_actions = PuppetX::PuppetLabs::Strings::Actions.new(Puppet[:debug], Puppet[:trace]) + yardoc_actions = PuppetX::Puppet::Strings::Actions.new(Puppet[:debug], Puppet[:trace]) # The last element of the argument array should be the options hash. # We don't have any options yet, so for now just pop the hash off and @@ -32,13 +32,13 @@ module PuppetX::PuppetLabs::Strings::Util #class YARD::Logger; def progress(*args); end; end YARD::Tags::Library.define_directive("puppet.type.param", :with_types_and_name, - PuppetX::PuppetLabs::Strings::YARD::Tags::PuppetTypeParameterDirective) + PuppetX::Puppet::Strings::YARD::Tags::PuppetTypeParameterDirective) yardoc_actions.generate_documentation(*yard_args) end def self.serve(args = []) - server_actions = PuppetX::PuppetLabs::Strings::Actions.new(Puppet[:debug], Puppet[:trace]) + server_actions = PuppetX::Puppet::Strings::Actions.new(Puppet[:debug], Puppet[:trace]) args.pop diff --git a/lib/puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object.rb b/lib/puppet_x/puppet/strings/yard/code_objects/defined_type_object.rb similarity index 84% rename from lib/puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object.rb rename to lib/puppet_x/puppet/strings/yard/code_objects/defined_type_object.rb index e680157..5014908 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object.rb +++ b/lib/puppet_x/puppet/strings/yard/code_objects/defined_type_object.rb @@ -1,6 +1,6 @@ require 'json' -class PuppetX::PuppetLabs::Strings::YARD::CodeObjects::DefinedTypeObject < PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject +class PuppetX::Puppet::Strings::YARD::CodeObjects::DefinedTypeObject < PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject # A list of parameters attached to this class. # @return [Array] attr_accessor :parameters diff --git a/lib/puppet_x/puppetlabs/strings/yard/code_objects/host_class_object.rb b/lib/puppet_x/puppet/strings/yard/code_objects/host_class_object.rb similarity index 77% rename from lib/puppet_x/puppetlabs/strings/yard/code_objects/host_class_object.rb rename to lib/puppet_x/puppet/strings/yard/code_objects/host_class_object.rb index 0fc1c53..4234c15 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/code_objects/host_class_object.rb +++ b/lib/puppet_x/puppet/strings/yard/code_objects/host_class_object.rb @@ -1,4 +1,4 @@ -class PuppetX::PuppetLabs::Strings::YARD::CodeObjects::HostClassObject < PuppetX::PuppetLabs::Strings::YARD::CodeObjects::DefinedTypeObject +class PuppetX::Puppet::Strings::YARD::CodeObjects::HostClassObject < PuppetX::Puppet::Strings::YARD::CodeObjects::DefinedTypeObject # The {HostClassObject} that this class inherits from, if any. # @return [HostClassObject, Proxy, nil] attr_accessor :parent_class @@ -6,7 +6,7 @@ class PuppetX::PuppetLabs::Strings::YARD::CodeObjects::HostClassObject < PuppetX # NOTE: `include_mods` is never used as it makes no sense for Puppet, but # this is called by `YARD::Registry` and it will pass a parameter. def inheritance_tree(include_mods = false) - if parent_class.is_a?(PuppetX::PuppetLabs::Strings::YARD::CodeObjects::HostClassObject) + if parent_class.is_a?(PuppetX::Puppet::Strings::YARD::CodeObjects::HostClassObject) # Cool. We got a host class. Return self + parent inheritance tree. [self] + parent_class.inheritance_tree elsif parent_class.is_a?(YARD::CodeObjects::Proxy) diff --git a/lib/puppet_x/puppetlabs/strings/yard/code_objects/method_object.rb b/lib/puppet_x/puppet/strings/yard/code_objects/method_object.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/code_objects/method_object.rb rename to lib/puppet_x/puppet/strings/yard/code_objects/method_object.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/code_objects/provider_object.rb b/lib/puppet_x/puppet/strings/yard/code_objects/provider_object.rb similarity index 82% rename from lib/puppet_x/puppetlabs/strings/yard/code_objects/provider_object.rb rename to lib/puppet_x/puppet/strings/yard/code_objects/provider_object.rb index cf63c9d..d56e598 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/code_objects/provider_object.rb +++ b/lib/puppet_x/puppet/strings/yard/code_objects/provider_object.rb @@ -1,4 +1,4 @@ -class PuppetX::PuppetLabs::Strings::YARD::CodeObjects::ProviderObject < PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject +class PuppetX::Puppet::Strings::YARD::CodeObjects::ProviderObject < PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject # A list of parameters attached to this class. # @return [Array] attr_accessor :parameters diff --git a/lib/puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object.rb b/lib/puppet_x/puppet/strings/yard/code_objects/puppet_namespace_object.rb similarity index 93% rename from lib/puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object.rb rename to lib/puppet_x/puppet/strings/yard/code_objects/puppet_namespace_object.rb index c3ba60b..6f6b3f1 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object.rb +++ b/lib/puppet_x/puppet/strings/yard/code_objects/puppet_namespace_object.rb @@ -1,4 +1,4 @@ -class PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject < YARD::CodeObjects::NamespaceObject +class PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject < YARD::CodeObjects::NamespaceObject attr_accessor :type_info # NOTE: `YARD::Registry#resolve` requires a method with this signature to diff --git a/lib/puppet_x/puppetlabs/strings/yard/code_objects/type_object.rb b/lib/puppet_x/puppet/strings/yard/code_objects/type_object.rb similarity index 91% rename from lib/puppet_x/puppetlabs/strings/yard/code_objects/type_object.rb rename to lib/puppet_x/puppet/strings/yard/code_objects/type_object.rb index 513543f..b96b4a1 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/code_objects/type_object.rb +++ b/lib/puppet_x/puppet/strings/yard/code_objects/type_object.rb @@ -1,4 +1,4 @@ -class PuppetX::PuppetLabs::Strings::YARD::CodeObjects::TypeObject < PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject +class PuppetX::Puppet::Strings::YARD::CodeObjects::TypeObject < PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject # A list of parameters attached to this class. # @return [Array] attr_accessor :parameters diff --git a/lib/puppet_x/puppetlabs/strings/yard/core_ext/yard.rb b/lib/puppet_x/puppet/strings/yard/core_ext/yard.rb similarity index 97% rename from lib/puppet_x/puppetlabs/strings/yard/core_ext/yard.rb rename to lib/puppet_x/puppet/strings/yard/core_ext/yard.rb index d8accf2..fa8a0d4 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/core_ext/yard.rb +++ b/lib/puppet_x/puppet/strings/yard/core_ext/yard.rb @@ -1,6 +1,5 @@ require 'yard' - -require 'puppet_x/puppetlabs/strings' +require 'puppet_x/puppet/strings' # Patch the regular expression used to match namespaces # so it will allow namespace segments that begin with diff --git a/lib/puppet_x/puppetlabs/strings/yard/handlers/base.rb b/lib/puppet_x/puppet/strings/yard/handlers/base.rb similarity index 56% rename from lib/puppet_x/puppetlabs/strings/yard/handlers/base.rb rename to lib/puppet_x/puppet/strings/yard/handlers/base.rb index 0bd3e60..462f973 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/handlers/base.rb +++ b/lib/puppet_x/puppet/strings/yard/handlers/base.rb @@ -1,10 +1,10 @@ -require 'puppet_x/puppetlabs/strings/yard/core_ext/yard' +require 'puppet_x/puppet/strings/yard/core_ext/yard' -class PuppetX::PuppetLabs::Strings::YARD::Handlers::Base < ::YARD::Handlers::Base +class PuppetX::Puppet::Strings::YARD::Handlers::Base < ::YARD::Handlers::Base # Easy access to Pops model objects for handler matching. include Puppet::Pops::Model # Easy access to custom code objects from which documentation is generated. - include PuppetX::PuppetLabs::Strings::YARD::CodeObjects + include PuppetX::Puppet::Strings::YARD::CodeObjects def self.handles?(statement) handlers.any? {|h| h == statement.type} diff --git a/lib/puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler.rb b/lib/puppet_x/puppet/strings/yard/handlers/defined_type_handler.rb similarity index 88% rename from lib/puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler.rb rename to lib/puppet_x/puppet/strings/yard/handlers/defined_type_handler.rb index 78bff28..b54f5cb 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler.rb +++ b/lib/puppet_x/puppet/strings/yard/handlers/defined_type_handler.rb @@ -1,4 +1,4 @@ -class PuppetX::PuppetLabs::Strings::YARD::Handlers::DefinedTypeHandler < PuppetX::PuppetLabs::Strings::YARD::Handlers:: Base +class PuppetX::Puppet::Strings::YARD::Handlers::DefinedTypeHandler < PuppetX::Puppet::Strings::YARD::Handlers:: Base handles ResourceTypeDefinition process do diff --git a/lib/puppet_x/puppetlabs/strings/yard/handlers/heredoc_helper.rb b/lib/puppet_x/puppet/strings/yard/handlers/heredoc_helper.rb similarity index 95% rename from lib/puppet_x/puppetlabs/strings/yard/handlers/heredoc_helper.rb rename to lib/puppet_x/puppet/strings/yard/handlers/heredoc_helper.rb index 73fe2aa..072b469 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/handlers/heredoc_helper.rb +++ b/lib/puppet_x/puppet/strings/yard/handlers/heredoc_helper.rb @@ -47,11 +47,13 @@ class HereDocHelper # @param ele [YARD::Parser::Ruby::AstNode] # @return [String] def process_element(ele) - ele = ele.jump(:ident, :string_content) + ele = ele.jump(:ident, :symbol, :string_content) case ele.type when :ident ele.source + when :symbol + ele.source[1..-1] when :string_content source = ele.source if is_heredoc? source diff --git a/lib/puppet_x/puppetlabs/strings/yard/handlers/host_class_handler.rb b/lib/puppet_x/puppet/strings/yard/handlers/host_class_handler.rb similarity index 94% rename from lib/puppet_x/puppetlabs/strings/yard/handlers/host_class_handler.rb rename to lib/puppet_x/puppet/strings/yard/handlers/host_class_handler.rb index 5eae337..16fed86 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/handlers/host_class_handler.rb +++ b/lib/puppet_x/puppet/strings/yard/handlers/host_class_handler.rb @@ -1,4 +1,4 @@ -class PuppetX::PuppetLabs::Strings::YARD::Handlers::HostClassHandler < PuppetX::PuppetLabs::Strings::YARD::Handlers::Base +class PuppetX::Puppet::Strings::YARD::Handlers::HostClassHandler < PuppetX::Puppet::Strings::YARD::Handlers::Base handles HostClassDefinition process do diff --git a/lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb b/lib/puppet_x/puppet/strings/yard/handlers/provider_handler.rb similarity index 95% rename from lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb rename to lib/puppet_x/puppet/strings/yard/handlers/provider_handler.rb index a22d2ae..8970086 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb +++ b/lib/puppet_x/puppet/strings/yard/handlers/provider_handler.rb @@ -1,8 +1,8 @@ # Handles `dispatch` calls within a future parser function declaration. For # now, it just treats any docstring as an `@overlaod` tag and attaches the # overload to the parent function. -class PuppetX::PuppetLabs::Strings::YARD::Handlers::PuppetProviderHandler < YARD::Handlers::Ruby::Base - include PuppetX::PuppetLabs::Strings::YARD::CodeObjects +class PuppetX::Puppet::Strings::YARD::Handlers::PuppetProviderHandler < YARD::Handlers::Ruby::Base + include PuppetX::Puppet::Strings::YARD::CodeObjects handles :command_call, :call diff --git a/lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler.rb b/lib/puppet_x/puppet/strings/yard/handlers/puppet_3x_function_handler.rb similarity index 90% rename from lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler.rb rename to lib/puppet_x/puppet/strings/yard/handlers/puppet_3x_function_handler.rb index f55ad4f..183c120 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler.rb +++ b/lib/puppet_x/puppet/strings/yard/handlers/puppet_3x_function_handler.rb @@ -1,7 +1,7 @@ require File.join(File.dirname(__FILE__),'./heredoc_helper') -class PuppetX::PuppetLabs::Strings::YARD::Handlers::Puppet3xFunctionHandler < YARD::Handlers::Ruby::Base - include PuppetX::PuppetLabs::Strings::YARD::CodeObjects +class PuppetX::Puppet::Strings::YARD::Handlers::Puppet3xFunctionHandler < YARD::Handlers::Ruby::Base + include PuppetX::Puppet::Strings::YARD::CodeObjects handles method_call(:newfunction) diff --git a/lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler.rb b/lib/puppet_x/puppet/strings/yard/handlers/puppet_4x_function_handler.rb similarity index 97% rename from lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler.rb rename to lib/puppet_x/puppet/strings/yard/handlers/puppet_4x_function_handler.rb index 298c8da..b301b6e 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler.rb +++ b/lib/puppet_x/puppet/strings/yard/handlers/puppet_4x_function_handler.rb @@ -1,8 +1,8 @@ # Handles `dispatch` calls within a future parser function declaration. For # now, it just treats any docstring as an `@overlaod` tag and attaches the # overload to the parent function. -class PuppetX::PuppetLabs::Strings::YARD::Handlers::Puppet4xFunctionHandler < YARD::Handlers::Ruby::Base - include PuppetX::PuppetLabs::Strings::YARD::CodeObjects +class PuppetX::Puppet::Strings::YARD::Handlers::Puppet4xFunctionHandler < YARD::Handlers::Ruby::Base + include PuppetX::Puppet::Strings::YARD::CodeObjects handles method_call(:dispatch) @@ -19,7 +19,7 @@ class PuppetX::PuppetLabs::Strings::YARD::Handlers::Puppet4xFunctionHandler < YA end class Puppet4xFunctionHandler < YARD::Handlers::Ruby::Base - include PuppetX::PuppetLabs::Strings::YARD::CodeObjects + include PuppetX::Puppet::Strings::YARD::CodeObjects handles method_call(:create_function) diff --git a/lib/puppet_x/puppetlabs/strings/yard/handlers/type_handler.rb b/lib/puppet_x/puppet/strings/yard/handlers/type_handler.rb similarity index 97% rename from lib/puppet_x/puppetlabs/strings/yard/handlers/type_handler.rb rename to lib/puppet_x/puppet/strings/yard/handlers/type_handler.rb index 346277b..19f326c 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/handlers/type_handler.rb +++ b/lib/puppet_x/puppet/strings/yard/handlers/type_handler.rb @@ -1,8 +1,8 @@ # Handles `dispatch` calls within a future parser function declaration. For # now, it just treats any docstring as an `@overlaod` tag and attaches the # overload to the parent function. -class PuppetX::PuppetLabs::Strings::YARD::Handlers::PuppetTypeHandler < YARD::Handlers::Ruby::Base - include PuppetX::PuppetLabs::Strings::YARD::CodeObjects +class PuppetX::Puppet::Strings::YARD::Handlers::PuppetTypeHandler < YARD::Handlers::Ruby::Base + include PuppetX::Puppet::Strings::YARD::CodeObjects handles :call @@ -130,7 +130,7 @@ class PuppetX::PuppetLabs::Strings::YARD::Handlers::PuppetTypeHandler < YARD::Ha elsif is_feature? node features << get_feature(node) elsif is_a_func_call_named? 'ensurable', node - # Someone could call the ensurable method and create an ensure + # Someone could call the ensurable method and create an ensure # property. If that happens, they it will be documented twice. Serves # them right. property_details << {:name => 'ensure', @@ -157,7 +157,7 @@ class PuppetX::PuppetLabs::Strings::YARD::Handlers::PuppetTypeHandler < YARD::Ha # See: - # https://docs.puppetlabs.com/guides/custom_types.html#namevar + # https://docs.puppet.com/guides/custom_types.html#namevar # node should be a parameter def is_namevar? node, param_name, type_name # Option 1: diff --git a/lib/puppet_x/puppetlabs/strings/yard/json_registry_store.rb b/lib/puppet_x/puppet/strings/yard/json_registry_store.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/json_registry_store.rb rename to lib/puppet_x/puppet/strings/yard/json_registry_store.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/monkey_patches.rb b/lib/puppet_x/puppet/strings/yard/monkey_patches.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/monkey_patches.rb rename to lib/puppet_x/puppet/strings/yard/monkey_patches.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/parser.rb b/lib/puppet_x/puppet/strings/yard/parser.rb similarity index 64% rename from lib/puppet_x/puppetlabs/strings/yard/parser.rb rename to lib/puppet_x/puppet/strings/yard/parser.rb index 630846d..b309a06 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/parser.rb +++ b/lib/puppet_x/puppet/strings/yard/parser.rb @@ -1,10 +1,10 @@ require 'yard' require 'puppet/pops' -require 'puppet_x/puppetlabs/strings' -require 'puppet_x/puppetlabs/strings//pops/yard_transformer' +require 'puppet_x/puppet/strings' +require 'puppet_x/puppet/strings//pops/yard_transformer' -class PuppetX::PuppetLabs::Strings::YARD::PuppetParser < YARD::Parser::Base +class PuppetX::Puppet::Strings::YARD::PuppetParser < YARD::Parser::Base attr_reader :file, :source def initialize(source, filename) @@ -12,7 +12,7 @@ class PuppetX::PuppetLabs::Strings::YARD::PuppetParser < YARD::Parser::Base @file = filename @parser = Puppet::Pops::Parser::Parser.new() - @transformer = PuppetX::PuppetLabs::Strings::Pops::YARDTransformer.new() + @transformer = PuppetX::Puppet::Strings::Pops::YARDTransformer.new() end def parse diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/docstring.erb b/lib/puppet_x/puppet/strings/yard/templates/default/definedtype/html/docstring.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/docstring.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/definedtype/html/docstring.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/header.erb b/lib/puppet_x/puppet/strings/yard/templates/default/definedtype/html/header.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/header.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/definedtype/html/header.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/parameter_details.erb b/lib/puppet_x/puppet/strings/yard/templates/default/definedtype/html/parameter_details.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/parameter_details.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/definedtype/html/parameter_details.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/definedtype/html/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/html/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/definedtype/html/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/definedtype/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/definedtype/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/definedtype/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_class.erb b/lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_class.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_class.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_class.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_manifest.erb b/lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_puppet_manifest.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_manifest.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_puppet_manifest.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb b/lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb b/lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_puppet_provider.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb b/lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/full_list_puppet_type.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/setup.rb similarity index 94% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/setup.rb index 7ab0dfe..ed09a8f 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/templates/default/fulldoc/html/setup.rb +++ b/lib/puppet_x/puppet/strings/yard/templates/default/fulldoc/html/setup.rb @@ -61,7 +61,7 @@ def namespace_list(opts = {}) if namespace_types.include? child.type if child.namespace.is_a?(CodeObjects::Proxy) name = child.path - elsif child.is_a?(PuppetX::PuppetLabs::Strings::YARD::CodeObjects::TypeObject) || child.is_a?(PuppetX::PuppetLabs::Strings::YARD::CodeObjects::ProviderObject) + elsif child.is_a?(PuppetX::Puppet::Strings::YARD::CodeObjects::TypeObject) || child.is_a?(PuppetX::Puppet::Strings::YARD::CodeObjects::ProviderObject) name = child.header_name else name = child.name diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/box_info.erb b/lib/puppet_x/puppet/strings/yard/templates/default/hostclass/html/box_info.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/box_info.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/hostclass/html/box_info.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/hostclass/html/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/hostclass/html/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/subclasses.erb b/lib/puppet_x/puppet/strings/yard/templates/default/hostclass/html/subclasses.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/html/subclasses.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/hostclass/html/subclasses.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/hostclass/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/hostclass/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/hostclass/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/html_helper.rb b/lib/puppet_x/puppet/strings/yard/templates/default/html_helper.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/html_helper.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/html_helper.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/layout/html/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/layout/html/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/layout/html/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/layout/html/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/html/header.erb b/lib/puppet_x/puppet/strings/yard/templates/default/method_details/html/header.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/html/header.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/method_details/html/header.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/method_details/setup.rb similarity index 91% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/method_details/setup.rb index 94b383a..4ab00b6 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/setup.rb +++ b/lib/puppet_x/puppet/strings/yard/templates/default/method_details/setup.rb @@ -5,7 +5,7 @@ require File.join(File.dirname(__FILE__),'../template_helper') def init sections :header, [:method_signature, T('docstring'), :source] parents = YARD::Registry.all(:method).reject do |item| - item.name == object.name and item.namespace === PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject + item.name == object.name and item.namespace === PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject end if parents.length == 0 @template_helper = TemplateHelper.new diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/text/header.erb b/lib/puppet_x/puppet/strings/yard/templates/default/method_details/text/header.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/method_details/text/header.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/method_details/text/header.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/command_details.erb b/lib/puppet_x/puppet/strings/yard/templates/default/provider/html/command_details.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/command_details.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/provider/html/command_details.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/confine_details.erb b/lib/puppet_x/puppet/strings/yard/templates/default/provider/html/confine_details.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/confine_details.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/provider/html/confine_details.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/default_details.erb b/lib/puppet_x/puppet/strings/yard/templates/default/provider/html/default_details.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/default_details.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/provider/html/default_details.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/docstring.erb b/lib/puppet_x/puppet/strings/yard/templates/default/provider/html/docstring.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/docstring.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/provider/html/docstring.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/feature_details.erb b/lib/puppet_x/puppet/strings/yard/templates/default/provider/html/feature_details.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/feature_details.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/provider/html/feature_details.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/header.erb b/lib/puppet_x/puppet/strings/yard/templates/default/provider/html/header.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/header.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/provider/html/header.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/provider/html/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/html/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/provider/html/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/provider/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/provider/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/provider/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/box_info.erb b/lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/box_info.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/box_info.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/box_info.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/header.erb b/lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/header.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/header.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/header.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_details_list.erb b/lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/method_details_list.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_details_list.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/method_details_list.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_summary.erb b/lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/method_summary.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/method_summary.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/method_summary.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/html/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/html/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/puppetnamespace/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/puppetnamespace/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/template_helper.rb b/lib/puppet_x/puppet/strings/yard/templates/default/template_helper.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/template_helper.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/template_helper.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/docstring.erb b/lib/puppet_x/puppet/strings/yard/templates/default/type/html/docstring.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/docstring.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/type/html/docstring.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/header.erb b/lib/puppet_x/puppet/strings/yard/templates/default/type/html/header.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/header.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/type/html/header.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/parameter_details.erb b/lib/puppet_x/puppet/strings/yard/templates/default/type/html/parameter_details.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/parameter_details.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/type/html/parameter_details.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/provider_details.erb b/lib/puppet_x/puppet/strings/yard/templates/default/type/html/provider_details.erb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/provider_details.erb rename to lib/puppet_x/puppet/strings/yard/templates/default/type/html/provider_details.erb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/type/html/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/type/html/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/type/html/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings/yard/templates/default/type/setup.rb b/lib/puppet_x/puppet/strings/yard/templates/default/type/setup.rb similarity index 100% rename from lib/puppet_x/puppetlabs/strings/yard/templates/default/type/setup.rb rename to lib/puppet_x/puppet/strings/yard/templates/default/type/setup.rb diff --git a/lib/puppet_x/puppetlabs/strings.rb b/lib/puppet_x/puppetlabs/strings.rb deleted file mode 100644 index 299af0b..0000000 --- a/lib/puppet_x/puppetlabs/strings.rb +++ /dev/null @@ -1,64 +0,0 @@ -require 'puppet' -require 'puppet/pops' -require 'puppet/util/docs' -require 'yard' - -module PuppetX -end - -# Nothing to see here except forward declarations. -module PuppetX::PuppetLabs - module Strings - # This submodule contains bits that operate on the Pops module produced by - # the Future parser. - module Pops - require 'puppet_x/puppetlabs/strings/pops/yard_statement' - require 'puppet_x/puppetlabs/strings/pops/yard_transformer' - end - - # This submodule contains bits that interface with the YARD plugin system. - module YARD - require 'puppet_x/puppetlabs/strings/yard/monkey_patches' - require 'puppet_x/puppetlabs/strings/yard/parser' - - module Tags - require 'puppet_x/puppetlabs/strings/yard/tags/directives' - end - - # This submodule contains code objects which are used to represent relevant - # aspects of puppet code in YARD's Registry - module CodeObjects - require 'puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object' - require 'puppet_x/puppetlabs/strings/yard/code_objects/method_object' - require 'puppet_x/puppetlabs/strings/yard/code_objects/defined_type_object' - require 'puppet_x/puppetlabs/strings/yard/code_objects/host_class_object' - require 'puppet_x/puppetlabs/strings/yard/code_objects/type_object' - require 'puppet_x/puppetlabs/strings/yard/code_objects/provider_object' - end - - # This submodule contains handlers which are used to extract relevant data about - # puppet code from the ASTs produced by the Ruby and Puppet parsers - module Handlers - # This utility library contains some tools for working with Puppet docstrings - require 'puppet_x/puppetlabs/strings/yard/handlers/base' - require 'puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler' - require 'puppet_x/puppetlabs/strings/yard/handlers/host_class_handler' - require 'puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler' - require 'puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler' - require 'puppet_x/puppetlabs/strings/yard/handlers/type_handler' - require 'puppet_x/puppetlabs/strings/yard/handlers/provider_handler' - end - - ::YARD::Parser::SourceParser.register_parser_type(:puppet, - PuppetX::PuppetLabs::Strings::YARD::PuppetParser, - ['pp']) - ::YARD::Handlers::Processor.register_handler_namespace(:puppet, - PuppetX::PuppetLabs::Strings::YARD::Handlers) - - # FIXME: Might not be the best idea to have the template code on the Ruby - # LOAD_PATH as the contents of this directory really aren't library code. - ::YARD::Templates::Engine.register_template_path( - File.join(File.dirname(__FILE__), 'strings', 'yard', 'templates')) - end - end -end diff --git a/lib/puppet_x/puppetlabs/strings/yard/tags/directives.rb b/lib/puppet_x/puppetlabs/strings/yard/tags/directives.rb deleted file mode 100644 index 0b94793..0000000 --- a/lib/puppet_x/puppetlabs/strings/yard/tags/directives.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'puppet_x/puppetlabs/strings/yard/core_ext/yard' -# Creates a new code object based on the directive -class PuppetX::PuppetLabs::Strings::YARD::Tags::PuppetTypeParameterDirective < YARD::Tags::Directive - def call - return if object.nil? - object.parameters << ([tag.text, tag.types].flatten) - object.parameter_details << {:name => tag.name, :desc => tag.text, :exists? => true, :puppet_type => true} - end -end diff --git a/puppet-strings.gemspec b/puppet-strings.gemspec index 2a28e97..c0dfd7a 100644 --- a/puppet-strings.gemspec +++ b/puppet-strings.gemspec @@ -1,11 +1,11 @@ Gem::Specification.new do |s| s.name = 'puppet-strings' - s.author = 'Puppet Labs' + s.author = 'Puppet Inc.' s.version = '0.4.0' s.license = 'Apache-2.0' s.summary = 'Puppet documentation via YARD' - s.email = 'info@puppetlabs.com' - s.homepage = 'https://github.com/puppetlabs/puppetlabs-strings' + s.email = 'info@puppet.com' + s.homepage = 'https://github.com/puppetlabs/puppet-strings' s.description = s.summary s.extra_rdoc_files = [ diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a751957..0546365 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,7 +5,7 @@ require 'mocha' require 'puppet' require 'rspec' -require 'puppet_x/puppetlabs/strings' +require 'puppet_x/puppet/strings' RSpec.configure do |config| config.mock_with :mocha diff --git a/spec/unit/puppet_x/puppetlabs/strings/pops_spec.rb b/spec/unit/puppet_x/puppet/strings/pops_spec.rb similarity index 79% rename from spec/unit/puppet_x/puppetlabs/strings/pops_spec.rb rename to spec/unit/puppet_x/puppet/strings/pops_spec.rb index d8ac5f2..8a440e1 100644 --- a/spec/unit/puppet_x/puppetlabs/strings/pops_spec.rb +++ b/spec/unit/puppet_x/puppet/strings/pops_spec.rb @@ -1,13 +1,13 @@ require 'spec_helper' -require 'puppet_x/puppetlabs/strings/pops/yard_statement' +require 'puppet_x/puppet/strings/pops/yard_statement' -describe PuppetX::PuppetLabs::Strings::Pops do +describe PuppetX::Puppet::Strings::Pops do let(:parser) {Puppet::Pops::Parser::Parser.new()} describe "YARDstatement class" do let(:manifest) {"#hello world\nclass foo { }"} let(:model) {parser.parse_string(manifest).current.definitions.first} - let(:test_statement) {PuppetX::PuppetLabs::Strings::Pops::YARDStatement.new(model)} + let(:test_statement) {PuppetX::Puppet::Strings::Pops::YARDStatement.new(model)} describe "when creating a new instance of YARDStatement" do it "should extract comments from the source code" do @@ -19,13 +19,13 @@ describe PuppetX::PuppetLabs::Strings::Pops do describe "YARDTransfomer class" do let(:manifest) {"#hello world\nclass foo($bar) { }"} let(:manifest_default) {"#hello world\nclass foo($bar = 3) { }"} - let(:transformer) {PuppetX::PuppetLabs::Strings::Pops::YARDTransformer.new} + let(:transformer) {PuppetX::Puppet::Strings::Pops::YARDTransformer.new} describe "transform method" do it "should perform the correct transformation with parameter defaults" do model = parser.parse_string(manifest_default).current.definitions.first statements = transformer.transform(model) - expect(statements.parameters[0][0].class).to be(PuppetX::PuppetLabs::Strings::Pops::YARDStatement) + expect(statements.parameters[0][0].class).to be(PuppetX::Puppet::Strings::Pops::YARDStatement) end it "should perform the correct transofmration without parameter defaults" do diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/defined_type_handler_spec.rb b/spec/unit/puppet_x/puppet/strings/yard/defined_type_handler_spec.rb similarity index 93% rename from spec/unit/puppet_x/puppetlabs/strings/yard/defined_type_handler_spec.rb rename to spec/unit/puppet_x/puppet/strings/yard/defined_type_handler_spec.rb index 8ba38f7..6f3bd76 100644 --- a/spec/unit/puppet_x/puppetlabs/strings/yard/defined_type_handler_spec.rb +++ b/spec/unit/puppet_x/puppet/strings/yard/defined_type_handler_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' -require 'puppet_x/puppetlabs/strings/yard/handlers/defined_type_handler' +require 'puppet_x/puppet/strings/yard/handlers/defined_type_handler' require 'strings_spec/parsing' -describe PuppetX::PuppetLabs::Strings::YARD::Handlers::DefinedTypeHandler do +describe PuppetX::Puppet::Strings::YARD::Handlers::DefinedTypeHandler do include StringsSpec::Parsing def the_definedtype() diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-differ-with-dispatch/lib/test.rb b/spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-differ-with-dispatch/lib/test.rb similarity index 100% rename from spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-differ-with-dispatch/lib/test.rb rename to spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-differ-with-dispatch/lib/test.rb diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-differ-with-types/lib/test.rb b/spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-differ-with-types/lib/test.rb similarity index 100% rename from spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-differ-with-types/lib/test.rb rename to spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-differ-with-types/lib/test.rb diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-differ/lib/test.rb b/spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-differ/lib/test.rb similarity index 100% rename from spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-differ/lib/test.rb rename to spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-differ/lib/test.rb diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-match-with-dispatch/lib/test.rb b/spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-match-with-dispatch/lib/test.rb similarity index 100% rename from spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-match-with-dispatch/lib/test.rb rename to spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-match-with-dispatch/lib/test.rb diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-match-with-types/lib/test.rb b/spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-match-with-types/lib/test.rb similarity index 100% rename from spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-match-with-types/lib/test.rb rename to spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-match-with-types/lib/test.rb diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-match/lib/test.rb b/spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-match/lib/test.rb similarity index 100% rename from spec/unit/puppet_x/puppetlabs/strings/yard/examples/test-param-names-match/lib/test.rb rename to spec/unit/puppet_x/puppet/strings/yard/examples/test-param-names-match/lib/test.rb diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/examples/test/manifests/init.pp b/spec/unit/puppet_x/puppet/strings/yard/examples/test/manifests/init.pp similarity index 100% rename from spec/unit/puppet_x/puppetlabs/strings/yard/examples/test/manifests/init.pp rename to spec/unit/puppet_x/puppet/strings/yard/examples/test/manifests/init.pp diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/host_class_handler_spec.rb b/spec/unit/puppet_x/puppet/strings/yard/host_class_handler_spec.rb similarity index 95% rename from spec/unit/puppet_x/puppetlabs/strings/yard/host_class_handler_spec.rb rename to spec/unit/puppet_x/puppet/strings/yard/host_class_handler_spec.rb index c31e184..ea0959c 100644 --- a/spec/unit/puppet_x/puppetlabs/strings/yard/host_class_handler_spec.rb +++ b/spec/unit/puppet_x/puppet/strings/yard/host_class_handler_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' require 'lib/strings_spec/module_helper' require 'puppet/face/strings' -require 'puppet_x/puppetlabs/strings/yard/handlers/host_class_handler' +require 'puppet_x/puppet/strings/yard/handlers/host_class_handler' require 'strings_spec/parsing' -describe PuppetX::PuppetLabs::Strings::YARD::Handlers::HostClassHandler do +describe PuppetX::Puppet::Strings::YARD::Handlers::HostClassHandler do include StringsSpec::Parsing def the_hostclass() diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/puppet_3x_function_handler_spec.rb b/spec/unit/puppet_x/puppet/strings/yard/puppet_3x_function_handler_spec.rb similarity index 91% rename from spec/unit/puppet_x/puppetlabs/strings/yard/puppet_3x_function_handler_spec.rb rename to spec/unit/puppet_x/puppet/strings/yard/puppet_3x_function_handler_spec.rb index 0b58605..d53c82d 100644 --- a/spec/unit/puppet_x/puppetlabs/strings/yard/puppet_3x_function_handler_spec.rb +++ b/spec/unit/puppet_x/puppet/strings/yard/puppet_3x_function_handler_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' -require 'puppet_x/puppetlabs/strings/yard/handlers/puppet_3x_function_handler' +require 'puppet_x/puppet/strings/yard/handlers/puppet_3x_function_handler' require 'strings_spec/parsing' -describe PuppetX::PuppetLabs::Strings::YARD::Handlers::Puppet3xFunctionHandler do +describe PuppetX::Puppet::Strings::YARD::Handlers::Puppet3xFunctionHandler do include StringsSpec::Parsing def the_method() diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/puppet_4x_function_handler_spec.rb b/spec/unit/puppet_x/puppet/strings/yard/puppet_4x_function_handler_spec.rb similarity index 97% rename from spec/unit/puppet_x/puppetlabs/strings/yard/puppet_4x_function_handler_spec.rb rename to spec/unit/puppet_x/puppet/strings/yard/puppet_4x_function_handler_spec.rb index 6dcf9d4..e1b4e54 100644 --- a/spec/unit/puppet_x/puppetlabs/strings/yard/puppet_4x_function_handler_spec.rb +++ b/spec/unit/puppet_x/puppet/strings/yard/puppet_4x_function_handler_spec.rb @@ -1,10 +1,10 @@ require 'spec_helper' require 'lib/strings_spec/module_helper' -require 'puppet_x/puppetlabs/strings/yard/handlers/puppet_4x_function_handler' +require 'puppet_x/puppet/strings/yard/handlers/puppet_4x_function_handler' require 'puppet/face/strings' require 'strings_spec/parsing' -describe PuppetX::PuppetLabs::Strings::YARD::Handlers::Puppet4xFunctionHandler do +describe PuppetX::Puppet::Strings::YARD::Handlers::Puppet4xFunctionHandler do include StringsSpec::Parsing def the_method() diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/template_helper_spec.rb b/spec/unit/puppet_x/puppet/strings/yard/template_helper_spec.rb similarity index 84% rename from spec/unit/puppet_x/puppetlabs/strings/yard/template_helper_spec.rb rename to spec/unit/puppet_x/puppet/strings/yard/template_helper_spec.rb index 6772d7d..f6153a8 100644 --- a/spec/unit/puppet_x/puppetlabs/strings/yard/template_helper_spec.rb +++ b/spec/unit/puppet_x/puppet/strings/yard/template_helper_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -require 'puppet_x/puppetlabs/strings/yard/templates/default/template_helper' -require 'puppet_x/puppetlabs/strings/yard/code_objects/puppet_namespace_object' +require 'puppet_x/puppet/strings/yard/templates/default/template_helper' +require 'puppet_x/puppet/strings/yard/code_objects/puppet_namespace_object' require 'strings_spec/parsing' describe TemplateHelper do @@ -11,7 +11,7 @@ describe TemplateHelper do # nothing is printed tag0 = YARD::Tags::Tag.new(:param, 'a_parameter') tag0.name = 'a_parameter' - obj0 = PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet3xFunctions') + obj0 = PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet3xFunctions') obj0.add_tag tag0 obj0.parameters = [['a_parameter']] expect { th.check_parameters_match_docs obj0 }.to output("").to_stderr_from_any_process @@ -28,7 +28,7 @@ describe TemplateHelper do # formed, print out the warning with no location data tag1 = YARD::Tags::Tag.new(:param, 'aa_parameter') tag1.name = 'aa_parameter' - obj1 = PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet3xFunctions') + obj1 = PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet3xFunctions') obj1.add_tag tag1 obj1.parameters = [['b_parameter']] expect { th.check_parameters_match_docs obj1 }.to output("[warn]: The parameter aa_parameter is documented, but doesn't exist in\n your code. Sorry, the file and line number could not be determined.\n").to_stderr_from_any_process @@ -45,7 +45,7 @@ describe TemplateHelper do # formed, print out the warning with no location data tag2 = YARD::Tags::Tag.new(:param, 'aaa_parameter') tag2.name = 'aaa_parameter' - obj2 = PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet3xFunctions') + obj2 = PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet3xFunctions') obj2.files = [['some_file.pp', 42]] obj2.add_tag tag2 obj2.parameters = [['b_parameter']] @@ -61,7 +61,7 @@ describe TemplateHelper do " code. The arg1\n parameter is declared as types [\"Integer\"] in the " + "docstring,\n but the code specifies the types [\"Optional[String]\"]" + "\n in the file test near line 0.\n" - object = PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet4xFunctions') + object = PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet4xFunctions') object.files = [['test', 0]] object.type_info = [{ 'arg0' => 'Variant[String,Array[String]]', @@ -82,7 +82,7 @@ describe TemplateHelper do end it "should not issue a warning if the parameter types do match the docstring in dispatch method" do - object = PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet4xFunctions') + object = PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet4xFunctions') object.files = [['test', 0]] object.type_info = [{ 'arg0' => 'Variant[String,Array[String]]', @@ -103,7 +103,7 @@ describe TemplateHelper do end it "should not issue a warning if the types in the docstring in dispatch method are assignable to parameter types" do - object = PuppetX::PuppetLabs::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet4xFunctions') + object = PuppetX::Puppet::Strings::YARD::CodeObjects::PuppetNamespaceObject.new(:root, 'Puppet4xFunctions') object.files = [['test', 0]] object.type_info = [{ 'arg0' => 'Variant[String,Array[String]]', diff --git a/spec/unit/puppet_x/puppetlabs/strings/yard/type_handler_spec.rb b/spec/unit/puppet_x/puppet/strings/yard/type_handler_spec.rb similarity index 92% rename from spec/unit/puppet_x/puppetlabs/strings/yard/type_handler_spec.rb rename to spec/unit/puppet_x/puppet/strings/yard/type_handler_spec.rb index 338ce5c..72c53b1 100644 --- a/spec/unit/puppet_x/puppetlabs/strings/yard/type_handler_spec.rb +++ b/spec/unit/puppet_x/puppet/strings/yard/type_handler_spec.rb @@ -1,9 +1,9 @@ require 'spec_helper' -require 'puppet_x/puppetlabs/strings/yard/handlers/type_handler' +require 'puppet_x/puppet/strings/yard/handlers/type_handler' require 'strings_spec/parsing' -describe PuppetX::PuppetLabs::Strings::YARD::Handlers::PuppetTypeHandler do +describe PuppetX::Puppet::Strings::YARD::Handlers::PuppetTypeHandler do include StringsSpec::Parsing def the_type()