Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #15 from jeroenj/array

Adds support for arrays
  • Loading branch information...
commit 90c2c92775d4d17c6ad42d89b53e0837738b2564 2 parents 92f7a0d + 0f1a53b
@jtimberman jtimberman authored
Showing with 4 additions and 1 deletion.
  1. +3 −0  providers/userdefaults.rb
  2. +1 −1  resources/userdefaults.rb
View
3  providers/userdefaults.rb
@@ -65,6 +65,9 @@ def load_current_resource
# creates a string of Key1 Value1 Key2 Value2...
value = new_resource.value.map {|k,v| "\"#{k}\" \"#{v}\"" }.join(' ')
+ when Array
+ type ||= 'array'
+ value = new_resource.value.join(' ')
end
cmd << "-#{type}" if type
View
2  resources/userdefaults.rb
@@ -22,7 +22,7 @@
attribute :domain, :kind_of => String, :name_attribute => true, :required => true
attribute :global, :kind_of => [TrueClass, FalseClass], :default => false
attribute :key, :kind_of => String, :default => nil
-attribute :value, :kind_of => [Integer,Float,String,TrueClass,FalseClass,Hash], :default => nil, :required => true
+attribute :value, :kind_of => [Integer,Float,String,TrueClass,FalseClass,Hash,Array], :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
Please sign in to comment.
Something went wrong with that request. Please try again.