<commit_before>require 'thor'

class Arethusa::CLI
  class Generator < Subcommand
    as_subcommand :generate

    def self.source_root
      File.dirname(__FILE__)
    end

    include Thor::Actions

    desc 'plugin NAME', 'Creates a new Arethusa plugin skeleton'
    method_option :namespace, aliases: '-n', default: 'arethusa',
      desc: 'Namespace of the new plugin'
    method_option :commit, type: :boolean, aliases: '-c',
      desc: 'Commit the skeleton with git'
    def plugin(name)
      @name = name
      @namespace = options[:namespace]

      create_directories
      create_files

      try('add to Gruntfile', :add_to_gruntfile)
      try('add module to index.html', :add_to_index)

      commit_changes if options[:commit]

      puts
      say_status(:success, "Created #{namespaced_name}")
      give_conf_instructions<commit_msg>Deactivate unneeded conf instructions<commit_after>require 'thor'

class Arethusa::CLI
  class Generator < Subcommand
    as_subcommand :generate

    def self.source_root
      File.dirname(__FILE__)
    end

    include Thor::Actions

    desc 'plugin NAME', 'Creates a new Arethusa plugin skeleton'
    method_option :namespace, aliases: '-n', default: 'arethusa',
      desc: 'Namespace of the new plugin'
    method_option :commit, type: :boolean, aliases: '-c',
      desc: 'Commit the skeleton with git'
    def plugin(name)
      @name = name
      @namespace = options[:namespace]

      create_directories
      create_files

      try('add to Gruntfile', :add_to_gruntfile)
      try('add module to index.html', :add_to_index)

      commit_changes if options[:commit]

      puts
      say_status(:success, "Created #{namespaced_name}")
      #give_conf_instructions
{'fraction_non_alphanumeric': 0.09416522241478914, 'fraction_numerical': 0.0, 'mean_word_length': 3.287128712871287, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2335885', 'n_tokens_mistral': 531, 'n_tokens_neox': 508, 'n_words': 148}