Create a gist now

Instantly share code, notes, and snippets.

@bryanp /run.rb
Created Feb 11, 2017

Pakyow 1.0 Process Reloading
require "bundler/setup"
require "pakyow"
require "rack/handler/puma"
def run
if Process.respond_to?(:fork)
@pid = Process.fork do
require "./app/setup"
Pakyow::App.run(ENV['RACK_ENV'])
end
else
puts "sorry :("
end
end
run
require "listen"
listener = Listen.to(".") do |modified, added, removed|
Process.kill("INT", @pid)
run
end.start
sleep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment