require_relative '../use_case' class CreatePageTocUseCase < UseCase attr_accessor :use_case_dir_name TEMPLATE_FILE_NAME = 'use_case_template.md' TEXT_FILE_NAME = 'text.md' TOC_FILE_NAME = 'toc.md' INCLUDER_FILE_NAME = 'includer.md' PAGE_FILE_NAME = 'page.md' RUBY_FILE_NAME = 'include.rb' BUILD_COMMAND = UseCase.construct_include_command(TEMPLATE_FILE_NAME, USE_CASE_FILE_NAME, pristine = true) def initialize(use_case_dir_name) super commands_to_execute.push(RUBY_COMMAND) if File.exist?(RUBY_FILE_NAME) commands_to_execute.push(BUILD_COMMAND) if File.exist?(TEMPLATE_FILE_NAME) self.use_case_dir_name = use_case_dir_name end def use_case_dir_path File.join(File.absolute_path(File.dirname(__FILE__)), use_case_dir_name) end def write_includer_file File.write( INCLUDER_FILE_NAME, <