<commit_before>
@spigot = node['spigot']['directory']

# Configure root server folder
directory @spigot do
  owner 'root'
  group 'root'
  mode '0755'
  recursive true
  action :create
end

remote_file "#{@spigot}/spigot.jar" do
  source node['spigot']['download']
  mode '0644'
  action :create
end

@templates = [
  {
    "location" => "#{@spigot}/server.properties",
    "source" => "server.properties.erb"
  },
  {
    "location" => "#{@spigot}/eula.txt",
    "source" => "eula.erb"
  },
  {
    "location" => "#{@spigot}/ops.json",
    "source" => "ops.erb"
  },
  {
    "location" => "#{@spigot}/spigot.yml",
    "source" => "spigot.erb"
  },
  {
    "location" => "#{@spigot}/commands.json",
    "source" => "commands.erb"
  }
]

@templates.each do |template|
  Chef::Log.info("Creating Spigot template at #{template['location']}")

  template template['location'] do
    source template['source']
    owner 'root'
    group 'root'
    mode '0644'
  end
end<commit_msg>Modified template usage in main Spigot recipe<commit_after>
@spigot = node['spigot']['directory']

# Configure root server folder
directory @spigot do
  owner 'root'
  group 'root'
  mode '0755'
  recursive true
  action :create
end

remote_file "#{@spigot}/spigot.jar" do
  source node['spigot']['download']
  mode '0644'
  action :create
end

# Create root configuration files
['eula.txt', 'ops.json', 'spigot.yml', 'commands.yml', 'server.properties'].each do |config_file|
  template "#{node['spigot']['directory']}/#{config_file}" do
    source "#{config_file}.erb"
    owner 'root'
    group 'root'
    mode '0644'
  end
end
{'fraction_non_alphanumeric': 0.17870485678704856, 'fraction_numerical': 0.014943960149439602, 'mean_word_length': 3.825825825825826, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2834464', 'n_tokens_mistral': 610, 'n_tokens_neox': 594, 'n_words': 133}