Module: Sinatra::Salli

Defined in:
lib/salli.rb,
lib/salli/helpers.rb

Defined Under Namespace

Modules: Helpers

Class Method Summary collapse

Class Method Details

.log(meth, key) ⇒ Object

Development logging



23
24
25
# File 'lib/salli.rb', line 23

def self.log(meth, key)
  puts (meth =~ /g/ ? 'Served: ' : 'Stored: ') << key
end

.registered(app) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/salli.rb', line 8

def self.registered(app)
  app.helpers Salli::Helpers
  # Default server
  app.set :cache_server, 'localhost:11211'
  # Cache on/off
  app.set :cache, true
  # Expiration (seconds)
  app.set :cache_expires, 600
  # Cache logging (development)
  app.set :cache_logging, true
  # Default cache environment
  app.set :cache_environment, :development
end