diff --git a/lib/puppetx/yardoc/pops/yard_transformer.rb b/lib/puppetx/yardoc/pops/yard_transformer.rb index a5f596e..6560b07 100644 --- a/lib/puppetx/yardoc/pops/yard_transformer.rb +++ b/lib/puppetx/yardoc/pops/yard_transformer.rb @@ -45,5 +45,10 @@ module Puppetx::Yardoc::Pops def transform_Positioned(o) YARDStatement.new(o) end + + # nil in... nil out! + def transform_NilClass(o) + nil + end end end diff --git a/lib/puppetx/yardoc/yard/parser.rb b/lib/puppetx/yardoc/yard/parser.rb index aa64fb0..2d815b3 100644 --- a/lib/puppetx/yardoc/yard/parser.rb +++ b/lib/puppetx/yardoc/yard/parser.rb @@ -22,7 +22,10 @@ module Puppetx::Yardoc::YARD end def enumerator - @transformer.transform(@parse_result) + statements = @transformer.transform(@parse_result) + + # Ensure an array is returned and prune any nil values. + Array(statements).compact end end