jtimberman/mac_os_x-cookbook — pull request #8 by nixgeek (2012-03-04 00:43:56+00:00)
Title: Update to load_current_resource replacing 'truthy' with 'truefalse'. 

Right now we only convert 'TRUE' or 'true' which leads to a situation whereby chef-client reapplies settings (defaults write -bool 'false') upon each run because the recipe value may validly be 'false'.

defaults --help
is one of:
-bool[ean] (true | false | yes | no)

Example recipe snippet which triggers this situation -

mac_os_x_userdefaults "dont show quarantine warnings on downloaded files" do
domain "com.apple.LaunchServices"
key "LSQuarantine"
value "false"
type "bool"
notifies :run, 'execute[killall Finder]'
only_if { node[:platform_version].to_f >= 10.5 }
end

I've also taken the opportunity to extend things so that "YES" and "yes" are considered to be true values, because they would be accepted on the command-line by /usr/bin/defaults as valid input.