https://github.com/rubyworks/autoreload
Automatic Library Reloading
https://github.com/rubyworks/autoreload
Last synced: 6 months ago
JSON representation
Automatic Library Reloading
- Host: GitHub
- URL: https://github.com/rubyworks/autoreload
- Owner: rubyworks
- License: other
- Created: 2010-05-04T23:03:09.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2015-05-07T15:35:46.000Z (almost 11 years ago)
- Last Synced: 2024-04-25T23:21:58.959Z (almost 2 years ago)
- Language: Ruby
- Homepage: http://rubyworks.github.com/autoreload
- Size: 474 KB
- Stars: 17
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.md
Awesome Lists containing this project
README
# AutoReload
[Homepage](http://rubyworks.github.com/autoreload) |
[Development](http://github.com/rubyworks/autoreload) |
[Mailing List](http://groups.google.com/group/rubyworks-mailinglist)
[](http://travis-ci.org/rubyworks/autoreload)
## Description
Autoreload automatically reloads library files after they
have been updated. It is especially 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.
## Synopsis
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'
autoreload(:interval=>2, :verbose=>true) do
require 'foo.rb'
end
loop {
puts foo
sleep 2
}
While that's running we can change `foo.rb` and the change will
take effect in `example.rb` within two seconds of being made.
Note that autoreload only works with _required_ files. It cannot
monitor files that are brought in with `#load`. This is because
`$LOADED_FEATURES` is used to track which files are monitored.
## Acknowledgements
The current version of Autoreload is a derviative of Kouichirou Eto's original
work which can still be found at http://autoreload.rubyforge.org.
## License & Copyrights
Autoreload is released as free software under the BSD-2-Clause license.
* Copyright 2010 Rubyworks
* Copyright 2003 Kouichirou Eto
See LICENSE.md for details.