Skip to content

Instantly share code, notes, and snippets.

@devboy
Created April 14, 2011 12:20
Show Gist options
  • Save devboy/919357 to your computer and use it in GitHub Desktop.
Save devboy/919357 to your computer and use it in GitHub Desktop.
This should be the shortest way to discover if an as3/mxml project should be recompiled or not ;)
def needed?(sources, target, dependencies)
return true unless File.exist?(@project.get_as3_output)
Dir.glob(FileList[sources,dependencies].to_a.collect{ |file| file += "**/*" } ).
map{|file| File.stat(file).mtime}.max > File.stat(@project.get_as3_output).mtime
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment