-
Notifications
You must be signed in to change notification settings - Fork 1
How to create a public or private LOEP plugin with new evaluation models and metrics
The first step to create a LOEP plugin is execute the following command in the root path of the LOEP application:
rails plugin new pluginName --full
This will create a folder called pluginName in the root path of the LOEP application which should be moved to the loep_plugins folder as follows:
mv pluginName loep_plugins/
Then, we need to add the plugin to the application_config.yml file in order to enable it. For that, we should add pluginName to the array specified in the plugins key.
After that, we need to execute the following command:
bundle install
By default, the created plugin located at /loep_plugins/pluginName will not be uploaded to the public repository so it will remain private. If you want to make the plugin public, you can add an exception in the .gitignore file as follows:
!loep_plugins/pluginName
Finally, you can specify different settings for the plugin in the following files located at /loep_plugins/pluginName: README.rdoc and pluginName.gemspec. By default a file called MIT-LICENSE is created at the root of the plugin path. You are free to remove such a file and specify the license you want in the README.rdoc file. If you remove the MIT-LICENSE file, remove also the reference to the file included in the pluginName.gemspec file.
LOEP plugins can be used to provide new evaluations models and/or metrics. Next section explains how to do that. Besides, since LOEP plugins are Rails engines, they can be used to provide new features or to override original features. You can check this guide for further information.
As explained in other sections of the wiki, LOEP allows to define new evaluation models as well as metrics. Instead of defining these models or metrics in the core system, it is possible to define them as plugins. This approach can be useful in some situations, for instance, for adding support to private evaluation models and metrics, or to provide a set of evaluation models and metrics packaged in a single ZIP file. This guide explains how to create a plugin and define in it an evaluation model and a metric.
After creating a plugin following the previous instructions, it is possible to create evaluation models and metrics for the plugin with the tasks generate:evmethod and generate:metric as indicated in the sections How to add a new evaluation model and [https://github.com/agordillo/LOEP/wiki/How-to-add-a-new-metric](How to add a new metric), but adding an extra parameter indicating the name of the plugin.
Thereby, in order to create a new evaluation model, instead of using:
bundle exec rake generate:evmethod["modelName","multiple","automatic","moduleName"]
as indicated in the How to add a new evaluation model section, we should use:
bundle exec rake generate:evmethod["modelName","multiple","automatic","moduleName","pluginName"]
For instance, to create an evaluation model called "Starp" in a plugin termed "loep_stars_private" the following command should be executed:
bundle exec rake generate:evmethod["Starp","false","false",,"loep_stars_private"]
Similarly, in order to create a new metric, instead of using:
bundle exec rake generate:metric["metricName","evModelNames","moduleName"]
as indicated in the How to add a new metric section, we should use:
bundle exec rake generate:metric["metricName","evModelNames","moduleName","pluginName"]
For instance, to create a metric called "Starp Metric" in a plugin termed "loep_stars_private" the following command should be executed:
bundle exec rake generate:metric["Starp Metric","Starp",,"loep_stars_private"]
Finally, in order to use the new evaluation model and metric created, they should be enabled in the application_config.yml file: "Starp" should be added to the evmethods key and "Starp Metric" should be added to the metrics key.