Autoreload

DESCRIPTION

Autoreload automatically reloads library files when they have been updated. It is especailly useful when testing stateless services such as web applications.

HOW TO USE

Say we have a library foo.rb in our load path:

def foo
  1
end

We can then run the following script, example.rb:

require 'autoreload'
require 'foo'

autoreload('foo.rb', :interval=>2, :verbose=>true)

loop {
  puts foo
  sleep 2
}

With that running we can change foo.rb and the change will take effect in example.rb within two seconds of being made.

Copyright © 2007 Kouichirou Eto

Copyright © 2010 Thomas Sawyer