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.6.7 share/rbbt_commands/app/start
rbbt-util-5.6.6 share/rbbt_commands/app/start
rbbt-util-5.6.5 share/rbbt_commands/app/start
rbbt-util-5.6.4 share/rbbt_commands/app/start
rbbt-util-5.6.3 share/rbbt_commands/app/start
rbbt-util-5.6.2 share/rbbt_commands/app/start
rbbt-util-5.6.1 share/rbbt_commands/app/start
rbbt-util-5.6.0 share/rbbt_commands/app/start
rbbt-util-5.5.68 share/rbbt_commands/app/start
rbbt-util-5.5.67 share/rbbt_commands/app/start
rbbt-util-5.5.66 share/rbbt_commands/app/start
rbbt-util-5.5.65 share/rbbt_commands/app/start
rbbt-util-5.5.64 share/rbbt_commands/app/start
rbbt-util-5.5.63 share/rbbt_commands/app/start
rbbt-util-5.5.62 share/rbbt_commands/app/start
rbbt-util-5.5.61 share/rbbt_commands/app/start
rbbt-util-5.5.60 share/rbbt_commands/app/start
rbbt-util-5.5.59 share/rbbt_commands/app/start
rbbt-util-5.5.58 share/rbbt_commands/app/start
rbbt-util-5.5.57 share/rbbt_commands/app/start