Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 74 lines (51 sloc) 2.72 kB
5268fd2 @tj - Added base gem
authored
1
2 = Bind
3
6567257 @tj - Todo
authored
4 Bind actions to various file system events, helping aid in
eaa275d @tj - Doc
authored
5 automation of tasks such as refreshing browser(s) when you
6 update a css / sass / js file.
7
e81de92 @tj Removed gem namespace (thanks github...)
authored
8 == Installation
9
10 Install [Gemcutter](http://gemcutter.org) and execute:
11 $ sudo gem install bind
12
51c171e @tj - Docs
authored
13 == Executable
eaa275d @tj - Doc
authored
14
51c171e @tj - Docs
authored
15 The 'bind' executable allows you to perform arbitrary actions
16 based on several events. Currently only the change (mtime) event
17 is supported.
18
19 Bind to a single file, outputting its path when changed
5621eb0 @tj - Renamed to rbind, since bind is usually a command already
authored
20 $ rbind to style.css -e 'puts file.path'
51c171e @tj - Docs
authored
21
2d7c59b @tj Updated doc from recent changes
authored
22 Bind to glob
23 $ rbind to stylesheets/*.css -e 'puts file.path'
24
25 Bind to ruby glob (allows recursion) note the quotes
26 $ rbind to 'stylesheets/**/*.css' -e 'puts file.path'
27
51c171e @tj - Docs
authored
28 Refresh Safari, and Firefox in the background to the uri specified when
29 style.css or reset.css are modified.
2d7c59b @tj Updated doc from recent changes
authored
30 $ rbind refresh http://localhost/page --paths style.css,reset.css --browsers Safari,Firefox
51c171e @tj - Docs
authored
31
32 Refresh local static html when the style you are working on is modified.
5621eb0 @tj - Renamed to rbind, since bind is usually a command already
authored
33 $ rbind refresh examples/demo.html -f style.css -b Safari
51c171e @tj - Docs
authored
34
35 == Library
36
37 Bind of course supplies a Ruby library as well, which provides the same
38 functionality as the executable above.
39
40
41 Refresh Safari and Firefox, using the RefreshBrowsersHaml action, whenever a haml or
42 sass file is modified, it will be compiled to '..' (up a directory) preceding the refresh.
43
44 path = 'http://localhost'
45 action = Bind::Actions::RefreshBrowsersHaml.new path, '..', 'Safari', 'Firefox'
66b6a4f @tj Changed option :files to :paths
authored
46 listener = Bind::Listener.new :interval => 1, :debug => $stdout, :action => action, :paths => Dir['*.haml'] + Dir['*.sass']
51c171e @tj - Docs
authored
47 listener.run!
5268fd2 @tj - Added base gem
authored
48
49 == License:
50
51 (The MIT License)
52
53 Copyright (c) 2009 TJ Holowaychuk <tj@vision-media.ca>
54
55 Permission is hereby granted, free of charge, to any person obtaining
56 a copy of this software and associated documentation files (the
57 'Software'), to deal in the Software without restriction, including
58 without limitation the rights to use, copy, modify, merge, publish,
59 distribute, sublicense, an d/or sell copies of the Software, and to
60 permit persons to whom the Software is furnished to do so, subject to
61 the following conditions:
62
63 The above copyright notice and this permission notice shall be
64 included in all copies or substantial portions of the Software.
65
66 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
67 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
68 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
69 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
70 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
71 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
72 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
73 GS IN THE SOFTWARE.
Something went wrong with that request. Please try again.