Sha256: 6223a58f6bfd9259fb878e512339c1b8afea5a5b9824665f24e2e86e47a24dd8

Contents?: true

Size: 591 Bytes

Versions: 3

Compression:

Stored size: 591 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)
  Rack::Server.start(options.merge(:config => 'config.ru'))
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rbbt-util-5.5.2 share/rbbt_commands/app/start
rbbt-util-5.5.0 share/rbbt_commands/app/start
rbbt-util-5.4.1 share/rbbt_commands/app/start