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

Fixes #37091 - Pretty print long YAML list #684

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ template_inputs:
provider_type: Ansible
kind: job_template
model: JobTemplate
%>

-%>
# For Windows targets use the win_package module instead.
---
- hosts: all
Expand All @@ -41,7 +40,7 @@ model: JobTemplate
<%- end -%>
tasks:
- package:
name: <%= input('name') %>
<%= indent(8) { to_yaml({"name" => input('name')}).gsub(/---\n/, '') } -%>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to remove my erb loop/if pasta code. to_yaml macro doesn't seems to support :UseHeader => true https://github.com/ruby/ruby/blob/4099b04c099899d92dab3f34f1152038ed718d79/test/psych/helper.rb#L51

state: <%= input('state') %>
<%- if input('post_script').present? -%>
post_tasks:
Expand Down