<commit_before>#!/bin/bash
set -e

case "$1" in
  ".go" )
    touch runner.go
    echo "$2" > runner.go
    go run runner.go ;;
  ".c" )
    touch runner.c
    echo "$2" > runner.c
    cc runner.c
    ./a.out ;;
  ".rb" )
    if [[ -n "$3" ]]; then
      rbenv global $3
    fi

    touch runner.rb
    echo "$2" > runner.rb
    ruby runner.rb ;;
  ".py" )
    touch runner.py
    echo "$2" > runner.py
    python runner.py ;;
esac<commit_msg>Optimising the Ruby version select.<commit_after>#!/bin/bash
set -e

case "$1" in
  ".go" )
    touch runner.go
    echo "$2" > runner.go
    go run runner.go ;;
  ".c" )
    touch runner.c
    echo "$2" > runner.c
    cc runner.c
    ./a.out ;;
  ".rb" )
    if [[ -n "$3" ]]; then
      rb_version=$3
      rb_versions=($(cd ~/.rbenv/versions && ls -d */))
      for version in $rb_versions
      do
        if [[ $version == *"$rb_version"* ]]
        then
          rb_version=$version
          break
        fi
      done
      rbenv global $rb_version
    fi

    touch runner.rb
    echo "$2" > runner.rb
    ruby runner.rb ;;
  ".py" )
    touch runner.py
    echo "$2" > runner.py
    python runner.py ;;
esac
{'fraction_non_alphanumeric': 0.15920826161790017, 'fraction_numerical': 0.012048192771084338, 'mean_word_length': 1.7046511627906977, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6773718', 'n_tokens_mistral': 448, 'n_tokens_neox': 430, 'n_words': 119}