module Tap::Generator::Generators class FileTaskGenerator < Rails::Generator::NamedBase # :nodoc: def initialize(*args) super(*args) @destination_root = Tap::App.instance[:root] @app = Tap::App.instance end def manifest record do |m| lib_path = @app.relative_filepath(:root, @app[:lib]) m.directory File.join(lib_path, class_path) m.template "task.erb", File.join(lib_path, class_name.underscore + ".rb") test_path = @app.relative_filepath(:root, @app[:test]) m.directory File.join(test_path, class_path) m.template "test.erb", File.join(test_path, class_name.underscore + "_test.rb") end end end end