require 'generators/my_scaffold_generator' module MySpec module Generators class HelperGenerator < Rails::Generators::NamedBase include MyGenerators::Generators::MyScaffoldGenerator def generate_helper_spec return unless options[:helper_specs] template 'helper_spec.rb', File.join('spec/helpers', class_path, "#{file_name}_helper_spec.rb") end def self.source_root @source_root ||= File.expand_path("templates", File.dirname(__FILE__)) end end end end