class Rake::Delphi::RCTemplateTask

Public Class Methods

new(name, app) click to toggle source
Calls superclass method Rake::Task::new
# File lib/rake/delphi/resources.rb, line 76
def initialize(name, app)
    super
    @output = nil
    @template_file = File.expand_path('../../templates/project.erb', __FILE__)
    @template_obj = RCTemplate.new(self)
end

Public Instance Methods

[]=(key, value) click to toggle source
# File lib/rake/delphi/resources.rb, line 87
def []=(key, value)
    @template_obj[key] = value
end
execute(args=nil) click to toggle source
Calls superclass method Rake::Task#execute
# File lib/rake/delphi/resources.rb, line 91
def execute(args=nil)
    super
    erb = ERB.new(IO.read(@template_file))
    text = erb.result(@template_obj.get_binding)
    File.open(@output, 'w') do |f|
        f.write(text)
    end
end
output=(value) click to toggle source
# File lib/rake/delphi/resources.rb, line 83
def output=(value)
    @output = value.pathmap('%X.rc')
end