-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
39 lines (31 loc) · 817 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true
require "bundler/setup"
require "sequel/core"
require "sequel_tools"
require_relative "config/application_settings"
db = Sequel.connect(ApplicationSettings.database[:url], test: false, keep_reference: false)
base_config = SequelTools.base_config(
project_root: ApplicationSettings.root,
dbadapter: db.opts[:adapter],
dbname: db.opts[:database],
username: db.opts[:username].to_s,
password: db.opts[:password].to_s
)
task default: :start
task :start do |_t|
system("bundle exec puma")
end
task :console do |_t|
require_relative "config/boot"
require "irb"
ARGV.clear
IRB.start
end
# A shortcut for `rake console`
task c: :console
namespace :db do
SequelTools.inject_rake_tasks(
base_config.merge(log_level: :info, sql_log_level: :info),
self
)
end