From 432eed14692b9e9e5c10c2e7aa6ef9d97ab6f62c Mon Sep 17 00:00:00 2001 From: Dmitry Ilyin Date: Wed, 6 Apr 2016 13:15:31 +0300 Subject: [PATCH] Add Puppet type name in front of the provider name It will prevent providers of different types but with the same name from merging together. For example: type1:ruby type2:ruby type3:ruby Will be different providers instead of the one "ruby" provider. --- .../puppetlabs/strings/yard/handlers/provider_handler.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb b/lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb index bd2cc22..a22d2ae 100644 --- a/lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb +++ b/lib/puppet_x/puppetlabs/strings/yard/handlers/provider_handler.rb @@ -25,6 +25,7 @@ class PuppetX::PuppetLabs::Strings::YARD::Handlers::PuppetProviderHandler < YARD i = statement.index { |s| YARD::Parser::Ruby::AstNode === s && s.type == :ident && s.source == 'provide' } provider_name = statement[i+1].jump(:ident).source type_name = statement.jump(:symbol).first.source + provider_name = "#{type_name}:#{provider_name}" obj = ProviderObject.new(:root, "#{provider_name}_provider")