Sha256: 92d816b47b392f8f7a42679da6bb338360e025c052ae34c45362de9756868f7a
Contents?: true
Size: 781 Bytes
Versions: 10
Compression:
Stored size: 781 Bytes
Contents
module Tap::Generator::Generators # :startdoc::generator a task and test # # Generates a new Tap::Task and an associated test file. class TaskGenerator < Tap::Generator::Base config :test, true, &c.switch # Generates the task without test files. def manifest(m, const_name) const = Constant.new(const_name.camelize) task_path = app.filepath('lib', "#{const.path}.rb") m.directory File.dirname(task_path) m.template task_path, "task.erb", :const => const if test test_path = app.filepath('test', "#{const.path}_test.rb") m.directory File.dirname(test_path) m.template test_path, "test.erb", :const => const end const end end end
Version data entries
10 entries across 10 versions & 2 rubygems