Sha256: bf6f22238389d9f49b913f0aae7ef4d0449edc850b2488e64101e5c226c629e1
Contents?: true
Size: 1.11 KB
Versions: 21
Compression:
Stored size: 1.11 KB
Contents
# NOTE: On Windows Process.fork is implemented in a way # that it re-starts the parent command with an additional "child#0" # argument. Naturally, this leads to Thor rejecting that 2nd invocation # since the original command is not supposed to have arguments. # To overcome this issue all Background commands # should have an optional fictitious parameter (which is not used) # but exists merely to support Windows Process.fork artificial implementation Execute.define_task do desc "startbg [CHILDNAME]", "Start rhoconnect server in bg mode (Rhostudio) - this is an internal command", :hide => true def startbg(childname=nil) cmd = "bundle exec rackup -s #{defined?(JRUBY_VERSION) ? 'puma' : 'thin'}" require 'win32/process' if windows? p1 = Process.fork { if windows? puts 'Starting rhoconnect ...' system "#{cmd} config.ru -P #{rhoconnect_pid}" elsif jruby? puts 'Starting rhoconnect in jruby environment...' system "#{cmd} -r config.ru" else system "#{cmd} config.ru -P #{rhoconnect_pid}" end } Process.detach(p1) exit end #startbg end
Version data entries
21 entries across 21 versions & 1 rubygems