lib/facter/framework/formatters/yaml_fact_formatter.rb in facter-4.3.1 vs lib/facter/framework/formatters/yaml_fact_formatter.rb in facter-4.4.0
- old
+ new
@@ -50,12 +50,12 @@
end
fact_hash
end
def needs_quote?(value)
- return false if value =~ /true|false/
+ return false if /true|false/.match?(value)
return false if value[/^[0-9]+$/]
- return true if value =~ /y|Y|yes|Yes|YES|n|N|no|No|NO|True|TRUE|False|FALSE|on|On|ON|off|Off|OFF|:/
+ return true if /y|Y|yes|Yes|YES|n|N|no|No|NO|True|TRUE|False|FALSE|on|On|ON|off|Off|OFF|:/.match?(value)
return false if value[/[a-zA-Z]/]
return false if value[/[0-9]+\.[0-9]+/]
true
end