diff options
author | Eric Saxby <sax@livinginthepast.org> | 2013-06-19 22:45:23 -0700 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-09-24 14:10:20 -0700 |
commit | fb1ab3eca60bc8051445014ed863cbaeaa619f41 (patch) | |
tree | 16f3a53d809c630550421aa9d3bf4321bdae1a29 /lib/chef/provider | |
parent | db00c1da15a083c848d0509ed28bd61cb340829a (diff) | |
download | chef-fb1ab3eca60bc8051445014ed863cbaeaa619f41.tar.gz |
[CHEF-4200] Replace Array#keep_if with #select
Array#keep_if was introduced in Ruby 1.9; Array#select
is backwards compatible with 1.8
Diffstat (limited to 'lib/chef/provider')
-rw-r--r-- | lib/chef/provider/user.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/provider/user.rb b/lib/chef/provider/user.rb index d5656c6beb..851d8110fb 100644 --- a/lib/chef/provider/user.rb +++ b/lib/chef/provider/user.rb @@ -110,11 +110,11 @@ class Chef # <true>:: If a change is required # <false>:: If the users are identical def compare_user - changed = [ :comment, :home, :shell, :password ].keep_if do |user_attrib| + changed = [ :comment, :home, :shell, :password ].select do |user_attrib| !@new_resource.send(user_attrib).nil? && @new_resource.send(user_attrib) != @current_resource.send(user_attrib) end - changed += [ :uid, :gid ].keep_if do |user_attrib| + changed += [ :uid, :gid ].select do |user_attrib| !@new_resource.send(user_attrib).nil? && @new_resource.send(user_attrib).to_s != @current_resource.send(user_attrib).to_s end |