-
Notifications
You must be signed in to change notification settings - Fork 53
Add PlistBuddy Resource #12
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
Conversation
- Correctly include modules - Correctly setup spec_helper - Correct unit test / respec setup
- Boolean values are working - Array and data type values are not - PlistBuddy "commands" (add, print, etc.) are passing
- Skip Array and Dict types as their implementation will be more complicated - Add test for float type - Put the correct type in the test description - Cookstyle changes
- Add separate test cookbook for PlistBuddy resource - Add kitchen.yml for the above purpose - Modify and update plistbuddy resource/helpers
- Opportunistic cleanup of xcode test - some temp debugging info in resource definition - Rename name_property to command so as to not override action
- Removed 'bool' prefix from boolean types, as that was somehow causing issues - Changed name_property to the path and removed that property - Use actual actions in the resource for the PlistBuddy commands
- Not sure how the previous test was passing previously, but I adjusted the boolean value for the BazEntry test so that the signature input matches the output
- The data type should only be used when adding a value to a plist. Otherwise, we don't need to use the data type
jazaval
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of the test cookbook, but I think it ought to be scoped to the entire macos cookbook, and contain specific recipes within the kitchen suites.
| end | ||
| end | ||
|
|
||
| Chef::Recipe.include(MacOS::PlistBuddyHelpers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given some of the method names here are not super specific (args_formatter), maybe the PlistBuddy resource should import these instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean. I probably should've set args_formatter to private, but regardless, that method exists only to add the data type if the Add command is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've set args_formatter to private, which I think makes sense given the usage.
I think extracting the plistbuddy test cookbook to an entire test cookbook is outside the scope of this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
libraries/plistbuddy.rb
Outdated
| @@ -0,0 +1,32 @@ | |||
| include Chef::Mixin::ShellOut | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think you need this.
spec/unit/recipes/xcode_spec.rb
Outdated
| end | ||
|
|
||
| it 'converges successfully' do | ||
| xit 'converges successfully' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we saying that these are not useful?
This PR:
plistbuddyresource for manipulating property list files on macOScdinto the cookbook directory and runkitchen test)Why
PlistBuddyis a better way of manipulating property lists because:defaultsdoes)defaultsresource is not idempotentdefaultsExample Usage in some recipe
preferences.rb