Class: Tap::Generator::Generators::TaskGenerator
- Defined in:
- lib/tap/generator/generators/task/task_generator.rb
Overview
:startdoc: Tap::Generator::Generators::TaskGenerator::generator a task and test
Generates a new Tap::Task and an associated test file.
Direct Known Subclasses
Constant Summary
Constants inherited from Base
Constants inherited from Task
Instance Attribute Summary
Attributes inherited from Base
#file_task, #target_dir, #template_dir
Attributes inherited from Task
Attributes included from Support::Executable
#_method_name, #app, #batch, #dependencies, #on_complete_block
Attributes included from Support::Configurable
Instance Method Summary collapse
Methods inherited from Base
#directories, #directory, #file, #initialize, #iterate, lazydoc, #log_relative, #process, #template, #template_files
Methods inherited from Task
execute, help, inherited, #initialize, #initialize_batch_obj, #inspect, instance, intern, lazydoc, #log, parse, parse!, #process, #to_s
Methods included from Support::Executable
#_execute, #batch_index, #batch_with, #batched?, #check_terminate, #depends_on, #enq, #execute, #fork, initialize, #initialize_batch_obj, #inspect, #merge, #on_complete, #reset_dependencies, #resolve_dependencies, #sequence, #switch, #sync_merge, #unbatched_depends_on, #unbatched_enq, #unbatched_on_complete
Methods included from Support::Configurable
included, #initialize_copy, #reconfigure
Constructor Details
This class inherits a constructor from Tap::Generator::Base
Instance Method Details
#manifest(m, const_name) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/tap/generator/generators/task/task_generator.rb', line 10 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 end |