Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow numerics for templates using code_maybe_block #382

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

seanmil
Copy link
Contributor

@seanmil seanmil commented Jan 19, 2024

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

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

@seanmil seanmil requested a review from a team as a code owner January 19, 2024 16:56
@jordanbreen28
Copy link
Contributor

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

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.
@seanmil seanmil force-pushed the fix_numeric_defaults branch from d81d4c2 to 083865a Compare January 19, 2024 17:01
@seanmil seanmil requested a review from bastelfreak as a code owner January 19, 2024 17:01
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

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
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jordanbreen28 jordanbreen28 merged commit 3403b37 into puppetlabs:main Jan 19, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants