-
Notifications
You must be signed in to change notification settings - Fork 0
Developper guide
Welcome to the GL02_TriCode developper guide!
This project is organized into three main Javascript files :
-
caporalCli.js: The entry point of the software. This file provides commands for the user and some standard logic for organizing and printing data. -
CruParser.js: Logical center of the software. All the logic concerning the CRU format and the parsing is in this file. -
Course.js: Defines the Course class with all its properties. The Course class doesn't contain any method.
-
The
caporalCli.jsfile is written using the Caporal.js framework in order to build a command line software. As such, available commands are written as caporal commands with arguments and an action. The action is the function body. These commands only contain standard logic, the CRU parsing is done in a different file dedicated to this job (CruParser.js). -
The
CruParser.jsfile contains all the CRU related logic. It allows to tokenize data and parse it according to the CRU format. This can create Course objects from CRU files. -
The
Course.jsfile is a class file with ths structure:
class Course {
constructor(name) {
this.name = name;
this.creneaux = [];
}
addCreneau(type, nbPlaces, jour, horaire, sousGroupe, salle) {
this.creneaux.push({
type: type,
nbPlaces: nbPlaces,
jour: jour,
horaire: horaire,
sousGroupe: sousGroupe,
salle: salle,
});
}
}A course has two properties:
- name (string)
- creneaux[] (array of timeslots).
It also has a method:
- addCreneau(type, nbPlaces, jour, horaire, sousGroupe, salle)
This method allows adding timeslots to a course. A timeslot is defined by its type, its number of places, its day and hour, its subgroup and its classroom.
At this time, there are several things to work on in this project:
- Generalizing the use of the recursive function to access data. This can be used in almost every command of the
caporalCli.jsfile. - Checking that the provided data is in a CRU format. For now, the extension
.cruis enough for a file to be parsed. - Writing functions for recurrent actions on data. This will make the code more readable and more easy to refactor.
Here is the process to follow if you want to edit, improve or change this project:
- Open an issue on the Github repository following the given issue template.
- Create a new branch to fix the issue on.
- Fix the issue.
- Push your new branch to the repository and merge it using a pull request. Don't forget to close the issue and delete your branch in the process. This step might need reviews from other collaborators.