diff --git a/Rakefile.rb b/Rakefile.rb index 8b36a6c..84d55f2 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -3,6 +3,7 @@ require "bundler/setup" require "nanoc" require "ryo" +require "ryo/yaml" require "yaml" begin diff --git a/rake/tasks/server.rake b/rake/tasks/server.rake index 6a973d6..dc1741d 100644 --- a/rake/tasks/server.rake +++ b/rake/tasks/server.rake @@ -1,14 +1,13 @@ # frozen_string_literal: true +cwd = File.realpath File.join(__dir__, "..", "..", ".") desc "Start web server" task :server, [:protocol] do |_t, args| - require "yaml" - require "ryo" require "server" - nanoc = Ryo.from(YAML.load_file("./nanoc.yaml")) + nanoc = Ryo.from_yaml(path: File.join(cwd, "nanoc.yaml")) h = args.to_h p = h[:protocol] || "tcp" - n = File.basename File.realpath(File.join(__dir__, "..", "..", ".")) + n = File.basename(cwd) o = if p == "unix" {unix: nanoc.server.unix.path} else