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

- (SwfTask) initialize(*args)

: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

- (Object) src_swf

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

- (Object) target_swf

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

- (Boolean) needed?

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