require "pathname" require "rails/generators" module Rsg module Generators class Base < Rails::Generators::Base include Actions include Options def self.inherited(base) super parts = base.namespace.split(":") return unless parts[0] == "rsg" parts = parts[1..-2] + ["templates"] templates_path = Pathname.new(__FILE__).dirname.join(*parts).expand_path base.source_paths << templates_path if templates_path.exist? end def self.exit_on_failure? true end end end end