Class: Rake::Delphi::RCTask

Inherits:
Task
  • Object
show all
Defined in:
lib/rake/delphi/resources.rb

Instance Attribute Summary collapse

Attributes inherited from Task

#logger

Instance Method Summary collapse

Methods inherited from Task

#execute_base, #initialize_base, #out, #shortname, #trace?

Constructor Details

#initialize(name, app) ⇒ RCTask

Returns a new instance of RCTask.



97
98
99
100
101
# File 'lib/rake/delphi/resources.rb', line 97

def initialize(name, app)
    super
    @output = nil
    @is_rc = false
end

Instance Attribute Details

#inputObject

Returns the value of attribute input.



96
97
98
# File 'lib/rake/delphi/resources.rb', line 96

def input
  @input
end

#outputObject

Returns the value of attribute output.



96
97
98
# File 'lib/rake/delphi/resources.rb', line 96

def output
  @output
end

Instance Method Details

#execute(args = nil) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/rake/delphi/resources.rb', line 112

def execute(args=nil)
    v, path, tool = RCResourceCompiler.find(true)
    a = []
    a << '/dRC' if @is_rc
    a |= ['/fo', Rake.quotepath('', output), '/r', Rake.quotepath('', input) ]
    opts = { :args => a }
    opts.merge!(args)
    cmd = ([Rake.quotepath('', tool)] | opts[:args]).join(' ')
    RakeFileUtils.verbose(trace?) do
        sh cmd
    end
end

#is_rc=(value) ⇒ Object



108
109
110
# File 'lib/rake/delphi/resources.rb', line 108

def is_rc=(value)
    @is_rc = ! value.to_s.empty?
end