Sha256: fa0f94d297b0d20b299d734d34cd7bd07d5e1e515a554ced2fca9bcd4a036797

Contents?: true

Size: 829 Bytes

Versions: 123

Compression:

Stored size: 829 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] || 'puma'
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)

  config_ru_file = File.exists?('config.ru') ? 'config.ru' : Rbbt.share['config.ru'].find

  if server == 'unicorn'
    `unicorn -c #{ Rbbt.share['unicorn.rb'].find } '#{config_ru_file}' -p #{options[:port] || "2887"}`
  else
    Rack::Server.start(options.merge(:config => config_ru_file))
  end
end

Version data entries

123 entries across 123 versions & 1 rubygems

Version Path
rbbt-util-5.13.11 share/rbbt_commands/app/start
rbbt-util-5.13.10 share/rbbt_commands/app/start
rbbt-util-5.13.9 share/rbbt_commands/app/start
rbbt-util-5.13.8 share/rbbt_commands/app/start
rbbt-util-5.13.7 share/rbbt_commands/app/start
rbbt-util-5.13.6 share/rbbt_commands/app/start
rbbt-util-5.13.5 share/rbbt_commands/app/start
rbbt-util-5.13.4 share/rbbt_commands/app/start
rbbt-util-5.13.3 share/rbbt_commands/app/start
rbbt-util-5.13.2 share/rbbt_commands/app/start
rbbt-util-5.13.1 share/rbbt_commands/app/start
rbbt-util-5.13.0 share/rbbt_commands/app/start
rbbt-util-5.12.3 share/rbbt_commands/app/start
rbbt-util-5.12.2 share/rbbt_commands/app/start
rbbt-util-5.12.1 share/rbbt_commands/app/start
rbbt-util-5.12.0 share/rbbt_commands/app/start
rbbt-util-5.11.9 share/rbbt_commands/app/start
rbbt-util-5.11.8 share/rbbt_commands/app/start
rbbt-util-5.11.7 share/rbbt_commands/app/start
rbbt-util-5.11.6 share/rbbt_commands/app/start