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.48 share/rbbt_commands/app/start
rbbt-util-5.5.47 share/rbbt_commands/app/start
rbbt-util-5.5.46 share/rbbt_commands/app/start
rbbt-util-5.5.45 share/rbbt_commands/app/start
rbbt-util-5.5.44 share/rbbt_commands/app/start
rbbt-util-5.5.43 share/rbbt_commands/app/start
rbbt-util-5.5.42 share/rbbt_commands/app/start
rbbt-util-5.5.41 share/rbbt_commands/app/start
rbbt-util-5.5.40 share/rbbt_commands/app/start
rbbt-util-5.5.39 share/rbbt_commands/app/start
rbbt-util-5.5.38 share/rbbt_commands/app/start
rbbt-util-5.5.37 share/rbbt_commands/app/start
rbbt-util-5.5.36 share/rbbt_commands/app/start
rbbt-util-5.5.35 share/rbbt_commands/app/start
rbbt-util-5.5.34 share/rbbt_commands/app/start
rbbt-util-5.5.33 share/rbbt_commands/app/start
rbbt-util-5.5.32 share/rbbt_commands/app/start
rbbt-util-5.5.31 share/rbbt_commands/app/start
rbbt-util-5.5.30 share/rbbt_commands/app/start
rbbt-util-5.5.29 share/rbbt_commands/app/start