Skip to content

Commit

Permalink
- Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Mar 3, 2009
1 parent 74cea06 commit 51c171e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
30 changes: 28 additions & 2 deletions README.rdoc
Expand Up @@ -5,9 +5,35 @@ Bind actions to various file system events, helping aid in
automation of tasks such as refreshing browser(s) when you
update a css / sass / js file.

== Features
== Executable

* Coming soon
The 'bind' executable allows you to perform arbitrary actions
based on several events. Currently only the change (mtime) event
is supported.

Bind to a single file, outputting its path when changed
$ bind to style.css -e 'puts file.path'

Refresh Safari, and Firefox in the background to the uri specified when
style.css or reset.css are modified.
$ bind refresh http://localhost/page --files style.css,reset.css --browsers Safari,Firefox

Refresh local static html when the style you are working on is modified.
$ bind refresh examples/demo.html -f style.css -b Safari

== Library

Bind of course supplies a Ruby library as well, which provides the same
functionality as the executable above.


Refresh Safari and Firefox, using the RefreshBrowsersHaml action, whenever a haml or
sass file is modified, it will be compiled to '..' (up a directory) preceding the refresh.

path = 'http://localhost'
action = Bind::Actions::RefreshBrowsersHaml.new path, '..', 'Safari', 'Firefox'
listener = Bind::Listener.new :interval => 1, :debug => $stdout, :action => action, :files => Dir['*.haml'] + Dir['*.sass']
listener.run!

== License:

Expand Down
2 changes: 1 addition & 1 deletion Todo.rdoc
@@ -1,7 +1,7 @@

== Major:

* Add support for an eval BEFORE actions, such as building SASS / HAML
* Add sass / haml support in exec

== Minor:

Expand Down
2 changes: 1 addition & 1 deletion bin/bind
Expand Up @@ -14,7 +14,7 @@ command :to do |c|
c.syntax = 'bind to <file> [file ...] [options] '
c.summary = 'Bind to modification of a file'
c.description = 'Bind to modification of a file or all files within a directory.'
c.example 'Bind to a single file, logging its path when changed', "bind change style.css -e 'puts file'"
c.example 'Bind to a single file, logging its path when changed', "bind to style.css -e 'puts file'"
c.option '-e', '--eval STRING', String, 'Evaluate a string of Ruby in context of Bind, so the file local variable is available.'
c.when_called do |args, options|
populate_common_options options
Expand Down

0 comments on commit 51c171e

Please sign in to comment.