(PDOC-45) Puppet 4x functions handle unusual names
`lib/puppet/functions/defined.rb` has some unusual syntax: Puppet::Functions.create_function(:'defined', .... It runs, so apparently this is legal.
This commit is contained in:
parent
2a11a85787
commit
84a215d599
|
@ -187,6 +187,7 @@ class Puppet4xFunctionHandler < YARD::Handlers::Ruby::Base
|
||||||
|
|
||||||
name = process_element(name)
|
name = process_element(name)
|
||||||
|
|
||||||
|
|
||||||
name
|
name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -199,12 +200,12 @@ class Puppet4xFunctionHandler < YARD::Handlers::Ruby::Base
|
||||||
# @param ele [YARD::Parser::Ruby::AstNode]
|
# @param ele [YARD::Parser::Ruby::AstNode]
|
||||||
# @return [String]
|
# @return [String]
|
||||||
def process_element(ele)
|
def process_element(ele)
|
||||||
ele = ele.jump(:ident, :string_content)
|
ele = ele.jump(:ident, :string_content, :tstring_content)
|
||||||
|
|
||||||
case ele.type
|
case ele.type
|
||||||
when :ident
|
when :ident
|
||||||
ele.source
|
ele.source
|
||||||
when :string_content
|
when :string_content, :tstring_content
|
||||||
source = ele.source
|
source = ele.source
|
||||||
if HEREDOC_START.match(source)
|
if HEREDOC_START.match(source)
|
||||||
process_heredoc(source)
|
process_heredoc(source)
|
||||||
|
|
Loading…
Reference in New Issue