<commit_before>frazzle
=======

a gem plugin-manager<commit_msg>added more prosa to the readme<commit_after>frazzle
=========

Simple plugin-manager facilitating ruby gems.

## Introduction
Lets say we want to implement a pizzaria without hardcoding recipes or
ovens. New recipes or ovens should be picked out automatically as soon
as a fitting gem is installed.

For this we would have to create the following "plugin" gems for the
recipes:

- pizzaria_margerita_recipe
- pizzaria_tonno_recipe
- pizzaria_diavola_recipe

and for the ovens:

- pizzaria_wood_oven
- pizzaria_electric_oven

The pizzaria application could then find all recipes and call them with:

    registry = Frazzle::Registry.new('pizzaria', '_', '_')
    plugins = registry.get_plugins('recipe')
    plugins.each do |plugin|
      registry.load_plugin(plugin, Context.new)
    end

The interesting part is the second argument to load_plugin.
Frazzle executes the file lib/gemname/plugin.rb with instance oval on
this object. You are free to come up with a plugin mechanism you like.

## Conventions
As seens in the intrductionary example, the plugin system has some
conventions hardcoded.

1. The gems that can be used as plugin must follow a nameing scheme:
      `application_plugin_type`. The seapator between application,
      plugin and type can be configured.
2. Frazzle always instance-evals the file lib/gemname/plugin.rb.

## Todo
- returning plugin objects instead of string from the search functions
  of registry.
  
{'fraction_non_alphanumeric': 0.06266666666666666, 'fraction_numerical': 0.0013333333333333333, 'mean_word_length': 4.341637010676156, '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': '3327449', 'n_tokens_mistral': 443, 'n_tokens_neox': 418, 'n_words': 181}