include Utils in Rakefile.rb

This commit is contained in:
0x1eef 2024-06-21 23:55:16 -03:00
parent b60cc0a075
commit c0c3d7b8ec
3 changed files with 7 additions and 5 deletions

View file

@ -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"

View file

@ -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)

View file

@ -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/<locale>/<surahid>/info.json from surahs.json"
task :"surahs.json" do
require "json"