Class: Schnitzelpress::App

Inherits:
Sinatra::Base
  • Object
show all
Includes:
Rack::Utils, Schnitzelpress::Actions::Admin, Schnitzelpress::Actions::Assets, Schnitzelpress::Actions::Auth, Schnitzelpress::Actions::Blog
Defined in:
lib/schnitzelpress/app.rb

Constant Summary collapse

STATIC_PATHS =
["/favicon.ico", "/img", "/js"]

Constants included from Schnitzelpress::Actions::Assets

Schnitzelpress::Actions::Assets::ASSET_TIMESTAMP, Schnitzelpress::Actions::Assets::JAVASCRIPT_ASSETS

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.with_local_filesObject



48
49
50
51
52
53
# File 'lib/schnitzelpress/app.rb', line 48

def self.with_local_files
  Rack::Cascade.new([
    Rack::StaticCache.new(self, :urls => STATIC_PATHS, :root => './public'),
    self
  ])
end

Instance Method Details

#fresh_when(options) ⇒ Object



39
40
41
42
# File 'lib/schnitzelpress/app.rb', line 39

def fresh_when(options)
  last_modified options[:last_modified]
  etag options[:etag]
end