<commit_before># Ruby setup using rvm so chef and other ruby items work as expected.
#  There may be an issue with  GEM_PATH and GEM_HOME
#
namespace :ruby do
  desc "Install rvm for ubuntu user"
  task :rvm , :roles=> :c_client do
    server.bash # Setup bash to work with rvm
    upload "./ruby/files/setup-rvm.sh", "#{user_home_dir}/cap-files/bin/setup-rvm.sh"
    run "chmod 755  #{user_home_dir}/cap-files/bin/setup-rvm.sh ; #{sudo} #{user_home_dir}/cap-files/bin/setup-rvm.sh"
    run "rvm install 1.9.2"
    run "rvm --default use 1.9.2"
    run "ruby --version"
    run "GEM_PATH=\"$(rvm gemdir)\" GEM_HOME=\"$(rvm gemdir)\" rvm rubygems current"
  end
  namespace :chef do
    desc "Required chef base" 
    task :base , :roles=> :c_client do
      run "#{sudo} mkdir -p /etc/chef ; mkdir -p #{user_home_dir}/cap-files/etc/chef"
      run "GEM_PATH=\"$(rvm gemdir)\" GEM_HOME=\"$(rvm gemdir)\" gem install chef --version=0.10 --no-ri --no-rdoc"
      run "GEM_PATH=\"$(rvm gemdir)\" GEM_HOME=\"$(rvm gemdir)\" gem install ohai --no-ri --no-rdoc"
      upload "./ruby/files/chef/install-chef.sh", "#{user_home_dir}/cap-files/install-chef.sh"
      run "chmod 755 #{user_home_dir}/cap-files/install-chef.sh"
      upload "./ruby/files/chef/solo.rb", "#{user_home_dir}/cap-files/etc/chef/solo.rb"
      run "#{sudo} cp #{user_home_dir}/cap-files/etc/chef/solo.rb /etc/chef"
    end
    desc "Create server.rb configuration file"
    task :create_conf, :roles => :c_server do
      template = File.read(File.join(File.dirname(__FILE__), "./files/chef/server.rb.erb"))
      buffer   = ERB.new(template).result(binding)
      put buffer, "#{user_home_dir}/cap-files/etc/chef/server.rb"
    end
    desc "Install chef server"<commit_msg>Not sure if this will fix the error. I may just move to using packages<commit_after># Ruby setup using rvm so chef and other ruby items work as expected.
#  There may be an issue with  GEM_PATH and GEM_HOME
#
namespace :ruby do
  desc "Install rvm for ubuntu user"
  task :rvm do
    upload "./ruby/files/setup-rvm.sh", "#{user_home_dir}/cap-files/bin/setup-rvm.sh"
    run "chmod 755  #{user_home_dir}/cap-files/bin/setup-rvm.sh"
    run "#{sudo} #{user_home_dir}/cap-files/bin/setup-rvm.sh"
    servers.bash # Setup bash to work with rvm
    run "#{sudo} #{user_home_dir}/cap-files/bin/setup-rvm.sh"
    servers.bash # Setup bash to work with rvm
    run "rvm install 1.9.2"
    run "rvm --default use 1.9.2"
    run "ruby --version"
    run "GEM_PATH=\"$(rvm gemdir)\" GEM_HOME=\"$(rvm gemdir)\" rvm rubygems current"
  end
  namespace :chef do
    desc "Required chef base" 
    task :base do
      run "#{sudo} mkdir -p /etc/chef ; mkdir -p #{user_home_dir}/cap-files/etc/chef"
      run "GEM_PATH=\"$(rvm gemdir)\" GEM_HOME=\"$(rvm gemdir)\" gem install chef --version=0.10 --no-ri --no-rdoc"
      run "GEM_PATH=\"$(rvm gemdir)\" GEM_HOME=\"$(rvm gemdir)\" gem install ohai --no-ri --no-rdoc"
      upload "./ruby/files/chef/install-chef.sh", "#{user_home_dir}/cap-files/install-chef.sh"
      run "chmod 755 #{user_home_dir}/cap-files/install-chef.sh"
      upload "./ruby/files/chef/solo.rb", "#{user_home_dir}/cap-files/etc/chef/solo.rb"
      run "#{sudo} cp #{user_home_dir}/cap-files/etc/chef/solo.rb /etc/chef"
    end
    desc "Create server.rb configuration file"
    task :create_conf, :roles => :c_server do
      template = File.read(File.join(File.dirname(__FILE__), "./files/chef/server.rb.erb"))
      buffer   = ERB.new(template).result(binding)
      put buffer, "#{user_home_dir}/cap-files/etc/chef/server.rb"
    end
    desc "Install chef server"
{'fraction_non_alphanumeric': 0.16108497093827845, 'fraction_numerical': 0.008303349017437033, 'mean_word_length': 3.135011441647597, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5747742', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1363, 'n_words': 328}