<commit_before>defmodule Mix.Tasks.Sugar.Gen.Router do
  use Mix.Task
  import Mix.Generator
  import Mix.Utils, only: [camelize: 1, underscore: 1]

  @shortdoc "Creates Sugar router files"
  @recursive true

  @moduledoc """
  """
  def run(args) do
    opts = OptionParser.parse(args)
    do_create_file elem(opts, 0)
  end

  def run_detached(assigns) do
    do_create_file assigns
  end

  defp do_create_file(_opts) do
    module = camelize atom_to_binary(Mix.project[:app])

    assigns = [
      app: Mix.project[:app], 
      module: module
    ]

    create_file "lib/#{underscore module}/router.ex", router_template(assigns)
  end

  embed_template :router, ~S"""
  defmodule Router do
    use Sugar.Router

    # Uncomment the following line for request logging
    # plug Plugs.Logger

    # Define your routes here
    get "/", <%= @module %>.Controllers.Main, :index
  end<commit_msg>add comment about adding :exlager<commit_after>defmodule Mix.Tasks.Sugar.Gen.Router do
  use Mix.Task
  import Mix.Generator
  import Mix.Utils, only: [camelize: 1, underscore: 1]

  @shortdoc "Creates Sugar router files"
  @recursive true

  @moduledoc """
  """
  def run(args) do
    opts = OptionParser.parse(args)
    do_create_file elem(opts, 0)
  end

  def run_detached(assigns) do
    do_create_file assigns
  end

  defp do_create_file(_opts) do
    module = camelize atom_to_binary(Mix.project[:app])

    assigns = [
      app: Mix.project[:app], 
      module: module
    ]

    create_file "lib/#{underscore module}/router.ex", router_template(assigns)
  end

  embed_template :router, ~S"""
  defmodule Router do
    use Sugar.Router

    # Uncomment the following line for request logging,
    # and add 'applications: [:exlager],' to the application
    # Keyword list in your mix.exs
    # plug Plugs.Logger

    # Define your routes here
    get "/", <%= @module %>.Controllers.Main, :index
  end
{'fraction_non_alphanumeric': 0.10454783063251437, 'fraction_numerical': 0.0031364349189754314, 'mean_word_length': 3.2723214285714284, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1344232', 'n_tokens_mistral': 664, 'n_tokens_neox': 625, 'n_words': 173}