class Object

Constants

VERSION

Public Instance Methods

dirs() click to toggle source
# File lib/puma/plugin/file_restart.rb, line 34
def dirs
  if env = ENV["PUMA_FILE_RESTART_DIRS"]
    env.split(",")
  else
    [Dir.pwd]
  end
end
ignore() click to toggle source
# File lib/puma/plugin/file_restart.rb, line 42
def ignore
  if env = ENV["PUMA_FILE_RESTART_IGNORE"]
    Regexp.new(env)
  end
end
only() click to toggle source
# File lib/puma/plugin/file_restart.rb, line 48
def only
  if env = ENV["PUMA_FILE_RESTART_ONLY"]
    Regexp.new(env)
  end
end
start(launcher) click to toggle source
# File lib/puma/plugin/file_restart.rb, line 23
def start(launcher)
  return unless ENV["RACK_ENV"] == "development"
  in_background do
    listener = Listen.to(*dirs) { |_| launcher.restart }
    listener.only(only) if only
    listener.ignore(ignore) if ignore
    listener.start
    sleep
  end
end