Giter VIP home page Giter VIP logo

autoreload's Introduction

AutoReload

Homepage | Development | Mailing List

Build Status

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.

autoreload's People

Contributors

trans avatar sziep avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.