class Sprockets::Concatenation
def initialize
def initialize @source_lines = [] @source_file_mtimes = {} end
def mtime
def mtime @source_file_mtimes.values.max end
def record(source_line)
def record(source_line) source_lines << source_line record_mtime_for(source_line.source_file) source_line end
def record_mtime_for(source_file)
def record_mtime_for(source_file) @source_file_mtimes[source_file] ||= source_file.mtime end
def save_to(filename)
def save_to(filename) timestamp = mtime File.open(filename, "w") { |file| file.write(to_s) } File.utime(timestamp, timestamp, filename) true end
def to_s
def to_s source_lines.join end