Our custom Ruby plugin is for Publishers use Ruby/RoR on their website. The plugin consists of four files, described below:
This file contains a class called YavliResilienceAPI. It implements methods needed to communicate with the Yavli API server, and a simple storage system for the data it fetches from the API. The publisher is welcome to modify this according to their needs. For example, its possible to make it store the fetched code in a database rather than a flat file.
This is a very small module containing configuration variables. You have to put down your Website ID and API Key credentials inside this file in order for the API to be able to connect to our servers.
This is an example of the script that should be executed in cron on your system (or similar scheduler). You can use this example script as is. This script will contact the Yavli API server, and retrieve the some Javascript code wrapped in a <script> tag.
This is just an example to demonstrate what the Publisher should do with the code fetched from the API in YResilience-Cron.rb. The publisher simply needs to add a call in their website code which includes the HTML / Javascript code which has been downloaded and stored locally.
By default, the downloaded JS code is saved to the current relative path into a file named data.json, configured in YResilience-Config.rb. You have to make sure that it is writable and accessible.
Each source file is well-commented so you can easily read through and understand how it works.
Download link: YResilience-Ruby-v1.0.0