Class: MxxRu::Generators::BinaryUnittest::TemplateParams

Inherits:
Object
  • Object
show all
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, options )
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

Instance Method Summary collapse

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( options )
  @path_name = try_detect_path_name( options )
  @unittest_project = try_detect_unittest_project( options )
end

Instance Attribute Details

#path_nameObject (readonly)

Path name.



98
99
100
# File 'lib/mxx_ru/generators/bin-unittest/g.rb', line 98

def path_name
  @path_name
end

#unittest_projectObject (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_bindingObject

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