Class: MxxRu::Generators::BinaryUnittest::TemplateParams
- Inherits:
-
Object
- Object
- MxxRu::Generators::BinaryUnittest::TemplateParams
- Defined in:
- lib/mxx_ru/generators/bin-unittest/g.rb
Overview
Class to be used in ERb template generation.
Usage:
template_params = TemplateParams.new( target_type, )
template = ERb.new( IO.read( some_template_file ) )
result = template.generate( template.get_binding )
Constant Summary collapse
- YOUR_PROJECT_PATH =
For a case when project_path is undetectable.
'your project path'
- DEFAULT_UNITTEST_PROJECT =
For a case when output_file is undetectable.
'prj.ut.rb'
Instance Attribute Summary collapse
-
#path_name ⇒ Object
readonly
Path name.
-
#unittest_project ⇒ Object
readonly
Name of unit test project file.
Instance Method Summary collapse
-
#get_binding ⇒ Object
Returns binding to use in ERb generation.
-
#initialize(options) ⇒ TemplateParams
constructor
Param target_type must be present in @@setup_target_functions.
Constructor Details
#initialize(options) ⇒ TemplateParams
Param target_type must be present in @@setup_target_functions.
103 104 105 106 |
# File 'lib/mxx_ru/generators/bin-unittest/g.rb', line 103 def initialize( ) @path_name = try_detect_path_name( ) @unittest_project = try_detect_unittest_project( ) end |
Instance Attribute Details
#path_name ⇒ Object (readonly)
Path name.
98 99 100 |
# File 'lib/mxx_ru/generators/bin-unittest/g.rb', line 98 def path_name @path_name end |
#unittest_project ⇒ Object (readonly)
Name of unit test project file.
100 101 102 |
# File 'lib/mxx_ru/generators/bin-unittest/g.rb', line 100 def unittest_project @unittest_project end |
Instance Method Details
#get_binding ⇒ Object
Returns binding to use in ERb generation.
109 110 111 |
# File 'lib/mxx_ru/generators/bin-unittest/g.rb', line 109 def get_binding binding end |