<commit_before>require_relative '../../lib/phonetic_alphabet'
require_relative '../../lib/time_now'

class ForkerController < ApplicationController

  def fork
    begin
      forked_id = storer.tag_fork(id, avatar_name, tag, time_now)
      result = {
        forked: true,
        id: forked_id,
        phonetic: Phonetic.spelling(forked_id[0..5]).join('-')
      }
    rescue => caught
      result = fork_failed(caught)
    end

    respond_to do |format|
      format.json { render json: result }
      format.html { redirect_to controller: 'kata',
                                    action: 'individual',
                                        id: result[:id] }
    end
  end

  private # = = = = = = = = = = =
<commit_msg>fix forker/fork; it must not forward to kata/individual because no avatar has been started; instead forward to kata/group so the ok button opens a dashboard<commit_after>require_relative '../../lib/phonetic_alphabet'
require_relative '../../lib/time_now'

class ForkerController < ApplicationController

  def fork
    begin
      forked_id = storer.tag_fork(id, avatar_name, tag, time_now)
      result = {
        forked: true,
        id: forked_id,
        phonetic: Phonetic.spelling(forked_id[0..5]).join('-')
      }
    rescue => caught
      result = fork_failed(caught)
    end

    respond_to do |format|
      format.json { render json: result }
      format.html { redirect_to controller: 'kata',
                                    action: 'group',
                                        id: result[:id] }
    end
  end

  private # = = = = = = = = = = =

{'fraction_non_alphanumeric': 0.11298377028714107, 'fraction_numerical': 0.0024968789013732834, 'mean_word_length': 1.9685185185185186, 'pattern_counts': {'":': 0, '<': 5, '<?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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6701924', 'n_tokens_mistral': 491, 'n_tokens_neox': 471, 'n_words': 114}