module Shotgun

Public Class Methods

after_fork(&block) click to toggle source
# File lib/shotgun.rb, line 31
def self.after_fork(&block)
  @after_fork ||= []
  @after_fork << block if block
  @after_fork
end
after_fork!() click to toggle source
# File lib/shotgun.rb, line 41
def self.after_fork!
  after_fork.each { |block| block.call }
end
before_fork(&block) click to toggle source
# File lib/shotgun.rb, line 25
def self.before_fork(&block)
  @before_fork ||= []
  @before_fork << block if block
  @before_fork
end
before_fork!() click to toggle source
# File lib/shotgun.rb, line 37
def self.before_fork!
  before_fork.each { |block| block.call }
end
enable_copy_on_write() click to toggle source
# File lib/shotgun.rb, line 12
def self.enable_copy_on_write
  GC.copy_on_write_friendly = true if GC.respond_to?(:copy_on_write_friendly=)
end
new(rackup_file, &block) click to toggle source
# File lib/shotgun.rb, line 8
def self.new(rackup_file, &block)
  Loader.new(rackup_file, &block)
end
preload(files=%w[./config/shotgun.rb ./shotgun.rb]) click to toggle source
# File lib/shotgun.rb, line 16
def self.preload(files=%w[./config/shotgun.rb ./shotgun.rb])
  files.each do |preload_file|
    if File.exist?(preload_file)
      module_eval File.read(preload_file), preload_file
      return preload_file
    end
  end
end