al-quran.reflectslight.io/Rakefile.rb
2024-05-02 10:46:40 -03:00

29 lines
651 B
Ruby

# frozen_string_literal: true
require "bundler/setup"
require "ryo"
require "yaml"
##
# Rake tasks
load "rake/tasks/deploy.rake"
load "rake/tasks/format.rake"
load "rake/tasks/nanoc.rake"
load "rake/tasks/submodules.rake"
desc "Serve the website on localhost"
task :server, [:protocol] do |_t, args|
require "server"
nanoc = Ryo.from(YAML.load_file("./nanoc.yaml"))
h = args.to_h
o = if h[:protocol] == "unix"
{unix: nanoc.server.unix.path}
else
{host: nanoc.server.tcp.host, port: nanoc.server.tcp.port}
end
s = Server.dir(nanoc.output_dir, o)
s.start(block: true)
rescue Interrupt
s.stop
end
task default: "nanoc:build"