<commit_before># frozen_string_literal: true

namespace :swagger do
  desc 'Generate Swagger Documentation files'
  task docs: :environment do
    swag = SwaggerDocsGenerator::Generator.new

    puts 'Create Swagger File in :'
    puts swag.info_swagger_file

    # Reload all controller before parsing
    Rails.application.eager_load!

    # Generates files
    puts
    puts 'Generate doc file :'<commit_msg>Add information to task processus<commit_after># frozen_string_literal: true

namespace :swagger do
  desc 'Generate Swagger Documentation files'
  # Execute task just for environment 'doc'
  task docs: :environment do
    swag = SwaggerDocsGenerator::Generator.new

    puts 'Imports documentation file...'
    swag.import_documentations

    puts 'Create Swagger File in :'
    puts swag.info_swagger_file

    puts
    puts 'Aggregate documentation data in `swagger.json` :'
    swag.info_controller_parser { |info| puts info }
{'fraction_non_alphanumeric': 0.06801275239107332, 'fraction_numerical': 0.0, 'mean_word_length': 3.931937172774869, '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': '6236941', 'n_tokens_mistral': 279, 'n_tokens_neox': 279, 'n_words': 87}