Sha256: 3bf590e60bf4022e9ae2780ad9036f5800b213cc9dc906ea06800b5fb1b7a21c

Contents?: true

Size: 1.64 KB

Versions: 23

Compression:

Stored size: 1.64 KB

Contents

#!/usr/bin/env ruby

require 'rbbt/util/simpleopt'
require 'rbbt/workflow'

require 'zurb-foundation'
require 'modular-scale'

require 'rbbt/rest/main'
require 'rbbt/rest/entity'
require 'rbbt/rest/workflow'
require 'rbbt/rest/file_server'
require 'rbbt/rest/knowledge_base'
require 'rbbt/rest/helpers'
require 'rbbt/rest/web_tool'

options = SOPT.get "-e--environment*:-p--port*:-s--server*:-b--bind*:-e--environment*:-R--RServe_session*:--finder:--views*:-w--workflows*"

template = ARGV.first

template = template.sub('.haml','')

ENV["RBBT_FINDER"] = "true" if options.include?(:finder)
ENV["RServe-session"] = options[:RServe_session] 

raise rbbt_usage unless template

$title = File.basename(template)

load Rbbt.etc['app.d/init.rb'].find

app = class SingleTemplate < Sinatra::Base; self end

if options[:workflows]
  app.register Sinatra::RbbtRESTWorkflow
  options[:workflows].split(/[\s,]+/).each do |name|
    wf = Workflow.require_workflow name
    app.add_workflow wf, :all
  end
end

app.register Sinatra::RbbtRESTKnowledgeBase

app.helpers Sinatra::RbbtMiscHelpers
app.helpers Sinatra::RbbtToolHelper

app.get '/' do
  template_render(template, @clean_params)
end
app.instance_eval Rbbt.etc['app.d/base.rb'].read
app.use Rack::Deflater

load Rbbt.etc['app.d/resources.rb'].find

app.class_eval do
  eval Rbbt.etc['app.d/finder.rb'].read
end

Sinatra::RbbtRESTMain.add_resource_path(Path.setup('/home/mvazquezg/'), true)


SingleTemplate.port = options[:port] || 4567
SingleTemplate.bind = options[:bind] || "0.0.0.0"
SingleTemplate.environment = options[:environment] || "development"
SingleTemplate.server = options[:server] if options[:server]
SingleTemplate.run!

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rbbt-util-5.17.23 share/rbbt_commands/app/template
rbbt-util-5.17.22 share/rbbt_commands/app/template
rbbt-util-5.17.21 share/rbbt_commands/app/template
rbbt-util-5.17.20 share/rbbt_commands/app/template
rbbt-util-5.17.19 share/rbbt_commands/app/template
rbbt-util-5.17.18 share/rbbt_commands/app/template
rbbt-util-5.17.17 share/rbbt_commands/app/template
rbbt-util-5.17.16 share/rbbt_commands/app/template
rbbt-util-5.17.15 share/rbbt_commands/app/template
rbbt-util-5.17.14 share/rbbt_commands/app/template
rbbt-util-5.17.13 share/rbbt_commands/app/template
rbbt-util-5.17.12 share/rbbt_commands/app/template
rbbt-util-5.17.11 share/rbbt_commands/app/template
rbbt-util-5.17.10 share/rbbt_commands/app/template
rbbt-util-5.17.9 share/rbbt_commands/app/template
rbbt-util-5.17.7 share/rbbt_commands/app/template
rbbt-util-5.17.6 share/rbbt_commands/app/template
rbbt-util-5.17.5 share/rbbt_commands/app/template
rbbt-util-5.17.4 share/rbbt_commands/app/template
rbbt-util-5.17.3 share/rbbt_commands/app/template