class MxxRu::Generators::CppBuildRoot::TemplateParams

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 )

Constants

DEFAULT_BUILD_ROOT

For a case when output_file is undetectable.

Attributes

build_root_project[R]

Name of build root file.

Public Class Methods

new( options ) click to toggle source

Param target_type must be present in @@setup_target_functions.

# 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

Public Instance Methods

get_binding() click to toggle source

Returns binding to use in ERb generation.

# File lib/mxx_ru/generators/cpp-build-root/g.rb, line 98
def get_binding
  binding
end

Private Instance Methods

try_detect_build_root_project( options ) click to toggle source

Try to setup name of build root project file.

If –output-file specified then its value used. Otherwise value 'build.rb' is used.

# File lib/mxx_ru/generators/cpp-build-root/g.rb, line 108
def try_detect_build_root_project( options )
  options.output_file ?
      File.basename( options.output_file ) :
      DEFAULT_BUILD_ROOT
end