<commit_before># Inspired by @the-spectator
# https://dev.to/thespectator/making-your-rails-console-interesting-pdc

IRB.conf[:SAVE_HISTORY] = 1000

def app_prompt
  rails_klass = Rails.application.class

  app_name =
    if rails_klass.respond_to? :module_parent
      rails_klass.module_parent
    else
      rails_klass.parent
    end

  "#{app_name.name}".blue
end

# target log path for irb history
def log_path
  rails_root = Rails.root
  "#{rails_root}/log/.irb-save-history"
end
<commit_msg>Enable irb autocompletion<commit_after>require 'irb/completion'

IRB.conf[:SAVE_HISTORY] = 1000

# IRB Prompt inspired by @the-spectator
# https://dev.to/thespectator/making-your-rails-console-interesting-pdc
def app_prompt
  rails_klass = Rails.application.class

  app_name =
    if rails_klass.respond_to? :module_parent
      rails_klass.module_parent
    else
      rails_klass.parent
    end

  "#{app_name.name}".blue
end

# target log path for irb history
def log_path
  rails_root = Rails.root
  "#{rails_root}/log/.irb-save-history"
end

{'fraction_non_alphanumeric': 0.1022944550669216, 'fraction_numerical': 0.0076481835564053535, 'mean_word_length': 3.892523364485981, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2517580', 'n_tokens_mistral': 402, 'n_tokens_neox': 378, 'n_words': 71}