Class: Texas::Build::Task::RunMasterTemplate

Inherits:
Base
  • Object
show all
Defined in:
lib/texas/build/task/run_master_template.rb

Instance Attribute Summary

Attributes inherited from Base

#build

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Texas::Build::Task::Base

Instance Method Details

#find_master_template(possible_templates) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/texas/build/task/run_master_template.rb', line 6

def find_master_template(possible_templates)
  regexes = Template.handlers.keys
  valid_master_templates = possible_templates.select do |f| 
    regexes.any? { |regex| f =~ regex }
  end
  valid_master_templates.first
end

#runObject



14
15
16
17
18
# File 'lib/texas/build/task/run_master_template.rb', line 14

def run
  filename = find_master_template Dir[build.master_file+'*']
  master_template = Template.create(filename, build)
  master_template.write
end