Class: Buildr::AS3::Packaging::SwfTask

Inherits:
Rake::FileTask
  • Object
show all
Includes:
Extension
Defined in:
lib/buildr/as3/packaging/swf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ SwfTask

:nodoc:



37
38
39
40
41
42
43
# File 'lib/buildr/as3/packaging/swf.rb', line 37

def initialize(*args) #:nodoc:
  super
  enhance do
    fail "File not found: #{src_swf}" unless File.exists? src_swf
    FileUtils.cp(src_swf, target_swf)
  end
end

Instance Attribute Details

#src_swfObject

Returns the value of attribute src_swf.



35
36
37
# File 'lib/buildr/as3/packaging/swf.rb', line 35

def src_swf
  @src_swf
end

#target_swfObject

Returns the value of attribute target_swf.



35
36
37
# File 'lib/buildr/as3/packaging/swf.rb', line 35

def target_swf
  @target_swf
end

Instance Method Details

#needed?Boolean

Returns:

  • (Boolean)


45
46
47
48
# File 'lib/buildr/as3/packaging/swf.rb', line 45

def needed?
  return true unless File.exists?(target_swf)
  File.stat(src_swf).mtime > File.stat(target_swf).mtime
end