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.
This commit is contained in:
Dmitry Ilyin 2016-04-06 13:15:31 +03:00
parent 2b8b4a706b
commit 432eed1469
1 changed files with 1 additions and 0 deletions

View File

@ -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' } i = statement.index { |s| YARD::Parser::Ruby::AstNode === s && s.type == :ident && s.source == 'provide' }
provider_name = statement[i+1].jump(:ident).source provider_name = statement[i+1].jump(:ident).source
type_name = statement.jump(:symbol).first.source type_name = statement.jump(:symbol).first.source
provider_name = "#{type_name}:#{provider_name}"
obj = ProviderObject.new(:root, "#{provider_name}_provider") obj = ProviderObject.new(:root, "#{provider_name}_provider")