From fb1ab3eca60bc8051445014ed863cbaeaa619f41 Mon Sep 17 00:00:00 2001 From: Eric Saxby Date: Wed, 19 Jun 2013 22:45:23 -0700 Subject: [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 --- lib/chef/provider/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/chef/provider') 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 # :: If a change is required # :: 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 -- cgit v1.2.1