opscode-cookbooks/homebrew — pull request #17 by fnichol (2013-07-05 17:45:02+00:00)
Title: [COOK-3283] Determine the Homebrew owner from enviroment variables & node attrs.

**Ticket is being tracked as [COOK-3283](http://tickets.opscode.com/browse/COOK-3283)**
---

Homebrew installation and package commands will be run under a user
determined using the following rules (first match wins):

1. If node['homebrew']['owner'] is set, use this user
2. If ENV['SUDO_USER'] is present, Chef was invoked with sudo so
use the original non-privileged user
3. Raise and exception if the calculated user is 'root'
4. Otherwise default to current user, taken from ENV['USER']