Sha256: 3ace48b03a7f4eb955baa6e9ac07e05929a3d70017838c363863e0ab8f678f15

Contents?: true

Size: 722 Bytes

Versions: 4

Compression:

Stored size: 722 Bytes

Contents

## MYAPP.rb
## Simple example app of how to use the Sinatra::Cache plugin in a new 'Sub-Classed' Sinatra app 
## that inherits from Sinatra::Base

require "rubygems"
require "sinatra/base"
require 'sinatra/cache'

class MyApp < Sinatra::Base
  
  register Sinatra::Cache
  
  enable :logging
  enable :static
  
  set :public, "#{File.dirname(__FILE__)}/public"
  set :views, "#{File.dirname(__FILE__)}/views"
  
  get '/' do
    erb(:index)
  end
  
  get '/cache' do
    cache("Hello World from Sinatra Version=[#{Sinatra::VERSION}]")
  end
  
  # YES, I know this is NOT ideal, but it's only a test ;-)
  get '/cache_expire' do
    cache_expire("/cache")
  end
  
end

MyApp.run!(:port => 4568) if __FILE__ == $0

#/EOF

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
kematzy-sinatra-cache-0.2.1 test/fixtures/myapp.rb
kematzy-sinatra-cache-0.2.2 test/fixtures/myapp.rb
kschrader-sinatra-cache-0.2.3 test/fixtures/myapp.rb
sinatra-cache-0.2.3 test/fixtures/myapp.rb