Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
super Action
# Database used for both the mailing list and the social network
- var db: DB
+ var db: BenitluxDB
# Path to the storage of the last email sent
var sample_email_path = "benitlux_sherbrooke.email"
print beers
end
- var db = new DB.open(db_path)
+ var db = new BenitluxDB.open(db_path)
# Update the database with the beers of the day
db.insert_beers_of_the_day beers
import benitlux_model
# The database of this project
-class DB
+class BenitluxDB
super Sqlite3DB
redef init open(path)
import benitlux_db
-redef class DB
+redef class BenitluxDB
redef fun create_tables
do
# Sqlite3 database
var db_path = "benitlux_sherbrooke.db"
-var db = new DB.open(db_path)
+var db = new BenitluxDB.open(db_path)
var db_error = db.error
if db_error != null then
print_error db_error
import benitlux_db
-redef class DB
+redef class BenitluxDB
# Path to file with the corrections
private var corrections_path = "benitlux_corrections.txt"
# Use the local DB
var db_path = "benitlux_sherbrooke.db"
if rest.not_empty then db_path = rest.first
-var db = new DB.open(db_path)
+var db = new BenitluxDB.open(db_path)
# All known beers
var beers = db.beers