Sha256: da31b06c7162bc7a7348df07136d99a5e252ab19c8166747150777581213b0a5
Contents?: true
Size: 1.78 KB
Versions: 5
Compression:
Stored size: 1.78 KB
Contents
#!/usr/bin/env ruby require 'rbbt-util' require 'rbbt/util/simpleopt' $0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands options = SOPT.setup <<EOF Start an rbbt app $ rbbt app start [options] <app_name> -h--help Print this help -e--environment* Execution environment: production or development -Ho--Host* Host name -B--Bind* Bind IP -p--port* TCP port -s--server* Server type: thin, webrick, unicorn, etc -f--finder Start server with finder functionality -R--Rserve_session* Rserve session to use, otherwise start new one -wd--workdir* Change the working directory of the workflow --views* Directory with view templates EOF if options[:help] if defined? rbbt_usage rbbt_usage else puts SOPT.usage end exit 0 end if options[:workdir] require 'rbbt/workflow' Workflow.workdir = options[:workdir] end options[:Port] ||= options[:port] options[:Host] ||= "0.0.0.0" options[:Bind] ||= "0.0.0.0" app = ARGV.shift ENV["RServe-session"] = options[:RServe_session] || app 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) ENV["RBBT_VIEWS_DIR"] = options[:views] if options.include?(:views) 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 options[:config] = config_ru_file Rack::Server.start(options) end end #!/usr/bin/env ruby require 'rbbt-util' require 'rbbt/util/simpleopt'
Version data entries
5 entries across 5 versions & 1 rubygems