Module: Lotus::Generators::Generatable
- Included in:
- Commands::Generate::Abstract, Commands::New::Abstract
- Defined in:
- lib/lotus/generators/generatable.rb
Overview
Instance Method Summary collapse
- #add_mapping(source, target) ⇒ Object
- #destroy ⇒ Object
- #generator ⇒ Object
- #map_templates ⇒ Object
- #post_process_templates ⇒ Object
- #process_templates ⇒ Object
- #start ⇒ Object
- #target_path ⇒ Object
- #template_options ⇒ Object
- #template_source_path ⇒ Object
Instance Method Details
#add_mapping(source, target) ⇒ Object
25 26 27 |
# File 'lib/lotus/generators/generatable.rb', line 25 def add_mapping(source, target) generator.add_mapping(source, target) end |
#destroy ⇒ Object
12 13 14 15 |
# File 'lib/lotus/generators/generatable.rb', line 12 def destroy generator.behavior = :revoke self end |
#generator ⇒ Object
17 18 19 |
# File 'lib/lotus/generators/generatable.rb', line 17 def generator @generator ||= Lotus::Generators::Generator.new(template_source_path, target_path) end |
#map_templates ⇒ Object
21 22 23 |
# File 'lib/lotus/generators/generatable.rb', line 21 def map_templates raise NotImplementedError, "must implement the map_templates method" end |
#post_process_templates ⇒ Object
34 35 36 |
# File 'lib/lotus/generators/generatable.rb', line 34 def post_process_templates nil end |
#process_templates ⇒ Object
29 30 31 32 |
# File 'lib/lotus/generators/generatable.rb', line 29 def process_templates generator.process_templates() post_process_templates end |
#start ⇒ Object
7 8 9 10 |
# File 'lib/lotus/generators/generatable.rb', line 7 def start map_templates process_templates end |
#target_path ⇒ Object
46 47 48 |
# File 'lib/lotus/generators/generatable.rb', line 46 def target_path raise NotImplementedError, "must implement the target_path method" end |
#template_options ⇒ Object
38 39 40 |
# File 'lib/lotus/generators/generatable.rb', line 38 def {} end |
#template_source_path ⇒ Object
42 43 44 |
# File 'lib/lotus/generators/generatable.rb', line 42 def template_source_path raise NotImplementedError, "must implement the template_source_path method" end |