Recursively map a YAML value with a Ruby snippet.
gem install dorian-yaml-deep-mapAlso included in the aggregate gem:
gem install dorianyaml-deep-map [file ...] "ruby code"Run yaml-deep-map -h for generated option details and yaml-deep-map -v for the installed version.
- Mutate or replace
itin the snippet; the final YAML is printed.
printf -- '- 1\n- 2\n' | yaml-deep-map "it += 1 if it.is_a?(Integer)"