Use Yard to generate documentation. Included in the `.yardopts` file is
configuration to also publish the markdown files in the `wiki/`
directory.
wiki/
- addons.md: Information on writing new addons.
- database.md: Information on using the database and migrations
db/migrate/*: Rename in accordance with documentation
Rakefile: Add the Yard Rake tasks
Update Custom Commands to leverage ActiveRecord and save commands to a
database. By default, it will use SQLite. Configuration for this (and
potential configuration for PostgreSQL and MySQL) live in
`config/db.yml`. Inculde a Rakefile for handling DB creation and
migrations.
Rakefile: Add Rakefile to handle running the bot, and DB management
Gemfile: Update with new gem dependencies
db/migrate/*: ActiveRecord migrations for Custom Command
custom_commands.rb: Update to leverage ActiveRecord
Leverage the Rakefile to start the bot, removing the binary file. Update
the Dockerfile to also leverage the Rakefile.
Dockerfile: Update to use Rakefile, and install new dependencies
chronicle: Remove unnecessary start file
Refactor the `chronicle_bot` file into `chronicle` and `matrix`
chronicle.rb: General Chronicle setup
matrix.rb: Start a Matrix-specific bot
Update the bot to read configuration from files, instead of either the
environment, or hard-coded values.
config/db.yml: Database configuration
config/bot.yml: General bot configuration
Update the README to reflect the above change with regards to running
the bot either using the Rakefile, or using a Docker container.
The `help_command` method for each addon/the bot were not returning the
help message, but were instead sending the help messages themselves.
Update the logic to simply return the help message string.
Both `!help` and `!listcommand` are handled by the bot itself, so take
advantage of how the addons method calls work to implement both
`matrix_command` and `help_command` on `self`.
Add `help_command` to each currently enabled and functional addon
With the updated means of handling addons, update Custom Commands to
include the new logic and be functional.
addons/custom_commands.rb: Update for new addons logic
After some more reading, update the logic for handling the addons.
Leverage an "addons module" (Addon), and require that each addon be a
class within that module. Within that class, optionally include a
`self.register` method, which will be called when the bot is
initialized. This method takes one parameter: the bot
instance.Registering the addon adds the bot's instance to an instance of
the addon, and vice versa, allowing the instances to communicate.
Additionally, registering adds the addons commands.
Each registered addon must also include a `matrix_command` method, which
takes the message String from Matrix. The intention here is to include
additional `*_command` methods for different protocols, without having
to change much else. Adding additional protocols will determine how well
that works.
chronicle_bot.rb: Redo addon logic (details above)
addons/utils.rb: Update for new addon logic (details above)
addons/roller.rb: Update for new addon logic (details above)