Sha256: 4848800b5ba27a8dc05192530cd6b12365f5052eac1e887b525d000a3a768418

Contents?: true

Size: 716 Bytes

Versions: 46

Compression:

Stored size: 716 Bytes

Contents

#!/usr/bin/env ruby

require 'rbbt-util'
require 'rbbt/util/simpleopt'

options = SOPT.get "-e--environment*:-p--port*:-s--server*:-f--finder"
options[:Port] ||= options[:port]

app = ARGV.shift

app_dir = Rbbt.etc.app_dir.exists? ? Path.setup(Rbbt.etc.app_dir.read.strip) : Rbbt.apps.find

app_dir = app_dir[app]

server = options[:server] || 'thin'
Misc.in_dir(app_dir) do
  require 'rack'
  ENV["RBBT_FINDER"] = "true" if options.include?(:finder)
  ENV["RACK_ENV"] = options[:environment] if options.include?(:environment)

  if File.exists? 'config.ru'
    Rack::Server.start(options.merge(:config => 'config.ru'))
  else
    Rack::Server.start(options.merge(:config => Rbbt.share['config.ru'].find))
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
rbbt-util-5.5.28 share/rbbt_commands/app/start
rbbt-util-5.5.27 share/rbbt_commands/app/start
rbbt-util-5.5.26 share/rbbt_commands/app/start
rbbt-util-5.5.25 share/rbbt_commands/app/start
rbbt-util-5.5.24 share/rbbt_commands/app/start
rbbt-util-5.5.23 share/rbbt_commands/app/start
rbbt-util-5.5.22 share/rbbt_commands/app/start
rbbt-util-5.5.21 share/rbbt_commands/app/start
rbbt-util-5.5.20 share/rbbt_commands/app/start
rbbt-util-5.5.19 share/rbbt_commands/app/start
rbbt-util-5.5.18 share/rbbt_commands/app/start
rbbt-util-5.5.17 share/rbbt_commands/app/start
rbbt-util-5.5.16 share/rbbt_commands/app/start
rbbt-util-5.5.15 share/rbbt_commands/app/start
rbbt-util-5.5.14 share/rbbt_commands/app/start
rbbt-util-5.5.13 share/rbbt_commands/app/start
rbbt-util-5.5.12 share/rbbt_commands/app/start
rbbt-util-5.5.11 share/rbbt_commands/app/start
rbbt-util-5.5.10 share/rbbt_commands/app/start
rbbt-util-5.5.9 share/rbbt_commands/app/start