Class: MxxRu::Generators::CppBuildRoot::TemplateParams

Inherits:
Object
  • Object
show all
Defined in:
lib/mxx_ru/generators/cpp-build-root/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

DEFAULT_BUILD_ROOT =

For a case when output_file is undetectable.

'build.rb'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ TemplateParams

Param target_type must be present in @@setup_target_functions.



93
94
95
# File 'lib/mxx_ru/generators/cpp-build-root/g.rb', line 93

def initialize( options )
  @build_root_project = try_detect_build_root_project( options )
end

Instance Attribute Details

#build_root_projectObject (readonly)

Name of build root file.



90
91
92
# File 'lib/mxx_ru/generators/cpp-build-root/g.rb', line 90

def build_root_project
  @build_root_project
end

Instance Method Details

#get_bindingObject

Returns binding to use in ERb generation.



98
99
100
# File 'lib/mxx_ru/generators/cpp-build-root/g.rb', line 98

def get_binding
  binding
end