Class: MxxRu::Generators::ExtCMakeProject::TemplateParams
- Inherits:
-
Object
- Object
- MxxRu::Generators::ExtCMakeProject::TemplateParams
- 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, )
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
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#where ⇒ Object
readonly
Returns the value of attribute where.
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.
101 102 103 104 |
# File 'lib/mxx_ru/generators/ext-cmake-prj/g.rb', line 101 def initialize( ) @where = try_detect_where( ) @project = try_detect_project( ) end |
Instance Attribute Details
#project ⇒ Object (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 |
#where ⇒ Object (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_binding ⇒ Object
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 |