Why confirming that this fix worked as intended it was shown that in fixing the original issue a second one had been uncovered.
This should fix the second one without infringing on the first fix.
values.sub(%r{'#{resource_map[bool]} "! "'}, "#{resource_map[bool]} true")
else
# append `true` to booleans that are not already negated (followed by "!")
- values.sub(%r{#{resource_map[bool]}(?=\s|$)(?!"!")}, "#{resource_map[bool]} true")
+ values.sub(%r{#{resource_map[bool]}(?=\s|$)(?!\s?"!")}, "#{resource_map[bool]} true")
end
end