<commit_before>property :name, [String, Symbol], required: true, name_property: true
property :local_path, String, required: false
property :repo_name, String, required: true
property :repo_description, String, required: true
property :repo_baseurl, String, required: true

def full_path
  if local_path == NilClass
    "#{local_path}/#{name}/"
  else
    "/var/lib/yum-repo/#{name}/"
  end
end

action :create do
  yum_repository repo_name do
    description repo_description
    baseurl repo_baseurl
    action :create
  end
  directory full_path do
    owner 'root'
    group 'root'
    mode '0755'
    action :create
  end
  ruby_block 'reposync' do
    block do
      system "reposync -r #{repo_name} -p #{full_path}"
    end
  end
  ruby_block 'createrepo' do
    block do
      system "createrepo #{full_path}"
    end
  end
end

action :remove do
  yum_repository repo_name do
    action :delete
  end
  directory local_path do
    action :delete
  end
end
<commit_msg>Change action from remove to delete on mirror resource, this is to align with standard Chef resources.<commit_after>property :name, [String, Symbol], required: true, name_property: true
property :local_path, String, required: false
property :repo_name, String, required: true
property :repo_description, String, required: true
property :repo_baseurl, String, required: true

def full_path
  if local_path == NilClass
    "#{local_path}/#{name}/"
  else
    "/var/lib/yum-repo/#{name}/"
  end
end

action :create do
  yum_repository repo_name do
    description repo_description
    baseurl repo_baseurl
    action :create
  end
  directory full_path do
    owner 'root'
    group 'root'
    mode '0755'
    action :create
  end
  ruby_block 'reposync' do
    block do
      system "reposync -r #{repo_name} -p #{full_path}"
    end
  end
  ruby_block 'createrepo' do
    block do
      system "createrepo #{full_path}"
    end
  end
end

action :delete do
  yum_repository repo_name do
    action :delete
  end
  directory local_path do
    action :delete
  end
end

{'fraction_non_alphanumeric': 0.08125305922662751, 'fraction_numerical': 0.003915810083210965, 'mean_word_length': 3.482456140350877, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '766422', 'n_tokens_mistral': 663, 'n_tokens_neox': 647, 'n_words': 222}