Class: MxxRu::Generators::ExtCMakeProject::TemplateParams

Inherits:
Object
  • Object
show all
Defined in:
lib/mxx_ru/generators/ext-cmake-prj/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

UNKNOWN_CMAKELISTS_LOCATION =

For a case when project_path is undetectable.

'subfolder with CMakeLists.txt'
DEFAULT_PROJECT_NAME =

For a case when output_file is undetectable.

'prj.rb'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ TemplateParams

Param target_type must be present in @@setup_target_functions.



101
102
103
104
# File 'lib/mxx_ru/generators/ext-cmake-prj/g.rb', line 101

def initialize( options )
  @where = try_detect_where( options )
  @project = try_detect_project( options )
end

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project.



98
99
100
# File 'lib/mxx_ru/generators/ext-cmake-prj/g.rb', line 98

def project
  @project
end

#whereObject (readonly)

Returns the value of attribute where.



97
98
99
# File 'lib/mxx_ru/generators/ext-cmake-prj/g.rb', line 97

def where
  @where
end

Instance Method Details

#get_bindingObject

Returns binding to use in ERb generation.



107
108
109
# File 'lib/mxx_ru/generators/ext-cmake-prj/g.rb', line 107

def get_binding
  binding
end