Browse files

Basic attempt at reloading

  • Loading branch information...
1 parent 79a90d8 commit 9dc0d5cd20fa81d5fe9ac42e0ac1d6db2b5f4838 Dean Strelau committed Mar 23, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/guard/forku.rb
View
12 lib/guard/forku.rb
@@ -12,6 +12,18 @@ def start
notify 'Ready', image: :pending
end
+ # Called on Ctrl-Z signal
+ #
+ # We can't reload all of Rails,
+ # but we can mimic what 'reload!' in console does.
+ def reload
+ if defined?(ActionDispatch::Reloader) # rails/rails@e683ab
+ elsif defined?(ActionDispatch::Callbacks) # Rails 3.0.x
+ ActionDispatch::Callbacks.new(Proc.new {}, false).call({})
+ end
+ UI.info "Reloaded."
+ end
+
# Called on Ctrl-/ signal
#
# Run each set of tests serially, as running them together can cause

0 comments on commit 9dc0d5c

Please sign in to comment.