diff --git a/Rakefile.rb b/Rakefile.rb index 84d55f2a9..4e504213e 100644 --- a/Rakefile.rb +++ b/Rakefile.rb @@ -4,7 +4,8 @@ require "bundler/setup" require "nanoc" require "ryo" require "ryo/yaml" -require "yaml" +require_relative "nanoc/lib/utils" +include Utils begin load "rake/tasks/deploy.rake" diff --git a/nanoc/lib/utils.rb b/nanoc/lib/utils.rb index a3f1d1f30..678d7cbcb 100644 --- a/nanoc/lib/utils.rb +++ b/nanoc/lib/utils.rb @@ -2,8 +2,9 @@ ## # The {Utils Utils} module provides methods that are -# available at build time. Both ERB templates and the -# Rules file have access to the methods of this module +# available at build time. ERB templates, the Rules file +# and Rakefile.rb all have access to the methods of this +# module module Utils require "test-cmd" require_relative "utils/t" @@ -78,4 +79,4 @@ module Utils include ERB include OpenGraph end -use_helper Utils +use_helper(Utils) if respond_to?(:use_helper) diff --git a/rake/tasks/t.rake b/rake/tasks/t.rake index a1f21dd89..0e2324390 100644 --- a/rake/tasks/t.rake +++ b/rake/tasks/t.rake @@ -1,7 +1,7 @@ # frozen_string_literal: true namespace :t do - jsondir = File.join(Dir.getwd, "src", "json") + jsondir = File.join(dirs.content, "json") desc "Generate /json///info.json from surahs.json" task :"surahs.json" do require "json"