<commit_before>defmodule Mix.Tasks.Phoenix.New do
  use Mix.Task

  @shortdoc "Creates Phoenix application"

  @template_dir "template"

  @doc """
  Creates Phoenix application.
  """
  def run([name, path]) do
    application_name = Mix.Utils.underscore(name)
    application_module = Mix.Utils.camelize(name)
    project_path = make_project_path(path, application_name)

    bindings = [application_name: application_name,
                application_module: application_module]

    Mix.Generator.create_directory(project_path)

    lc source_path inlist template_files do
      destination_path = make_destination_path(project_path, source_path, application_name)

      if File.dir?(source_path) do
        Mix.Generator.create_directory(destination_path)
      else
        contents = EEx.eval_file(source_path, bindings)

        Mix.Generator.create_file(destination_path, contents)
      end
    end
  end

  @doc """
  Display instructions on how to create a Phoenix application.
  """
  def run(_) do
    Mix.shell.info """
    Supply application name and destination path.<commit_msg>Generate correct module name for app names with dashes.<commit_after>defmodule Mix.Tasks.Phoenix.New do
  use Mix.Task

  @shortdoc "Creates Phoenix application"

  @template_dir "template"

  @doc """
  Creates Phoenix application.
  """
  def run([name, path]) do
    application_name = Mix.Utils.underscore(name)
    application_module = Mix.Utils.camelize(application_name)
    project_path = make_project_path(path, application_name)

    bindings = [application_name: application_name,
                application_module: application_module]

    Mix.Generator.create_directory(project_path)

    lc source_path inlist template_files do
      destination_path = make_destination_path(project_path, source_path, application_name)

      if File.dir?(source_path) do
        Mix.Generator.create_directory(destination_path)
      else
        contents = EEx.eval_file(source_path, bindings)

        Mix.Generator.create_file(destination_path, contents)
      end
    end
  end

  @doc """
  Display instructions on how to create a Phoenix application.
  """
  def run(_) do
    Mix.shell.info """
    Supply application name and destination path.
{'fraction_non_alphanumeric': 0.07962633451957295, 'fraction_numerical': 0.0, 'mean_word_length': 3.6275720164609053, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '638140', 'n_tokens_mistral': 657, 'n_tokens_neox': 632, 'n_words': 155}