Skip to content

Instantly share code, notes, and snippets.

@matehat
Created March 31, 2010 02:04
Show Gist options
  • Save matehat/349843 to your computer and use it in GitHub Desktop.
Save matehat/349843 to your computer and use it in GitHub Desktop.
cache: (file) ->
@test file, =>
file.group: @name
@getPreparedContent file, =>
@resolveDependencies file, =>
@emit "resolvedDependencies", file
@backend.set file, (err) =>
sys.puts "Could not cache file $file.path" if err
@emit "cachedFile", file
cache: (file) ->
defer @test file
file.group: @name
defer @getPreparedContent file
defer @resolveDependencies file
@emit "resolvedDependencies", file
err: defer @backend.set file
sys.puts "Could not cache file $file.path" if err
@emit "cachedFile", file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment