Class: Ritsu::SrcFiles::ProjectCmakeLists::ExternalLibrariesTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/ritsu/src_files/project_cmake_lists.rb

Instance Attribute Summary

Attributes included from BlockMixin

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

Instance Method Summary collapse

Methods inherited from Template

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

Methods included from BlockMixin

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

Constructor Details

#initialize(project) ⇒ ExternalLibrariesTemplate

Returns a new instance of ExternalLibrariesTemplate.



53
54
55
56
# File 'lib/ritsu/src_files/project_cmake_lists.rb', line 53

def initialize(project)
  super("ProjectCmakeLists -- External Libraries")
  @project = project
end

Instance Method Details

#update_block(block, options = {}) ⇒ Object



58
59
60
61
62
63
64
65
# File 'lib/ritsu/src_files/project_cmake_lists.rb', line 58

def update_block(block, options={})
  block.contents.clear
  external_libraries = @project.external_libraries.to_a
  external_libraries.sort! {|x,y| x.name <=> y.name}
  external_libraries.each do |external_library|
    block.contents << external_library.cmake_find_script
  end        
end