<commit_before>#
# Cookbook Name:: practicingruby
# Recipe:: app
#

# Install JavaScript runtime for Rails app
package "nodejs"

# Install Pygments for syntax highlighting
package "python-pygments"

# Create deploy user first
include_recipe "practicingruby::deploy_user"

# Create config directory for Rails app
config_dir = "/home/#{node["practicingruby"]["deploy"]["username"]}/shared"
directory config_dir do
  owner  node["practicingruby"]["deploy"]["username"]
  group  node["practicingruby"]["deploy"]["username"]
  mode   "2775"
  action :create
end

# Create config files for Rails app
%w(cache_cooker_settings.rb
   database.yml
   mail_settings.rb
   mailchimp_settings.rb
   mixpanel.rb
   omniauth.rb
   secret_token.rb
   stripe.rb
).each do |file|
  template File.join(config_dir, file) do
    owner  node["practicingruby"]["deploy"]["username"]
    group  node["practicingruby"]["deploy"]["username"]
    mode   "0644"
    action :create
    variables(
      # For secret_token.rb.erb
      :secret => "the-secret-token"
    )
  end
end<commit_msg>Minimum length of secret token is 30 characters<commit_after>#
# Cookbook Name:: practicingruby
# Recipe:: app
#

# Install JavaScript runtime for Rails app
package "nodejs"

# Install Pygments for syntax highlighting
package "python-pygments"

# Create deploy user first
include_recipe "practicingruby::deploy_user"

# Create config directory for Rails app
config_dir = "/home/#{node["practicingruby"]["deploy"]["username"]}/shared"
directory config_dir do
  owner  node["practicingruby"]["deploy"]["username"]
  group  node["practicingruby"]["deploy"]["username"]
  mode   "2775"
  action :create
end

# Create config files for Rails app
%w(cache_cooker_settings.rb
   database.yml
   mail_settings.rb
   mailchimp_settings.rb
   mixpanel.rb
   omniauth.rb
   secret_token.rb
   stripe.rb
).each do |file|
  template File.join(config_dir, file) do
    owner  node["practicingruby"]["deploy"]["username"]
    group  node["practicingruby"]["deploy"]["username"]
    mode   "0644"
    action :create
    variables(
      # For secret_token.rb.erb
      :secret => "3f8e352c942d04b489795f5a9fe464c0"
    )
  end
end
{'fraction_non_alphanumeric': 0.11856617647058823, 'fraction_numerical': 0.01838235294117647, 'mean_word_length': 4.525380710659898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4575297', 'n_tokens_mistral': 745, 'n_tokens_neox': 722, 'n_words': 172}