Method: Bj.reload!

Defined in:
lib/bj.rb

.reload!Object

an imperfect reloading hook - because neither rails’ plugins nor gems provide one, sigh…



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/bj.rb', line 73

def self.reload!
  background = nil
  ::Object.module_eval do
    background = Bj.runner.background
    remove_const :Bj rescue nil
    remove_const :BackgroundJob rescue nil
  end
  returned = load __FILE__ rescue nil
  Bj.runner.background = background if background
  returned
end