Sha256: 786ce60e3be7f872f8788c994f2a2684b11b5aafa69a5e98d0f57eee80f75aa0

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

= AutoReload


== Description

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

IMPORTANT! Version 1.0+ has a new API. It also works best
under Ruby 1.9 or above. Under Ruby 1.8 or older files are 
reloaded regardless of whether they actually have changed
since the last load. Whereas in Ruby 1.9+, they only reload
if the mtime on the file is newer than the previous time.


== Resources

* {Homepage}[http://rubyworks.github.com/autoreload]
* {Source Code}[http://github.com/rubyworks/autoreload]


== Synopsis

Say we have a library <tt>foo.rb</tt> in our load path:

  def foo
    1
  end

We can then run the following script, <tt>example.rb</tt>:

  require 'autoreload'

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

  loop {
    puts foo
    sleep 2
  }

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

Note, that autoreload only works with _required_ files. It cannot
monitor files that are broght in with _load_. This is because
$LOADED_FEATURES is used to track which files are monitored.


== Copyrights

Copyright (c) 2003,2007 Kouichirou Eto

Copyright (c) 2010 Thomas Sawyer

BSD 2-Clause License

See COPYING.rdoc for more information.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
autoreload-1.0.0 README.rdoc