Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Added user resource attr to mac_os_x_userdefaults LWRP.
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Connolly committed Jul 28, 2012
1 parent 5ed2619 commit 20f0314
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -30,6 +30,7 @@ Manage the Mac OS X user defaults(1) system. The parameters to the resource are
- key: The preference key. Required.
- value: The value of the key. Required.
- type: Value type of the preference key.
- user: User for which to set the default.
- sudo: Set to true if the setting requires privileged access to modify. Default false.

`value` settings of `1`, `TRUE`, `true`, `YES` or `yes` are treated as true by defaults(1), and are handled in the provider.
Expand Down
1 change: 0 additions & 1 deletion metadata.rb
Expand Up @@ -4,4 +4,3 @@
description "Manage OS X user defaults settings"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.3.6"
supports "mac_os_x"
4 changes: 3 additions & 1 deletion providers/userdefaults.rb
Expand Up @@ -65,6 +65,8 @@ def load_current_resource

cmd << "-#{type}" if type
cmd << value
execute cmd.join(' ')
execute cmd.join(' ') do
user new_resource.user unless new_resource.user.nil?
end
end
end
1 change: 1 addition & 0 deletions resources/userdefaults.rb
Expand Up @@ -24,6 +24,7 @@
attribute :key, :kind_of => String, :default => nil
attribute :value, :kind_of => [Integer,String,TrueClass,FalseClass,Hash], :default => nil, :required => true
attribute :type, :kind_of => String, :default => nil
attribute :user, :kind_of => String, :default => nil
attribute :sudo, :kind_of => [TrueClass, FalseClass], :default => false
attribute :is_set, :kind_of => [TrueClass, FalseClass], :default => false

Expand Down

0 comments on commit 20f0314

Please sign in to comment.