# File lib/merb-assets/assets.rb, line 181 def bundle! # TODO: push it out to the helper level so we don't have to create the helper object. unless self.class.cached_bundle?(@bundle_name) # skip regeneration of new bundled files - preventing multiple merb apps stepping on eachother # file needs to be older than 60 seconds to be regenerated if File.exist?(@bundle_filename) && File.mtime(@bundle_filename) >= Time.now - 60 return @bundle_name # serve the old file for now - to be regenerated later end bundle_files(@bundle_filename, *@files) if File.exist?(@bundle_filename) self.class.callbacks.each { |c| c.call(@bundle_filename) } Merb.logger.info("Assets: bundled :#{@bundle_name} into #{File.basename(@bundle_filename)}") self.class.cache_bundle(@bundle_name) end end return @bundle_name end