<commit_before>#
# Author:: <NAME> (<<EMAIL>>)
# Cookbook Name:: wt_base
# Provider:: icacls
#
# Copyright:: 2012, Webtrends Inc.
#
# All rights reserved - Do Not Redistribute
#

include Chef::Mixin::ShellOut

action :grant do
	Chef::Log.debug("icacls.exe grant #{@new_resource.path} => #{@new_resource.user} => #{@new_resource.perm}")
	if @new_resource.user == nil
		raise Chef::Exceptions::AttributeNotFound, "user or group could not be determined"
	end
	case @new_resource.perm
		when :full
			perm = "(oi)(ci)(f)"
		when :modify
			perm = "(oi)(ci)(m)"
		when :read
			perm = "(oi)(ci)(rx)"
		else
			raise Chef::Exceptions::AttributeNotFound, "perm could not be determined, please use :full, :modify or :read"
	end
	shell_out!("icacls \"#{@new_resource.path}\" /grant:r \"#{@new_resource.user}\":#{perm}")
end

action :remove do
	Chef::Log.debug("icacls remove #{@new_resource.path} => #{@new_resource.user}")
	if @new_resource.user == nil
		raise Chef::Exceptions::AttributeNotFound, "user or group could not be determined"
	end
	shell_out!("icacls.exe \"#{@new_resource.path}\" /remove \"#{@new_resource.user}\" /t /c /l /q")
end

action :run do
	Chef::Log.debug("icacls remove #{@new_resource.path} => #{@new_resource.user}")
	if @new_resource.options == nil
		raise Chef::Exceptions::AttributeNotFound, "options need to be provided"
	end
	shell_out!("icacls.exe #{@new_resource.options}")
end
<commit_msg>fixed text of debug message<commit_after>#
# Author:: <NAME> (<<EMAIL>>)
# Cookbook Name:: wt_base
# Provider:: icacls
#
# Copyright:: 2012, Webtrends Inc.
#
# All rights reserved - Do Not Redistribute
#

include Chef::Mixin::ShellOut

action :grant do
	Chef::Log.debug("icacls.exe grant #{@new_resource.path} => #{@new_resource.user} => #{@new_resource.perm}")
	if @new_resource.user == nil
		raise Chef::Exceptions::AttributeNotFound, "user or group could not be determined"
	end
	case @new_resource.perm
		when :full
			perm = "(oi)(ci)(f)"
		when :modify
			perm = "(oi)(ci)(m)"
		when :read
			perm = "(oi)(ci)(rx)"
		else
			raise Chef::Exceptions::AttributeNotFound, "perm could not be determined, please use :full, :modify or :read"
	end
	shell_out!("icacls \"#{@new_resource.path}\" /grant:r \"#{@new_resource.user}\":#{perm}")
end

action :remove do
	Chef::Log.debug("icacls remove #{@new_resource.path} => #{@new_resource.user}")
	if @new_resource.user == nil
		raise Chef::Exceptions::AttributeNotFound, "user or group could not be determined"
	end
	shell_out!("icacls.exe \"#{@new_resource.path}\" /remove \"#{@new_resource.user}\" /t /c /l /q")
end

action :run do
	Chef::Log.debug("icacls run #{@new_resource.options}")
	if @new_resource.options == nil
		raise Chef::Exceptions::AttributeNotFound, "options need to be provided"
	end
	shell_out!("icacls.exe #{@new_resource.options}")
end

{'fraction_non_alphanumeric': 0.17429889953851616, 'fraction_numerical': 0.0028399006034788782, 'mean_word_length': 5.1798245614035086, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3730884', 'n_tokens_mistral': 1044, 'n_tokens_neox': 1005, 'n_words': 255}