Class: Workarea::DecoratorGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Workarea::DecoratorGenerator
- Defined in:
- lib/generators/workarea/decorator/decorator_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_related_test_file ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/workarea/decorator/decorator_generator.rb', line 19 def return if original_test_path = find_existing_file(test_path) if original_test_path.present? template 'test_decorator.rb.erb', test_path.sub(rb_regex, '.decorator') else warn "No tests found for #{decorator_path}" end end |
#generate_decorator_file ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/generators/workarea/decorator/decorator_generator.rb', line 9 def generate_decorator_file original_path = find_existing_file(path) if original_path.present? template decorator_template, decorator_path else warn "No file found at #{path}" end end |