<commit_before>#
# Cookbook Name:: example-mcdev
# Recipe:: default
#
# Copyright 2013, Mediacurrent, LLC
#
# All rights reserved - Do Not Redistribute

include_recipe "memcached"

# Add memcache pecl package.
php_pear "memcache" do
  action :install
end

# Create a mysql database for homeimprovement.
mysql_database node[:database_name] do
  connection ({
    :host => 'localhost',
    :username => 'root',
    :password => node['mysql']['server_root_password']
  })
  action :create
end

# Create virtual host and enable site.
web_app node[:domain] do
  allow_override "All"
  docroot node[:docroot]
  server_aliases []
  server_name node[:domain]
end

ruby_block "append_hosts" do
  block do
    file = Chef::Util::FileEdit.new("/etc/hosts")
    file.insert_line_if_no_match("127.0.0.1\t#{node[:domain]}", "127.0.0.1\t#{node[:domain]}")
    file.write_file<commit_msg>Adding docs<commit_after>#
# Cookbook Name:: example-mcdev
# Recipe:: default
#
# Copyright 2013, Mediacurrent, LLC
#
# All rights reserved - Do Not Redistribute

include_recipe "memcached"

# Add memcache pecl package.
php_pear "memcache" do
  action :install
end

# Create a mysql database for homeimprovement.
mysql_database node[:database_name] do
  connection ({
    :host => 'localhost',
    :username => 'root',
    :password => node['mysql']['server_root_password']
  })
  action :create
end

# Create virtual host and enable site.
web_app node[:domain] do
  allow_override "All"
  docroot node[:docroot]
  server_aliases []
  server_name node[:domain]
end

# Append configured domain to /etc/hosts file.
ruby_block "append_hosts" do
  block do
    file = Chef::Util::FileEdit.new("/etc/hosts")
    file.insert_line_if_no_match("127.0.0.1\t#{node[:domain]}", "127.0.0.1\t#{node[:domain]}")
    file.write_file
{'fraction_non_alphanumeric': 0.13191727221911684, 'fraction_numerical': 0.017887087758524316, 'mean_word_length': 4.559006211180124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '3431499', 'n_tokens_mistral': 629, 'n_tokens_neox': 602, 'n_words': 154}