<commit_before>require "fileutils"
require "thor"

module Codelation
  class Cli < Thor
    RUBY_INSTALL_VERSION = "0.5.0"
    RUBY_INSTALL_URL = "https://github.com/postmodern/ruby-install/archive/v#{RUBY_INSTALL_VERSION}.tar.gz"
    RUBY_VERSION = "2.2.0"

  private

    # Install Ruby binary and add it to PATH.
    def install_ruby
      return if `~/.codelation/ruby/bin/ruby -v`.include?(RUBY_VERSION)

      # Create the directory ~/.codelation/temp if it doesn't exist
      FileUtils.mkdir_p(File.expand_path("~/.codelation/temp"))

      print_command("Installing ruby-install")
      install_ruby_install

      print_command("Installing Ruby #{RUBY_VERSION} to ~/.codelation/ruby")
      `ruby-install -i ~/.codelation/ruby ruby #{RUBY_VERSION}`

      print_command("Installing Ruby gems")<commit_msg>Make installing ruby gems a heading<commit_after>require "fileutils"
require "thor"

module Codelation
  class Cli < Thor
    RUBY_INSTALL_VERSION = "0.5.0"
    RUBY_INSTALL_URL = "https://github.com/postmodern/ruby-install/archive/v#{RUBY_INSTALL_VERSION}.tar.gz"
    RUBY_VERSION = "2.2.0"

  private

    # Install Ruby binary and add it to PATH.
    def install_ruby
      return if `~/.codelation/ruby/bin/ruby -v`.include?(RUBY_VERSION)

      # Create the directory ~/.codelation/temp if it doesn't exist
      FileUtils.mkdir_p(File.expand_path("~/.codelation/temp"))

      print_command("Installing ruby-install")
      install_ruby_install

      print_command("Installing Ruby #{RUBY_VERSION} to ~/.codelation/ruby")
      `ruby-install -i ~/.codelation/ruby ruby #{RUBY_VERSION}`

      print_heading("Installing Ruby Gems")
{'fraction_non_alphanumeric': 0.1198547215496368, 'fraction_numerical': 0.007263922518159807, 'mean_word_length': 3.5662983425414363, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2212447', 'n_tokens_mistral': 601, 'n_tokens_neox': 536, 'n_words': 114}