reusable_text_file_name = 'reusable_text.md' includer_file_name = 'includer.md' included_file_name = 'included.md' template_file_name = 'template.md' use_case_file_name = 'use_case.md' include_command = "ruby ../../../bin/include --pristine #{includer_file_name} #{included_file_name}" build_command = "ruby ../../../bin/include --pristine #{template_file_name} #{use_case_file_name}" template = < template, reusable_text_file_name => reusable_text, includer_file_name => includer, }.each_pair do |file_name, text| File.write(file_name, text) end # Perform the inclusion. system(include_command) # Build the use case. system(build_command)