<commit_before>#!/usr/bin/ruby
 
#requires
require 'rubygems'
require 'erb'
require 'json'

username = "bahadir"
git_branch = "vagrant"
git_rev = "HEAD"

env = "_default"

roles = %w( authworker  broker rabbitmq_server  cacheworker  emailworker  guestcleanup  socialworker  web_server )

roles.each do |role|
    userdata = "./user-data/dev-data.txt.erb"
    output = "./json/development/#{role}.tmpl.json" 
    userdata = IO.read(userdata)
    bootstrap_script = ERB.new(userdata).result(binding)

    cf_template_erb = IO.read("./templates/development/#{role}.tmpl.erb")
    cf_template = ERB.new(cf_template_erb).result(binding)

    template_file = File.new(output,'w')
    template_file.puts cf_template
    template_file.close
    puts output
end
<commit_msg>Don't hardcore username & git repo<commit_after>#!/usr/bin/ruby
 
#requires
require 'rubygems'
require 'erb'
require 'json'

unless ARGV.length == 2
  puts "Usage:"
  puts "  ruby generateDev.rb <subdomain> <git_branch>\n"
  exit
end

username = ARGV[0]
git_branch = ARGV[1]

git_rev = "HEAD"
env = "_default"

roles = %w( authworker  broker rabbitmq_server  cacheworker  emailworker  guestcleanup  socialworker  web_server )

roles.each do |role|
    userdata = "./user-data/dev-data.txt.erb"
    output = "./json/development/#{role}.tmpl.json" 
    userdata = IO.read(userdata)
    bootstrap_script = ERB.new(userdata).result(binding)

    cf_template_erb = IO.read("./templates/development/#{role}.tmpl.erb")
    cf_template = ERB.new(cf_template_erb).result(binding)

    template_file = File.new(output,'w')
    template_file.puts cf_template
    template_file.close
    puts output
end

{'fraction_non_alphanumeric': 0.12794206397103197, 'fraction_numerical': 0.0018105009052504525, 'mean_word_length': 4.03951367781155, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7048279', 'n_tokens_mistral': 615, 'n_tokens_neox': 592, 'n_words': 114}