class ActiveSupport::Reloader
Public Class Methods
after_class_unload(*args, &block)
click to toggle source
# File activesupport/lib/active_support/reloader.rb, line 39 def self.after_class_unload(*args, &block) set_callback(:class_unload, :after, *args, &block) end
before_class_unload(*args, &block)
click to toggle source
# File activesupport/lib/active_support/reloader.rb, line 35 def self.before_class_unload(*args, &block) set_callback(:class_unload, *args, &block) end
new()
click to toggle source
Calls superclass method
Object::new
# File activesupport/lib/active_support/reloader.rb, line 89 def initialize super @locked = false end
reload!()
click to toggle source
Initiate a manual reload
# File activesupport/lib/active_support/reloader.rb, line 46 def self.reload! executor.wrap do new.tap do |instance| begin instance.run! ensure instance.complete! end end end prepare! end
to_prepare(*args, &block)
click to toggle source
# File activesupport/lib/active_support/reloader.rb, line 31 def self.to_prepare(*args, &block) set_callback(:prepare, *args, &block) end
wrap()
click to toggle source
Run the supplied block as a work unit, reloading code as needed
Calls superclass method
ActiveSupport::ExecutionWrapper::wrap
# File activesupport/lib/active_support/reloader.rb, line 68 def self.wrap executor.wrap do super end end
Public Instance Methods
release_unload_lock!()
click to toggle source
Release the unload lock if it has been previously obtained
# File activesupport/lib/active_support/reloader.rb, line 104 def release_unload_lock! if @locked @locked = false ActiveSupport::Dependencies.interlock.done_unloading end end
require_unload_lock!()
click to toggle source
Acquire the ActiveSupport::Dependencies::Interlock
unload lock, ensuring it will be released automatically
# File activesupport/lib/active_support/reloader.rb, line 96 def require_unload_lock! unless @locked ActiveSupport::Dependencies.interlock.start_unloading @locked = true end end