Skip to content

Instantly share code, notes, and snippets.

@yachi
Created June 18, 2012 08:52
Show Gist options
  • Save yachi/2947542 to your computer and use it in GitHub Desktop.
Save yachi/2947542 to your computer and use it in GitHub Desktop.
sprokets compile debug
module Sprockets
class StaticCompiler
# def compile
# manifest = {}
# env.each_logical_path do |logical_path|
# next unless compile_path?(logical_path)
# if asset = env.find_asset(logical_path)
# manifest[logical_path] = write_asset(asset)
# end
# end
# write_manifest(manifest) if @manifest
# end
def compile
manifest = {}
env.each_logical_path do |logical_path|
time = Time.now
next unless compile_path?(logical_path)
if asset = env.find_asset(logical_path)
manifest[logical_path] = write_asset(asset)
end
time_used = Time.now - time
puts "#{logical_path} %.1f" % time_used if time_used > 1.0
end
write_manifest(manifest) if @manifest
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment