puppetlabs / puppet-strings

The next generation Puppet documentation extraction and presentation tool.
http://puppetlabs.github.io/puppet-strings/
Apache License 2.0
90 stars 84 forks source link

Allow numerics for templates using code_maybe_block #382

Closed seanmil closed 10 months ago

seanmil commented 10 months ago

A number of ERB templates use the code_maybe_block method to assist with formatting. This fails if the value being passed is not a string, such as an integer default value for a resource type.

Summary

Convert the value passed to code_maybe_block into a string before testing for \n with include?

Checklist

jordanbreen28 commented 10 months ago

hey @seanmil this is great. Nice spot and simple fix! Could you rebase of main? Apologies, just merged another PR.

codecov-commenter commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6891e66) 70.90% compared to head (083865a) 70.91%. Report is 3 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #382 +/- ## ========================================== + Coverage 70.90% 70.91% +0.01% ========================================== Files 78 78 Lines 2488 2486 -2 ========================================== - Hits 1764 1763 -1 + Misses 724 723 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.