Sha256: 909c8156a654bc65bee920937f36c7de175eadfd793dcbb5734dd5021866ff8c
Contents?: true
Size: 767 Bytes
Versions: 2
Compression:
Stored size: 767 Bytes
Contents
require 'tap/env' module Tap::Generator::Generators # :startdoc::generator a task and test # # Generates a new Tap::Task and an associated test file. class Task < Tap::Generator::Base config :test, true, &c.switch # Specifies creation of a test file def manifest(m, const_name) const = Tap::Env::Constant.new(const_name.camelize) task_path = path('lib', "#{const.path}.rb") m.directory File.dirname(task_path) m.template task_path, "task.erb", :const => const if test test_path = path('test', "#{const.path}_test.rb") m.directory File.dirname(test_path) m.template test_path, "test.erb", :const => const end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
tap-gen-0.1.3 | lib/tap/generator/generators/task.rb |
tap-gen-0.1.2 | lib/tap/generator/generators/task.rb |