Sha256: bddff256bfe7410e924c72226bd4f191f643b857245759b8af6749930e8cd64b
Contents?: true
Size: 1.22 KB
Versions: 15
Compression:
Stored size: 1.22 KB
Contents
require "dry/web/roda/generate" require "dry/web/roda/generators/inflections" module Dry module Web module Roda module Generators class AbstractGenerator attr_reader :target_dir, :options def initialize(target_dir, options = {}) @target_dir = target_dir @options = options @templates = [] populate_templates @templates.freeze end def call templates.each do |source, target| generator.(source, target) end post_process_callback end private attr_reader :templates def add_template(source, target) templates << [source, target] end def generator @generator ||= Generate.new(destination, template_scope) end def post_process_callback; end def underscored_project_name @underscored_project_name ||= Inflections.underscored_name(target_dir) end def template_scope fail NotImplementedError end def destination fail NotImplementedError end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems