forked from jfranciscosousa/discordrb-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
43 lines (34 loc) · 804 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
40
41
42
43
ENV["RUBY_ENV"] ||= "development"
require "bundler/setup"
require "dotenv/load" if ENV["RUBY_ENV"] != "production"
require "./lib/factory_bot"
Bundler.require(:default, ENV["RUBY_ENV"])
loader = Zeitwerk::Loader.for_gem
loader.push_dir("#{File.dirname(__FILE__)}/src")
loader.setup
if Gem.loaded_specs.key?("rubocop")
require "rubocop/rake_task"
namespace :lint do
RuboCop::RakeTask.new(:ruby)
end
desc "Run all linters"
task lint: %i[lint:ruby]
end
task :bot do
DiscordBot.run
end
task :cron do
Cron.run
end
task :web do
Rack::Server.start(
Port: ENV["PORT"] || 4567,
app: Webserver.new,
)
end
task :all do
#Process.fork { Rake::Task["cron"].invoke }
Process.fork { Rake::Task["bot"].invoke }
#Process.fork { Rake::Task["web"].invoke }
Process.waitall
end