diff --git a/lib/puppetx/puppetlabs/strings/yard/handlers.rb b/lib/puppetx/puppetlabs/strings/yard/handlers.rb index 71a966b..3e3f694 100644 --- a/lib/puppetx/puppetlabs/strings/yard/handlers.rb +++ b/lib/puppetx/puppetlabs/strings/yard/handlers.rb @@ -2,5 +2,5 @@ require_relative 'handlers/base' require_relative 'handlers/defined_type_handler' require_relative 'handlers/host_class_handler' -require_relative 'handlers/parser_function_handler' -require_relative 'handlers/future_parser_function_handler' +require_relative 'handlers/puppet_3x_function_handler' +require_relative 'handlers/puppet_4x_function_handler' diff --git a/lib/puppetx/puppetlabs/strings/yard/handlers/parser_function_handler.rb b/lib/puppetx/puppetlabs/strings/yard/handlers/puppet_3x_function_handler.rb similarity index 93% rename from lib/puppetx/puppetlabs/strings/yard/handlers/parser_function_handler.rb rename to lib/puppetx/puppetlabs/strings/yard/handlers/puppet_3x_function_handler.rb index 8e41995..8c174cf 100644 --- a/lib/puppetx/puppetlabs/strings/yard/handlers/parser_function_handler.rb +++ b/lib/puppetx/puppetlabs/strings/yard/handlers/puppet_3x_function_handler.rb @@ -4,7 +4,7 @@ require 'puppet/util/docs' require_relative '../code_objects' module Puppetx::PuppetLabs::Strings::YARD::Handlers - class ParserFunctionHandler < YARD::Handlers::Ruby::Base + class Puppet3xFunctionHandler < YARD::Handlers::Ruby::Base include Puppetx::PuppetLabs::Strings::YARD::CodeObjects handles method_call(:newfunction) @@ -40,11 +40,11 @@ module Puppetx::PuppetLabs::Strings::YARD::Handlers # @return [PuppetNamespaceObject] def function_namespace # NOTE: This tricky. If there is ever a Ruby class or module with the - # name ::ParserFunctions, then there will be a clash. Hopefully the name + # name ::Puppet3xFunctions, then there will be a clash. Hopefully the name # is sufficiently uncommon. - obj = P(:root, 'ParserFunctions') + obj = P(:root, 'Puppet3xFunctions') if obj.is_a? Proxy - namespace_obj = PuppetNamespaceObject.new(:root, 'ParserFunctions') + namespace_obj = PuppetNamespaceObject.new(:root, 'Puppet3xFunctions') namespace_obj.add_tag YARD::Tags::Tag.new(:api, 'public') register namespace_obj diff --git a/lib/puppetx/puppetlabs/strings/yard/handlers/future_parser_function_handler.rb b/lib/puppetx/puppetlabs/strings/yard/handlers/puppet_4x_function_handler.rb similarity index 88% rename from lib/puppetx/puppetlabs/strings/yard/handlers/future_parser_function_handler.rb rename to lib/puppetx/puppetlabs/strings/yard/handlers/puppet_4x_function_handler.rb index f87bf31..f52edb8 100644 --- a/lib/puppetx/puppetlabs/strings/yard/handlers/future_parser_function_handler.rb +++ b/lib/puppetx/puppetlabs/strings/yard/handlers/puppet_4x_function_handler.rb @@ -4,13 +4,13 @@ module Puppetx::PuppetLabs::Strings::YARD::Handlers # 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 FutureParserDispatchHandler < YARD::Handlers::Ruby::Base + class Puppet4xFunctionHandler < YARD::Handlers::Ruby::Base include Puppetx::PuppetLabs::Strings::YARD::CodeObjects handles method_call(:dispatch) process do - return unless owner.is_a?(MethodObject) && owner['future_parser_function'] + return unless owner.is_a?(MethodObject) && owner['puppet_4x_function'] return unless statement.docstring docstring = ::YARD::Docstring.new(statement.docstring, nil) @@ -21,7 +21,7 @@ module Puppetx::PuppetLabs::Strings::YARD::Handlers end end - class FutureParserFunctionHandler < YARD::Handlers::Ruby::Base + class Puppet4xFunctionHandler < YARD::Handlers::Ruby::Base include Puppetx::PuppetLabs::Strings::YARD::CodeObjects handles method_call(:create_function) @@ -30,7 +30,7 @@ module Puppetx::PuppetLabs::Strings::YARD::Handlers name = process_parameters obj = MethodObject.new(function_namespace, name) - obj['future_parser_function'] = true + obj['puppet_4x_function'] = true register obj @@ -48,11 +48,11 @@ module Puppetx::PuppetLabs::Strings::YARD::Handlers # @return [PuppetNamespaceObject] def function_namespace # NOTE: This tricky. If there is ever a Ruby class or module with the - # name ::ParserFunctions, then there will be a clash. Hopefully the name + # name ::Puppet4xFunctions, then there will be a clash. Hopefully the name # is sufficiently uncommon. - obj = P(:root, 'FutureParserFunctions') + obj = P(:root, 'Puppet4xFunctions') if obj.is_a? Proxy - namespace_obj = PuppetNamespaceObject.new(:root, 'FutureParserFunctions') + namespace_obj = PuppetNamespaceObject.new(:root, 'Puppet4xFunctions') register namespace_obj # FIXME: The docstring has to be cleared. Otherwise, the namespace diff --git a/lib/puppetx/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb b/lib/puppetx/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb index ffa7eec..241b6cc 100644 --- a/lib/puppetx/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb +++ b/lib/puppetx/puppetlabs/strings/yard/templates/default/fulldoc/html/full_list_puppet_plugin.erb @@ -1,21 +1,21 @@ -<% unless P(:root, 'ParserFunctions').is_a?(CodeObjects::Proxy) %> +<% unless P(:root, 'Puppet3xFunctions').is_a?(CodeObjects::Proxy) %>