Micro framework for quickly implement Mumuki runners
The best way to start using mumukit is with mumukit-bootstrap, and reading our online documentation in develop.mumuki.io
You usually add mumukit to an empty project. First you need to add it to your Gemfile:
gem 'mumukit'
or, if you want latest version:
gem 'mumukit', github: 'mumuki/mumukit', branch: 'master'
And then bundle install
mumukit works with Ruby 2.0-2.3
The easiest way of getting started is by using using the seed/seed.sh script.
- Clone this project in a clean directory:
git clone https://github.com/mumuki/mumukit - Go to
seeddirectory:cd mumukit/seed - Run the script:
./seed.sh - Follow instructions.
mumukit is a framework where nearly everything is a hook - a class you must implement following some naming and method conventions.
In order to implement a Mumuki Runner with mumukit, you need zero or more of the following:
query_hook: lets runner to run queries like in a native consoleversion_hook: lets runner to specify a versionfeedback_hook: lets runner to generate explanations of compiler/interpreter toolsexpectations_hook: lets runner to execute expectationsvalidation_hook: lets runner to validate request in order to detect malicious code
In addition, mumukit provides some components to make implementation of hooks easier:
Mumukit::IsolatedEnvironmentMumukit::CookieMumukit::MetatestMumukit::Explainer
Also, mumukit provides templates that implement some specialized use cases hooks:
Mumukit::Hook: the base hook. It lets to read environment variables and translationsMumukit::Templates::FileHook: allows to implementtest_hooksandquery_hooksthat interact with external command line tools using files and command line argumentsMumukit::Templates::MulangExpectationsHook: allows to implementexpectation_hooksthat rely on mulang tool
Finally, mumukit templates provides the following extensions - features that can be activated in some hooks:
Mumukit::Hookstateful_through: lets to handle cookies. Useful inquery_hooks.
Mumukit::Templates::FileHook:line_number_offset: lets you specify line number offset, so that line numbers reported by compilers and interpreters matches content.structured: lets to process JSON output from external commandsmashup: lets to generate source code filesisolated: lets to run commands within docker or in native environmentMumukit::Templates::MulangExpectationsHookinclude_smells: lets to include in the result smells produced by mulang
If you need to serve assets, you can include the Mumukit::Server::WithAssets mixin which enables cross origin requests and provides get_asset and get_local_asset methods