Class: BaseGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/base_generator.rb

Overview

Base class for all generators to come. If you want to override some behaviour, all you got to do is override a method in the child class.

Instance Method Summary collapse

Instance Method Details

#copy_pattern_fileObject

Creates the file for the requested pattern based on a template file.



11
12
13
# File 'lib/generators/base_generator.rb', line 11

def copy_pattern_file
  template "#{pattern_name}.rb", generated_file_path
end

#copy_pattern_test_fileObject

Creates the test file for the request pattern based on a template file.



16
17
18
# File 'lib/generators/base_generator.rb', line 16

def copy_pattern_test_file
  template "#{pattern_name}_#{test_suite_identifier}.rb", generated_test_file_path
end