Update server.rake
This commit is contained in:
parent
fcd81a7b14
commit
2a110a77ba
2 changed files with 4 additions and 4 deletions
|
@ -3,6 +3,7 @@
|
||||||
require "bundler/setup"
|
require "bundler/setup"
|
||||||
require "nanoc"
|
require "nanoc"
|
||||||
require "ryo"
|
require "ryo"
|
||||||
|
require "ryo/yaml"
|
||||||
require "yaml"
|
require "yaml"
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
cwd = File.realpath File.join(__dir__, "..", "..", ".")
|
||||||
desc "Start web server"
|
desc "Start web server"
|
||||||
task :server, [:protocol] do |_t, args|
|
task :server, [:protocol] do |_t, args|
|
||||||
require "yaml"
|
|
||||||
require "ryo"
|
|
||||||
require "server"
|
require "server"
|
||||||
nanoc = Ryo.from(YAML.load_file("./nanoc.yaml"))
|
nanoc = Ryo.from_yaml(path: File.join(cwd, "nanoc.yaml"))
|
||||||
h = args.to_h
|
h = args.to_h
|
||||||
p = h[:protocol] || "tcp"
|
p = h[:protocol] || "tcp"
|
||||||
n = File.basename File.realpath(File.join(__dir__, "..", "..", "."))
|
n = File.basename(cwd)
|
||||||
o = if p == "unix"
|
o = if p == "unix"
|
||||||
{unix: nanoc.server.unix.path}
|
{unix: nanoc.server.unix.path}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue