raven/raven.rb

35 lines
898 B
Ruby
Raw Normal View History

2022-12-07 17:52:27 -05:00
require 'logger'
require 'sequel'
require 'sqlite3'
require 'sinatra'
require 'sinatra/namespace'
2022-12-07 17:52:27 -05:00
require_relative 'lib/config.rb'
set :public_folder, __dir__ + '/public'
set :views, settings.root + '/views'
# Load configuration file
conf = Config.new(File.join(__dir__, 'data/defaults.yaml'))
# Initialize logging
logger = Logger.new(STDOUT)
logger.level = Logger::INFO
# Load the Sequel timestamps plugin
Sequel::Model.plugin :timestamps
# Initialize Sequel gem for database actions
DB = Sequel.connect(adapter: conf.get('database.adapter'), database: conf.get('database.database'))
# Load models
require_relative 'lib/models/item.rb'
2022-12-08 01:32:41 -05:00
require_relative 'lib/models/item_comment.rb'
2022-12-08 17:26:44 -05:00
require_relative 'lib/models/license.rb'
require_relative 'lib/models/license_comment.rb'
2022-12-07 17:52:27 -05:00
# Load helper functions
require_relative 'lib/helpers.rb'
2022-12-07 17:52:27 -05:00
# Register route handlers
require_relative 'lib/routes.rb'