<commit_before>namespace :rbenv do
  desc 'Install rbenv and ruby-build, if necessary'
  task :setup do
    on roles(fetch(:rbenv_roles)) do
      [:rbenv, :ruby_build].each do |component|
        path = fetch("#{component}_path".to_sym)
        url = fetch("#{component}_git_url".to_sym)
        execute :git, 'clone', url, path unless test "[ -d #{path} ]"
      end
    end
  end

  desc 'Upgrade rbenv and ruby-build'
  task :update do
    on roles(fetch(:rbenv_roles)) do
      [fetch(:rbenv_path), fetch(:ruby_build_path)].each do |update_path|
        within update_path do
          execute :git, 'pull'
        end
      end
    end
  end

  desc 'Install a new ruby or, the one provided by rbenv_ruby if none is given.'
  task :install, [:new_ruby] do |task, args|
    on roles(fetch(:rbenv_roles)) do
      ruby_version =  args[:new_ruby] || fetch(:rbenv_ruby)

      unless test "[ -d #{fetch(:rbenv_path)}/versions/#{ruby_version} ]"
        execute :rbenv, 'install', args[:new_ruby] || fetch(:rbenv_ruby)
        execute :rbenv, 'local', args[:new_ruby] || fetch(:rbenv_ruby)
        execute :rbenv, 'rehash'
        execute :gem, 'install', 'bundler' unless fetch(:bundle_roles)
        execute :rbenv, 'rehash'
      end
    end
  end

  before 'rbenv:validate', 'rbenv:setup'
  before 'rbenv:install', 'rbenv:map_bins'
  before 'rbenv:validate', 'rbenv:install'
end

namespace :load do
  task :defaults do
    set :ruby_build_path, -> { '%s/plugins/ruby-build' % fetch(:rbenv_path) }
    set :rbenv_git_url, 'git://github.com/sstephenson/rbenv.git'
    set :ruby_build_git_url, 'git://github.com/sstephenson/ruby-build.git'<commit_msg>Fix ruby build updating<commit_after>namespace :rbenv do
  desc 'Install rbenv and ruby-build, if necessary'
  task :setup do
    on roles(fetch(:rbenv_roles)) do
      [:rbenv, :ruby_build].each do |component|
        path = fetch("#{component}_path".to_sym)
        url = fetch("#{component}_git_url".to_sym)
        execute :git, 'clone', url, path unless test "[ -d #{path} ]"
      end
    end
  end

  desc 'Upgrade rbenv and ruby-build'
  task :update do
    on roles(fetch(:rbenv_roles)) do
      [fetch(:rbenv_path), fetch(:ruby_build_path)].each do |update_path|
        within update_path do
          execute :git, 'pull'
        end
      end
    end
  end

  desc 'Install a new ruby or, the one provided by rbenv_ruby if none is given.'
  task :install, [:new_ruby] do |task, args|
    on roles(fetch(:rbenv_roles)) do
      ruby_version =  args[:new_ruby] || fetch(:rbenv_ruby)

      unless test "[ -d #{fetch(:rbenv_path)}/versions/#{ruby_version} ]"
        execute :rbenv, 'install', args[:new_ruby] || fetch(:rbenv_ruby)
        execute :rbenv, 'local', args[:new_ruby] || fetch(:rbenv_ruby)
        execute :rbenv, 'rehash'
        execute :gem, 'install', 'bundler' unless fetch(:bundle_roles)
        execute :rbenv, 'rehash'
      end
    end
  end

  before 'rbenv:setup', 'rbenv:update'
  before 'rbenv:validate', 'rbenv:setup'
  before 'rbenv:install', 'rbenv:map_bins'
  before 'rbenv:validate', 'rbenv:install'
end

namespace :load do
  task :defaults do
    set :ruby_build_path, -> { '%s/plugins/ruby-build' % fetch(:rbenv_path) }
    set :rbenv_git_url, 'git://github.com/sstephenson/rbenv.git'
    set :ruby_build_git_url, 'git://github.com/sstephenson/ruby-build.git'
{'fraction_non_alphanumeric': 0.13740685543964232, 'fraction_numerical': 0.0, 'mean_word_length': 3.3191763191763193, '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': '4544280', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1194, 'n_words': 291}