Sha256: 3bb301d74fe63ec2ec49012242ff4e4eb185a73feb4965723b25330ce2077bce
Contents?: true
Size: 1.07 KB
Versions: 14
Compression:
Stored size: 1.07 KB
Contents
# frozen_string_literal: true require 'eac_ruby_utils/core_ext' require 'eac_ruby_utils/fs/clearable_directory' module EhbrsRubyUtils module CookingBook class Build require_sub __FILE__ enable_simple_cache enable_listable lists.add_symbol :option, :target_dir common_constructor :project, :options, default: [{}] do self.options = self.class.lists.option.hash_keys_validate!(options.symbolize_keys) end def run target_dir.clear index_page.build recipes_pages.each(&:build) end private def index_page_uncached ::EhbrsRubyUtils::CookingBook::Build::IndexPage.new(self) end def recipes_pages_uncached project.recipes.map do |recipe| ::EhbrsRubyUtils::CookingBook::Build::RecipePage.new(self, recipe) end end def target_dir_uncached ::EacRubyUtils::Fs::ClearableDirectory.new(options[OPTION_TARGET_DIR] || default_target_dir) end def default_target_dir project.root.join('dist') end end end end
Version data entries
14 entries across 14 versions & 1 rubygems