lib/sinatra/assetpack/class_methods.rb in sinatra-assetpack-0.0.9 vs lib/sinatra/assetpack/class_methods.rb in sinatra-assetpack-0.0.10

- old
+ new

@@ -11,10 +11,15 @@ end def assets_initialize! add_compressed_routes! add_individual_routes! + + # Cache the built files. + if assets.prebuild && !reload_templates + assets.cache! { |file| $stderr.write "** Building #{file}...\n" } + end end # Add routes for the compressed versions def add_compressed_routes! assets.packages.each do |name, package| @@ -37,9 +42,11 @@ fmt = File.extname(file)[1..-1] # Sanity checks pass unless AssetPack.supported_formats.include?(fmt) fn = asset_path_for(file, from) or pass + + pass if settings.assets.ignored?("#{path}/#{file}") # Send headers content_type fmt.to_sym last_modified File.mtime(fn).to_i expires 86400*30, :public