Method not available on this version
This method is only available on newer versions.
The first available version (v2_6_3 ) is shown here.
chown_R (user, group, list, noop: nil, verbose: nil, force: nil)
public
Changes owner and group on the named files (in list ) to the user
user and the group group recursively. user and
group may be an ID (Integer/String ) or
a name (String ). If user or
group is nil, this method does not change the attribute.
Bundler :: FileUtils . chown_R ' www ', ' www ', ' /var/www/htdocs '
Bundler :: FileUtils . chown_R ' cvs ', ' cvs ', ' /var/cvs ', :verbose => true
Show source # File lib/bundler/vendor/fileutils/lib/fileutils.rb, line 983
def chown_R(user, group, list, noop: nil, verbose: nil, force: nil)
list = fu_list(list)
fu_output_message sprintf('chown -R%s %s %s',
(force ? 'f' : ''),
(group ? "#{user}:#{group}" : user || ':'),
list.join(' ')) if verbose
return if noop
uid = fu_get_uid(user)
gid = fu_get_gid(group)
list.each do |root|
Entry_.new(root).traverse do |ent|
begin
ent.chown uid, gid
rescue
raise unless force
end
end
end
end