<commit_before># This function will install a version of Ruby onto the
# system for the buidlpack to use. It coordinates download
# and setting appropriate env vars for execution
#
# Example:
#
#   heroku_buildpack_ruby_install_ruby "$BIN_DIR" "$ROOT_DIR"
#
# Takes two arguments, the first is the location of the buildpack's
# `bin` directory. This is where the `download_ruby` script can be
# found. The second argument is the root directory where Ruby
# can be installed.
#
# Returns the directory where ruby was downloaded
heroku_buildpack_ruby_install_ruby()
{
  local bin_dir=$1
  local root_dir=$2
  heroku_buildpack_ruby_dir="$root_dir/vendor/ruby/$STACK"

  if [ ! -d "$root_dir/vendor/ruby/$STACK" ]; then
    heroku_buildpack_ruby_dir=$(mktemp -d)
    # bootstrap ruby
    $bin_dir/support/download_ruby $heroku_buildpack_ruby_dir
    function atexit {
      rm -rf $heroku_buildpack_ruby_dir
    }
    trap atexit EXIT
  fi

  export PATH=$heroku_buildpack_ruby_dir/bin/:$PATH
  unset GEM_PATH
}
<commit_msg>Add comments that explain where $STACK comes from<commit_after># This function will install a version of Ruby onto the
# system for the buidlpack to use. It coordinates download
# and setting appropriate env vars for execution
#
# Example:
#
#   heroku_buildpack_ruby_install_ruby "$BIN_DIR" "$ROOT_DIR"
#
# Takes two arguments, the first is the location of the buildpack's
# `bin` directory. This is where the `download_ruby` script can be
# found. The second argument is the root directory where Ruby
# can be installed.
#
# This function relies on the env var `$STACK` being set. This
# is set in codon outside of the buildpack. An example of a stack
# would be "cedar-14".
#
# Returns the directory where ruby was downloaded
heroku_buildpack_ruby_install_ruby()
{
  local bin_dir=$1
  local root_dir=$2
  heroku_buildpack_ruby_dir="$root_dir/vendor/ruby/$STACK"

  if [ ! -d "$root_dir/vendor/ruby/$STACK" ]; then
    heroku_buildpack_ruby_dir=$(mktemp -d)
    # bootstrap ruby
    $bin_dir/support/download_ruby $heroku_buildpack_ruby_dir
    function atexit {
      rm -rf $heroku_buildpack_ruby_dir
    }
    trap atexit EXIT
  fi

  export PATH=$heroku_buildpack_ruby_dir/bin/:$PATH
  unset GEM_PATH
}

{'fraction_non_alphanumeric': 0.07982062780269059, 'fraction_numerical': 0.0026905829596412557, 'mean_word_length': 4.350119904076738, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6485256', 'n_tokens_mistral': 758, 'n_tokens_neox': 710, 'n_words': 236}