Class: Gemkeeper::RackupProcess

Inherits:
Object
  • Object
show all
Defined in:
lib/gemkeeper/rackup_process.rb

Overview

Builds config.ru, spawns the rackup/puma process, and waits for HTTP readiness.

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ RackupProcess

Returns a new instance of RackupProcess.



10
11
12
# File 'lib/gemkeeper/rackup_process.rb', line 10

def initialize(config)
  @config = config
end

Instance Method Details

#startObject



14
15
16
17
18
# File 'lib/gemkeeper/rackup_process.rb', line 14

def start
  generate_config_ru
  Dir.chdir(@config.cache_dir) { launch_daemon }
  wait_for_server
end

#start_foregroundObject



20
21
22
23
# File 'lib/gemkeeper/rackup_process.rb', line 20

def start_foreground
  generate_config_ru
  Dir.chdir(@config.cache_dir) { system(*build_rackup_cmd) }
end