Sha256: ebcbc2819f3b129a3cbc2c6afee93b443052049c6c7e5b0aec16828027cdca5d

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gwt-run-0.1.0 lib/rack/gwt/static.rb~