Sha256: dbb60ce304554db4166cd8568672ea2179da7ab84a5f5230d410af0a5eb797e3

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

# encoding: UTF-8

## Set environment, working directory, load gems and create logs
ENV['ENV'] ||= ENV['RACK_ENV'] # production ENV will render SASS as compressed.
## Using pathname extentions for setting public folder
require 'pathname'
## Set up root object, it might be used by the environment and\or the plezi extension gems.
Root ||= Pathname.new(File.dirname(__FILE__)).expand_path
## If this app is independant, use bundler to load gems (including the plezi gem).
## otherwise, use the original app's Gemfile and Plezi will automatically switch to Rack mode.
require 'bundler'
Bundler.require(:default, ENV['ENV'].to_s.to_sym)

# Load all the code from a subfolder called 'app'
Dir[File.join '{app}', '**', '*.rb'].each { |file| load File.expand_path(file) }

## Logging
Iodine::Rack.log = 1 if Iodine::Rack.log.nil?

# # Optional Scaling (across processes or machines):
ENV['PL_REDIS_URL'] ||= ENV['REDIS_URL'] ||
                        ENV['REDISCLOUD_URL'] ||
                        ENV['REDISTOGO_URL'] ||
                        nil # "redis://:password@my.host:6389/0"
# # redis channel name should be changed IF using the same Plezi code within
# # more then one application (i.e., using both Rails and Plezi together).
# Plezi.app_name = 'appsecret'

# Map the views folder to the template root (for the {#render} function).
Plezi.templates = Root.join('views').to_s

# load routes.
load Root.join('routes.rb').to_s

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
plezi-0.14.4 resources/mini_app.rb
plezi-0.14.3 resources/mini_app.rb
plezi-0.14.2 resources/mini_app.rb
plezi-0.14.1 resources/mini_app.rb
plezi-0.14.0 resources/mini_app.rb