2024-07-03 09:32:02 -04:00
|
|
|
require 'bundler/setup'
|
|
|
|
|
2024-07-03 09:41:09 -04:00
|
|
|
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/destructo.db') do |db|
|
|
|
|
Sequel::Migrator.run(db, "db/migrations", target: version)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-07-03 09:32:02 -04:00
|
|
|
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 src/")
|
|
|
|
end
|
|
|
|
end
|