require 'rack/static' module Rack module Gwt class Static < Rack::Static def initialize( app, *gwt_modules ) pathes = gwt_modules.collect { |g| "/#{g}" } super( app, :urls => pathes + [ '/index.html' ], :root => 'public', :index => 'index.html', :header_rules => [ [ /\.css/, { 'Content-Type' => 'application/css' } ], [ /\.js/, { 'Content-Type' => 'application/js' } ], [ /\.cache\./, { 'Expires' => (Time.now + 365).rfc2822 } ], [ /\.nocache\./, { 'Expires' => Time.new( 1970 ).rfc2822, 'Cache-Control' => 'public, max-age=0, must-revalidate' } ] ] ) end end end end