require "zeitwerk" loader = Zeitwerk::Loader.for_gem loader.setup module Rsg def self.app_templates_sources @app_templates_sources ||= [ Pathname.new(__FILE__).dirname.join("../templates").expand_path ] end def self.lookup_app_template(template_name) return if template_name =~ %r{^https?\://} return if File.exists?(template_name) app_templates_sources.each do |src| template = "#{src}/#{template_name}.rb" return template if File.exists?(template) end return nil end end # Required, or the classes for the generators won't be defined loader.eager_load