Class: Ritsu::SrcFiles::ProjectConfigHeaderTemplateFile::Template

Inherits:
Template
  • Object
show all
Includes:
TemplatePolicies::DoNotUpdate
Defined in:
lib/ritsu/src_files/project_config_header_template_file.rb

Instance Attribute Summary collapse

Attributes included from BlockMixin

#contents, #id, #indent_length, #indent_level, #local_indentation

Instance Method Summary collapse

Methods included from TemplatePolicies::DoNotUpdate

#update_block

Methods inherited from Template

#add_content, #add_template, #child_template_with_id, #child_template_with_id_position, #child_templates, #create_block, #update_block

Methods included from BlockMixin

#add_line, #add_new_line, #block_structure?, #clear_contents, #indent, #initialize_block_mixin, #outdent

Constructor Details

#initialize(src_file) ⇒ Template

Returns a new instance of Template.



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ritsu/src_files/project_config_header_template_file.rb', line 16

def initialize(src_file)
  @src_file = src_file
  super("ProjectConfigHeaderTemplateFile -- #{project.name}")
  
  add_line "#ifndef __#{project.name.underscore.upcase}_CONFIG_H__"
  add_line "#define __#{project.name.underscore.upcase}_CONFIG_H__"
  add_new_line
  add_line "#cmakedefine __WIN_PLATFORM__"
  add_line "#cmakedefine __MAC_PLATFORM__"
  add_line "#cmakedefine __UNIX_PLATFORM__"
  add_new_line
  add_line "#endif"
end

Instance Attribute Details

#src_fileObject (readonly)

Returns the value of attribute src_file.



14
15
16
# File 'lib/ritsu/src_files/project_config_header_template_file.rb', line 14

def src_file
  @src_file
end

Instance Method Details

#projectObject



30
31
32
# File 'lib/ritsu/src_files/project_config_header_template_file.rb', line 30

def project
  src_file.project
end