<commit_before>require "active_support/all"

def install_standalone
  set_ruby_version

  gem "godmin", "1.3.0"

  after_bundle do
    create_database

    generate_models

    generate("godmin:install")
    generate("godmin:resource", "article")
    generate("godmin:resource", "author")

    modify_rakefile
    modify_routes
    modify_locales
    modify_models
    modify_author_service
    modify_article_controller
    modify_article_service

    migrate_and_seed
  end
end

def install_engine
  set_ruby_version

  run_ruby_script("bin/rails plugin new admin --mountable")

  gsub_file "admin/admin.gemspec", "TODO: ", ""
  gsub_file "admin/admin.gemspec", "TODO", ""

  inject_into_file "admin/admin.gemspec", before: /^end/ do
    <<-END.strip_heredoc.indent(2)
      s.add_dependency "godmin", "~> 1.0.0"
    END
  end

  gem "admin", path: "admin"

  after_bundle do<commit_msg>Update godmin version in template for engine installation<commit_after>require "active_support/all"

def install_standalone
  set_ruby_version

  gem "godmin", "1.3.0"

  after_bundle do
    create_database

    generate_models

    generate("godmin:install")
    generate("godmin:resource", "article")
    generate("godmin:resource", "author")

    modify_rakefile
    modify_routes
    modify_locales
    modify_models
    modify_author_service
    modify_article_controller
    modify_article_service

    migrate_and_seed
  end
end

def install_engine
  set_ruby_version

  run_ruby_script("bin/rails plugin new admin --mountable")

  gsub_file "admin/admin.gemspec", "TODO: ", ""
  gsub_file "admin/admin.gemspec", "TODO", ""

  inject_into_file "admin/admin.gemspec", before: /^end/ do
    <<-END.strip_heredoc.indent(2)
      s.add_dependency "godmin", "~> 1.3.0"
    END
  end

  gem "admin", path: "admin"

  after_bundle do
{'fraction_non_alphanumeric': 0.10318331503841932, 'fraction_numerical': 0.007683863885839737, 'mean_word_length': 3.848404255319149, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1814860', 'n_tokens_mistral': 643, 'n_tokens_neox': 622, 'n_words': 122}