<commit_before>require 'ruby-swagger/io/file_system'
require 'ruby-swagger/template'

namespace :swagger do

  namespace :grape do

    desc 'Generate a swagger meta documentation from Grape API definition and store it under doc/swagger'
    task :generate_doc do
      puts "Exporting from Grape"

      swagger_doc = Swagger::Data::Template.generate

      # Get path data from Grape
<commit_msg>integrate rake task with grape<commit_after>require 'ruby-swagger/io/file_system'
require 'ruby-swagger/grape_template'

namespace :swagger do

  namespace :grape do

    desc 'Generate a swagger meta documentation from Grape API definition and store it under doc/swagger'
    task :generate_doc, [:base_class] => :environment do |t, args|
      if args[:base_class].nil?
        STDERR.puts "You need to pass a base class for your API"
        STDERR.puts "For example: rake 'swagger:grape:generate_doc[ApiBase]'"
        exit -1
      end

      puts "Exporting from Grape - base class #{args[:base_class]}"

      swagger_doc = Swagger::GrapeTemplate.generate(Module.const_get(args[:base_class]))

      # Get path data from Grape

{'fraction_non_alphanumeric': 0.08480565371024736, 'fraction_numerical': 0.0008833922261484099, 'mean_word_length': 3.720833333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4505520', 'n_tokens_mistral': 361, 'n_tokens_neox': 339, 'n_words': 110}