require 'bundler/setup' namespace :db do desc 'Run migrations' task :migrate, [:version] do |t, args| require "sequel/core" Sequel.extension :migration version = args[:version].to_i if args[:version] Sequel.connect('sqlite://data/gamedata.db') do |db| Sequel::Migrator.run(db, "db/migrations", target: version) end end end namespace :server do task :start do ENV['APP_ENV'] = 'production' system("puma") end task :dev do system('rerun --no-notify --exit --dir="src/" puma') end end namespace :test do task :rubocop do system("rubocop app/ server.rb scan.rb") end end