Sha256: db44618cde88dcb78436549b10a2d732f8a0f7dc2ef076bb828330c322d2396e
Contents?: true
Size: 929 Bytes
Versions: 6
Compression:
Stored size: 929 Bytes
Contents
require "kanji/generate" require "dry/core/inflector" module Kanji module Generators class AbstractGenerator def initialize(target_dir) @target_dir = target_dir @templates = [] populate_templates @templates.freeze end def call templates.each do |source, target| generator.(source, target) end post_process_callback end private attr_reader :target_dir, :templates def populate_templates fail NotImplementedError end def post_process_callback end def add_template(source, target) templates << [source, target] end def generator @generator ||= Generate.new(destination, template_scope) end def destination fail NotImplementedError end def template_scope fail NotImplementedError end end end end
Version data entries
6 entries across 6 versions & 1 rubygems