2023-07-02 23:42:24 -04:00
|
|
|
require 'bundler/setup'
|
|
|
|
|
2023-07-05 18:04:31 -04:00
|
|
|
namespace :db do
|
2023-12-07 13:04:02 -05:00
|
|
|
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
|
2023-07-05 18:04:31 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-07-02 23:42:24 -04:00
|
|
|
namespace :server do
|
|
|
|
task :start do
|
2023-07-03 23:02:25 -04:00
|
|
|
ENV['APP_ENV'] = 'production'
|
2023-07-02 23:42:24 -04:00
|
|
|
system("puma")
|
|
|
|
end
|
|
|
|
|
2023-07-03 23:02:25 -04:00
|
|
|
task :dev do
|
2023-11-29 22:01:44 -05:00
|
|
|
system('rerun --no-notify --exit --dir="src/" puma')
|
2023-07-03 23:02:25 -04:00
|
|
|
end
|
|
|
|
end
|
2023-12-08 12:17:13 -05:00
|
|
|
|
|
|
|
namespace :test do
|
|
|
|
task :rubocop do
|
|
|
|
system("rubocop app/ server.rb scan.rb")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|