Coder Social home page Coder Social logo

sous-chefs-boneyard / mac_os_x Goto Github PK

View Code? Open in Web Editor NEW
75.0 18.0 25.0 96 KB

This cookbook has been deprecated

Home Page: https://supermarket.chef.io/cookbooks/mac_os_x

License: Apache License 2.0

Ruby 100.00%
chef-cookbook mac-os-x chef-resource chef

mac_os_x's People

Contributors

agh avatar bleything avatar damacus avatar hartmantis avatar jeroenj avatar joemiller avatar jtimberman avatar sax avatar stevemarshall avatar tas50 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mac_os_x's Issues

Update resources to current quality standards

The resources in this cookbook were written many moons ago. It was a primitive time, when things like "testing" weren't done.

Laundry list of improvements this cookbook needs:

Test Kitchen

While we can't distribute OS X vagrant boxes for using Test Kitchen, internally at CHEF we have some, and we should use those to enable testing with Test Kitchen.

Rename the Resources

This cookbook includes two resources:

  • mac_os_x_userdefaults
  • mac_os_x_plist_file

These are both awkward to type. They are also relatively simple LWRPs, and could be easily converted to subclass LWRPBase. This would give better flexibility for making alias resources. I am proposing:

  • osx_defaults
  • osx_plist

This gives clarity that they're for OS X. The old resource names would be aliases, and the attributes would remain.

State Attributes

Chef Reporting uses "state attributes" for reporting information about a Chef run. We should define those for the resources in this cookbook.

Why Run Mode

The LWRPs use inline resources, which gives us automatic why run mode support. This should be defined with the why_run_supported? method defined to return true.

Use inline resources

As stated, LWRPs here use inline resources, but we don't use the use_inline_resources method.

Use default action

We set default actions using #initialize rather than the default_action method.

ChefSpec Coverage

We need full ChefSpec coverage. This is related to Test Kitchen support.

ServerSpec Coverage

We need adequate ServerSpec coverage. This is related to Test Kitchen support.

Backwards Compatibility

This cookbook must remain backwards compatible. We can achieve that through proper test coverage.

Tests must be written and verified before refactoring the resources begins.

Platform Support

The goal is to support the following OS X platform versions:

  • 10.9
  • 10.10

Initially, 10.9 and 10.10 will be supported (as I have VMware Fusion vagrant boxes for TK). 10.8 support can come if a) someone provides it or b) it just works without additional effort. To my knowledge, Apple hasn't dramatically changed the way the defaults(1) system works.

Helper method for ints

We want a helper that takes values from attributes and checks to see if they...

  1. ...are an integer
  2. ...are between specified values

This would require two method arguments:

  1. new_resource.value
  2. A range (example: 0-2 or 0-infinity)

This would be used for resources that require integers for their value.

Support action: delete in mac_os_x_userdefaults

I believe I'd like at least the delete action. Has there been any consideration of supporting other actions in mac_os_x_userdefaults?

This is my first look at this cookbook. I'll fork and see if I can contribute.

Leverage Chef::Mixin::HomebrewUser in Chef 12

It would be nice to be able to set defaults for a specific user, or automatically assume the user running Chef via sudo. We can get this from Chef::Mixin::HomebrewUser in Chef 12.

settings recipe is missing

Why did you blog about this cookbook, mentioning the use of the "settings" recipe, and then not put the recipe in the cookbook and release it to the community site too?

Answer:
problem?

Default domain of NSGlobalDomain

I had to fiddle with the kbaccess recipe to make it use a key of AppleKeyboardUIMode with the global domain. Seems like the whole point of the global flag is to set the domain to NSGlobalDomain. While doing that, it seems easiest to just have the default domain be NSGlobalDomain.

Am I misunderstanding something, or would this work out?

userdefaults should handle deleting and adding keys

Here is an example of an execute statement I haven't been able to put into the userdefaults resource and I believe I should be able to:

execute 'Disable automatic login' do
  command 'defaults delete /Library/Preferences/com.apple.loginwindow '\
          'autoLoginUser'
  only_if 'defaults read /Library/Preferences/com.apple.loginwindow | '\
          'grep "autoLoginUser"'
 end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.