Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update readme.

  • Loading branch information...
commit f33600bf487d11496aba75ed3ccb3afe0af13a1f 1 parent 18e4147
@rustyio authored
Showing with 72 additions and 15 deletions.
  1. +72 −15 README.markdown
View
87 README.markdown
@@ -1,10 +1,19 @@
# Stay in Sync
-## What is it?
+## What is Sync?
-Sync is an Erlang utility that helps you code faster by automatically compiling and hot-loading changed code.
+Sync is a developer utility. It recompiles and reloads your Erlang
+code on-the-fly. With Sync, you can code without friction.
-## How can I use sync?
+![Successful compilation image.](http://rusty.io.s3.amazonaws.com/sync/sync_01.png)
+
+What does "code without friction" mean? It means that with Sync
+running, you no longer need to worry about running `make`, or
+`c:l(Module)` again. Just write code, save the file, and watch as
+Erlang automatically detects your changes, recompiles the code, and
+reloads the module.
+
+## How can I use Sync?
The recommended approach is to put sync in your $ERL_LIBS directory.
@@ -14,30 +23,48 @@ 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?
+Then, go in the Erlang console of an application you are developing,
+run `sync:go().`. You can also start sync using
+`application:start(sync).`
-Upon startup, Sync gathers information about loaded modules, ebin directories, source files, compilation options, etc.
+Starting up:
-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.
+```txt
+(rustyio@127.0.0.1)6> sync:go().
-Sync also periodically checks the last modified date of any beam files, and automatically reloads the file if it has changed.
+Starting Sync (Automatic Code Compiler / Reloader)
+Scanning source files...
+ok
+08:34:18.609 [info] Application sync started on node 'rustyio@127.0.0.1'
+```
-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.
+Successfully recompiling a module:
-## Using it with Nitrogen
+```txt
+08:34:43.255 [info] /Code/Webmachine/src/webmachine_dispatcher.erl:0: Recompiled.
+08:34:43.265 [info] webmachine_dispatcher: Reloaded! (Beam changed.)
+```
-If you are running sync with the [Nitrogen Web Framework](http://www.nitrogenproject.com), be sure to add the following line to your etc/vm.args file:
+Warnings:
```txt
--sync sync_mode nitrogen
+08:35:06.660 [info] /Code/Webmachine/src/webmachine_dispatcher.erl:33: Warning: function dispatch/3 is unused
```
+Errors:
+
+```txt
+08:35:16.881 [info] /Code/Webmachine/src/webmachine_dispatcher.erl:196: Error: function reconstitute/1 undefined
+/Code/Webmachine/src/webmachine_dispatcher.erl:250: Error: syntax error before: reconstitute
+```
## 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. This will also work on Linux if you have **notify-send** (Fedora: `libnotify` package, Ubuntu: `libnotify-bin` package):
+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. This will also work on Linux
+if you have **notify-send** (Fedora: `libnotify` package, Ubuntu:
+`libnotify-bin` package):
Successful compilation:
@@ -53,7 +80,8 @@ Errors:
### Disabling Growl Notifications
-If you find the Growl/notify-send notifications annoying, you can choose to disable them with two ways:
+If you find the Growl/notify-send notifications annoying, you can
+choose to disable them with two ways:
#### 1. As an environment variable called from the erlang command line:
@@ -90,3 +118,32 @@ overwritten on disk with the new .beam file and reloaded. If the
module doesn't exist on the new node, then it is simply updated in
memory.
+## How does Sync 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.
+
+## Using Sync with the Nitrogen Web Framework
+
+If you are running sync with the [Nitrogen Web Framework](http://www.nitrogenproject.com), be sure to add the following line to your etc/vm.args file:
+
+```txt
+-sync sync_mode nitrogen
+```
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.