Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add startup message. Update README.md.
- Loading branch information
Showing
2 changed files
with
44 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,44 @@ | ||
# Sync: Recompile and Reload Changed Erlang Code | ||
# Stay in Sync | ||
|
||
## What is it? | ||
|
||
Sync is an Erlang utility that helps you code faster by automatically compiling and hot-loading code into a running system. | ||
|
||
## How can I use sync? | ||
|
||
The recommended approach is to put sync in your $ERL_LIBS directory. | ||
|
||
cd $ERL_LIBS | ||
git clone git@github.com:rustyio/sync.git | ||
(cd sync; make) | ||
|
||
Then, go in the Erlang console of an application you are developing, run `sync:go().`. You can also start sync using `application:start(sync).` | ||
|
||
## How does it work? | ||
|
||
Upon startup, Sync gathers information about loaded modules, ebin directories, source files, compilation options, etc. | ||
|
||
Sync then periodically checks the last modified date of source files. If a file has changed since the last scan, then Sync automatically recompiles the module using the previous set of compilation options. If compilation was successful, it loads the updated module. Otherwise, it prints compilation errors to the console. | ||
|
||
Sync also periodically checks the last modified date of any beam files, and automatically reloads the file if it has changed. | ||
|
||
The scanning process adds 1% to 2% CPU load on a running Erlang VM. Much care has been taken to keep this low. Shouldn't have to say this, but this is for development mode only, don't run it in production. | ||
|
||
## Growl Notifications | ||
|
||
If you are running a Mac and have [Growl](http://growl.info) and the **growlnotify** utility installed, Sync will pop up Growl notifications with compilation results: | ||
|
||
Successful compilation: | ||
|
||
![Successful compilation image.](http://rusty.io.s3.amazonaws.com/sync/sync_01.png) | ||
|
||
Warnings: | ||
|
||
![Compilation warnings image.](http://rusty.io.s3.amazonaws.com/sync/sync_02.png) | ||
|
||
Errors: | ||
|
||
![Compilation errors image.](http://rusty.io.s3.amazonaws.com/sync/sync_03.png) | ||
|
||
Sync is a developer tool to help you hot-load changed code in an | ||
Erlang system. | ||
|
||
When you start the application using `sync:go()` or | ||
`application:start(sync)`, the system automatically starts checking | ||
for changes to all loaded modules (except for Erlang system | ||
modules). Sync will recompile and reload the module if the source has | ||
changed, or if any include files for a module have changed. | ||
|
||
Compilation errors are logged using the error_logger. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters