Sha256: 11dd1ddc106245634aad49204098ebaa8a60121db2e7644de5b489cf64c7622f

Contents?: true

Size: 1.03 KB

Versions: 76

Compression:

Stored size: 1.03 KB

Contents

require 'rbbt'
require 'rbbt/resource'
$LOAD_PATH.unshift('lib') unless $LOAD_PATH.include?('lib')

def load_file(file)
  if file.exists?
    Log.info("Loading: " << file)
    load file
  end
end

def app_eval(app, file)
  if file.exists?
    app.class_eval do
      Log.info("Loading: " << file)
      eval file.read, nil, file
    end
  end
end

#{{{ INIT
load_file Rbbt.etc['app.d/init.rb'].find

$class_name = class_name = File.basename(FileUtils.pwd)
$app = app = eval "class #{class_name} < Sinatra::Base; self end"

#{{{ PRE
load_file Rbbt.etc['app.d/pre.rb'].find 

#{{{ BASE
app_eval app, Rbbt.etc['app.d/base.rb'].find

#{{{ RESOURCES
load_file Rbbt.etc['app.d/resources.rb'].find

#{{{ ENTITIES
load_file Rbbt.etc['app.d/entities.rb'].find

#{{{ ROUTES
app_eval app, Rbbt.etc['app.d/routes.rb'].find

#{{{ FINDER
app_eval app, Rbbt.etc['app.d/finder.rb'].find

#{{{ POST
load_file Rbbt.etc['app.d/post.rb'].find 

#{{{ PRELOAD
load_file Rbbt.etc['app.d/preload.rb'].find 

#{{{ RUN
$title = class_name
require 'rack'
use Rack::Deflater
run app

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
rbbt-util-5.14.1 share/config.ru
rbbt-util-5.14.0 share/config.ru
rbbt-util-5.13.37 share/config.ru
rbbt-util-5.13.36 share/config.ru
rbbt-util-5.13.35 share/config.ru
rbbt-util-5.13.34 share/config.ru
rbbt-util-5.13.33 share/config.ru
rbbt-util-5.13.32 share/config.ru
rbbt-util-5.13.31 share/config.ru
rbbt-util-5.13.30 share/config.ru
rbbt-util-5.13.29 share/config.ru
rbbt-util-5.13.28 share/config.ru
rbbt-util-5.13.27 share/config.ru
rbbt-util-5.13.26 share/config.ru
rbbt-util-5.13.25 share/config.ru
rbbt-util-5.13.24 share/config.ru
rbbt-util-5.13.23 share/config.ru
rbbt-util-5.13.22 share/config.ru
rbbt-util-5.13.21 share/config.ru
rbbt-util-5.13.20 share/config.ru