joshbuddy-guard 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. data/CHANGELOG.md +370 -0
  2. data/LICENSE +20 -0
  3. data/README.md +470 -0
  4. data/bin/fsevent_watch_guard +0 -0
  5. data/bin/guard +6 -0
  6. data/images/failed.png +0 -0
  7. data/images/pending.png +0 -0
  8. data/images/success.png +0 -0
  9. data/lib/guard.rb +463 -0
  10. data/lib/guard/cli.rb +125 -0
  11. data/lib/guard/dsl.rb +370 -0
  12. data/lib/guard/dsl_describer.rb +150 -0
  13. data/lib/guard/group.rb +37 -0
  14. data/lib/guard/guard.rb +129 -0
  15. data/lib/guard/hook.rb +118 -0
  16. data/lib/guard/interactor.rb +116 -0
  17. data/lib/guard/listener.rb +351 -0
  18. data/lib/guard/listeners/darwin.rb +60 -0
  19. data/lib/guard/listeners/linux.rb +91 -0
  20. data/lib/guard/listeners/polling.rb +55 -0
  21. data/lib/guard/listeners/windows.rb +61 -0
  22. data/lib/guard/notifier.rb +290 -0
  23. data/lib/guard/templates/Guardfile +2 -0
  24. data/lib/guard/ui.rb +193 -0
  25. data/lib/guard/version.rb +6 -0
  26. data/lib/guard/watcher.rb +114 -0
  27. data/lib/vendor/darwin/Gemfile +6 -0
  28. data/lib/vendor/darwin/Guardfile +8 -0
  29. data/lib/vendor/darwin/LICENSE +20 -0
  30. data/lib/vendor/darwin/README.rdoc +254 -0
  31. data/lib/vendor/darwin/Rakefile +21 -0
  32. data/lib/vendor/darwin/ext/extconf.rb +61 -0
  33. data/lib/vendor/darwin/ext/fsevent/fsevent_watch.c +226 -0
  34. data/lib/vendor/darwin/lib/rb-fsevent.rb +2 -0
  35. data/lib/vendor/darwin/lib/rb-fsevent/fsevent.rb +105 -0
  36. data/lib/vendor/darwin/lib/rb-fsevent/version.rb +3 -0
  37. data/lib/vendor/darwin/rb-fsevent.gemspec +24 -0
  38. data/lib/vendor/darwin/spec/fixtures/folder1/file1.txt +0 -0
  39. data/lib/vendor/darwin/spec/fixtures/folder1/folder2/file2.txt +0 -0
  40. data/lib/vendor/darwin/spec/rb-fsevent/fsevent_spec.rb +75 -0
  41. data/lib/vendor/darwin/spec/spec_helper.rb +24 -0
  42. data/lib/vendor/linux/MIT-LICENSE +20 -0
  43. data/lib/vendor/linux/README.md +66 -0
  44. data/lib/vendor/linux/Rakefile +54 -0
  45. data/lib/vendor/linux/VERSION +1 -0
  46. data/lib/vendor/linux/lib/rb-inotify.rb +17 -0
  47. data/lib/vendor/linux/lib/rb-inotify/event.rb +139 -0
  48. data/lib/vendor/linux/lib/rb-inotify/native.rb +31 -0
  49. data/lib/vendor/linux/lib/rb-inotify/native/flags.rb +89 -0
  50. data/lib/vendor/linux/lib/rb-inotify/notifier.rb +308 -0
  51. data/lib/vendor/linux/lib/rb-inotify/watcher.rb +83 -0
  52. data/lib/vendor/linux/rb-inotify.gemspec +53 -0
  53. data/lib/vendor/windows/Gemfile +4 -0
  54. data/lib/vendor/windows/README.md +34 -0
  55. data/lib/vendor/windows/Rakefile +18 -0
  56. data/lib/vendor/windows/lib/rb-fchange.rb +14 -0
  57. data/lib/vendor/windows/lib/rb-fchange/event.rb +29 -0
  58. data/lib/vendor/windows/lib/rb-fchange/native.rb +45 -0
  59. data/lib/vendor/windows/lib/rb-fchange/native/flags.rb +78 -0
  60. data/lib/vendor/windows/lib/rb-fchange/notifier.rb +149 -0
  61. data/lib/vendor/windows/lib/rb-fchange/version.rb +3 -0
  62. data/lib/vendor/windows/lib/rb-fchange/watcher.rb +99 -0
  63. data/lib/vendor/windows/rb-fchange.gemspec +34 -0
  64. data/lib/vendor/windows/spec/fixtures/folder1/file1.txt +0 -0
  65. data/lib/vendor/windows/spec/fixtures/folder1/folder2/file2.txt +0 -0
  66. data/lib/vendor/windows/spec/rb-fchange/fchange_spec.rb +119 -0
  67. data/lib/vendor/windows/spec/spec_helper.rb +21 -0
  68. data/man/guard.1 +96 -0
  69. data/man/guard.1.html +181 -0
  70. metadata +193 -0
@@ -0,0 +1,3 @@
1
+ module FChange
2
+ VERSION = "0.0.5"
3
+ end
@@ -0,0 +1,99 @@
1
+ require 'pathname'
2
+
3
+ module FChange
4
+ # Watchers monitor a single path for changes,
5
+ # specified by {FChange::Notifier#watch event flags}.
6
+ # A watcher is usually created via \{Notifier#watch}.
7
+ #
8
+ # One {Notifier} may have many {Watcher}s.
9
+ # The Notifier actually takes care of the checking for events,
10
+ # via \{Notifier#run #run} or \{Notifier#process #process}.
11
+ # The main purpose of having Watcher objects
12
+ # is to be able to disable them using \{#close}.
13
+ class Watcher
14
+ # The {Notifier} that this Watcher belongs to.
15
+ #
16
+ # @return [Notifier]
17
+ attr_reader :notifier
18
+
19
+ # The path that this Watcher is watching.
20
+ #
21
+ # @return [String]
22
+ attr_reader :path
23
+
24
+ # The {FChange::Notifier#watch flags}
25
+ # specifying the events that this Watcher is watching for,
26
+ # and potentially some options as well.
27
+ #
28
+ # @return [Array<Symbol>]
29
+ attr_reader :flags
30
+
31
+ # The id for this Watcher.
32
+ # Used to retrieve this Watcher from {Notifier#watchers}.
33
+ #
34
+ # @private
35
+ # @return [Fixnum]
36
+ attr_reader :id
37
+
38
+ #
39
+ # @private
40
+ # @return [Boolean]
41
+ attr_reader :recursive
42
+
43
+ # Calls this Watcher's callback with the given {Event}.
44
+ #
45
+ # @private
46
+ # @param event [Event]
47
+ def callback!(event)
48
+ @callback[event]
49
+ end
50
+
51
+ # Disables this Watcher, so that it doesn't fire any more events.
52
+ #
53
+ # @raise [SystemCallError] if the watch fails to be disabled for some reason
54
+ def close
55
+ r = Native.FindCloseChangeNotification(@id)
56
+ #@notifier.remove_watcher(self)
57
+ return if r == 0
58
+ raise SystemCallError.new("Failed to stop watching #{@path.inspect}", r)
59
+ end
60
+
61
+ # see http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx
62
+ def normalize_path(path)
63
+ if(path.size > 256)
64
+ path = "\\\\?\\" + Pathname.new(path).realpath.to_s
65
+ end
66
+ # require 'rchardet'
67
+ # require 'iconv'
68
+ # cd = CharDet.detect(path)
69
+ # encoding = cd['encoding']
70
+ # converter = Iconv.new("UTF-16LE", encoding)
71
+ # converter.iconv(path)
72
+ # path.encode!("UTF-16LE")
73
+ end
74
+
75
+ # Creates a new {Watcher}.
76
+ #
77
+ # @private
78
+ # @see Notifier#watch
79
+ def initialize(notifier, path, recursive, *flags, &callback)
80
+ @notifier = notifier
81
+ @callback = callback || proc {}
82
+ @path = path
83
+ @flags = flags
84
+ @recursive = recursive ? 1 : 0
85
+
86
+ @id = Native.FindFirstChangeNotificationA(path, @recursive,
87
+ Native::Flags.to_mask(flags));
88
+ # @id = Native.FindFirstChangeNotificationW(normalize_path(path), @recursive,
89
+ # Native::Flags.to_mask(flags));
90
+
91
+ unless @id < 0
92
+ @notifier.add_watcher(self)
93
+ return
94
+ end
95
+
96
+ raise SystemCallError.new("Failed to watch #{path.inspect}", @id)
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,34 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "rb-fchange/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = %q{rb-fchange}
7
+ s.version = FChange::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["stereobooster"]
10
+ s.date = %q{2011-05-15}
11
+ s.description = %q{A Ruby wrapper for Windows Kernel functions for monitoring the specified directory or subtree}
12
+ s.email = ["stereobooster@gmail.com"]
13
+ s.extra_rdoc_files = [
14
+ "README.md"
15
+ ]
16
+ s.files = [
17
+ "README.md",
18
+ "Rakefile",
19
+ "lib/rb-fchange.rb",
20
+ "lib/rb-fchange/event.rb",
21
+ "lib/rb-fchange/native.rb",
22
+ "lib/rb-fchange/native/flags.rb",
23
+ "lib/rb-fchange/notifier.rb",
24
+ "lib/rb-fchange/watcher.rb",
25
+ "rb-fchange.gemspec"
26
+ ]
27
+ s.homepage = %q{http://github.com/stereobooster/rb-fchange}
28
+ s.require_paths = ["lib"]
29
+ s.rubygems_version = %q{1.3.7}
30
+ s.summary = %q{A Ruby wrapper for Windows Kernel functions for monitoring the specified directory or subtree}
31
+ s.add_dependency 'ffi'
32
+ s.add_development_dependency 'bundler'
33
+ s.add_development_dependency 'rspec'
34
+ end
@@ -0,0 +1,119 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ describe FChange do
5
+
6
+ before(:each) do
7
+ @results = []
8
+ @notifier = FChange::Notifier.new
9
+ @notifier.watch(@fixture_path.to_s) do |event|
10
+ @results += [event.watcher.path]
11
+ end
12
+ end
13
+
14
+ it "should work with path with an apostrophe" do
15
+ custom_path = @fixture_path.join("custom 'path")
16
+ file = custom_path.join("newfile.rb").to_s
17
+ File.delete file if File.exists? file
18
+ run
19
+ FileUtils.touch file
20
+ stop
21
+ File.delete file
22
+ @results.should == [@fixture_path.to_s, @fixture_path.to_s]
23
+ end
24
+
25
+ it "should catch new file" do
26
+ file = @fixture_path.join("newfile.rb")
27
+ File.delete file if File.exists? file
28
+ run
29
+ FileUtils.touch file
30
+ stop
31
+ File.delete file
32
+ @results.should == [@fixture_path.to_s]
33
+ end
34
+
35
+ it "should catch file update" do
36
+ file = @fixture_path.join("folder1/file1.txt")
37
+ File.exists?(file).should be_true
38
+ run
39
+ FileUtils.touch file
40
+ stop
41
+ @results.should == [@fixture_path.to_s]
42
+ end
43
+
44
+ it "should catch files update" do
45
+ file1 = @fixture_path.join("folder1/file1.txt")
46
+ file2 = @fixture_path.join("folder1/folder2/file2.txt")
47
+ File.exists?(file1).should be_true
48
+ File.exists?(file2).should be_true
49
+ run
50
+ FileUtils.touch file1
51
+ FileUtils.touch file2
52
+ stop
53
+ @results.should == [@fixture_path.to_s, @fixture_path.to_s]
54
+ end
55
+
56
+ it "should catch new directory" do
57
+ dir = @fixture_path.join("new_dir")
58
+ Dir.delete dir if Dir.exists? dir
59
+ Dir.exists?(dir).should be_false
60
+ run
61
+ Dir.mkdir dir
62
+ stop
63
+ Dir.delete dir
64
+ @results.should == [@fixture_path.to_s]
65
+ end
66
+
67
+ it "should catch directory rename" do
68
+ dir = @fixture_path.join("new_dir")
69
+ dir_new = @fixture_path.join("new_dir1")
70
+ Dir.mkdir dir unless Dir.exists? dir
71
+ Dir.delete dir_new if Dir.exists? dir_new
72
+ run
73
+ File.rename(dir, dir_new)
74
+ stop
75
+ Dir.delete(dir_new)
76
+ @results.should == [@fixture_path.to_s, @fixture_path.to_s]
77
+ end
78
+
79
+ it "should catch file rename" do
80
+ file = @fixture_path.join("folder1/file1.txt")
81
+ file_new = @fixture_path.join("folder1/file3.txt")
82
+ File.exists?(file).should be_true
83
+ File.exists?(file_new).should be_false
84
+ run
85
+ File.rename(file, file_new)
86
+ stop
87
+ File.rename(file_new, file)
88
+ @results.should == [@fixture_path.to_s, @fixture_path.to_s]
89
+ end
90
+
91
+ # it "should work with none-ANSI path" do
92
+ # dir = @fixture_path.join("../тест")
93
+ # Dir.mkdir dir unless Dir.exists? dir
94
+ # file = dir.join("тест");
95
+ # File.delete file if File.exists? file
96
+ # File.exists?(file).should be_false
97
+ # @notifier.watch(dir.to_s, :all_events, :recursive) do |event|
98
+ # @results += [event.watcher.path]
99
+ # end
100
+ # run
101
+ # FileUtils.touch file
102
+ # stop
103
+ # File.delete file
104
+ # Dir.delete dir
105
+ # @results.should == [@fixture_path.to_s, @fixture_path.to_s]
106
+ # end
107
+
108
+ def run
109
+ sleep 0.6
110
+ Thread.new { @notifier.run }
111
+ sleep 0.6
112
+ end
113
+
114
+ def stop
115
+ sleep 0.6
116
+ @notifier.stop
117
+ end
118
+
119
+ end
@@ -0,0 +1,21 @@
1
+ require 'rspec'
2
+ require 'rb-fchange'
3
+
4
+ RSpec.configure do |config|
5
+ # config.color_enabled = true
6
+ config.filter_run :focus => true
7
+ config.run_all_when_everything_filtered = true
8
+
9
+ config.before(:each) do
10
+ @fixture_path = Pathname.new(File.expand_path('../fixtures/', __FILE__))
11
+ end
12
+
13
+ config.before(:all) do
14
+
15
+ end
16
+
17
+ config.after(:all) do
18
+ gem_root = Pathname.new(File.expand_path('../../', __FILE__))
19
+ end
20
+
21
+ end
@@ -0,0 +1,96 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "GUARD" "1" "October 2011" "" ""
5
+ .
6
+ .SH "NAME"
7
+ \fBguard\fR \- Guard keeps an eye on your file modifications\.
8
+ .
9
+ .SH "DESCRIPTION"
10
+ Guard is a command line tool that easily handle events on files modifications\.
11
+ .
12
+ .SH "SYNOPSIS"
13
+ \fBguard <COMMAND> <OPTIONS>\fR
14
+ .
15
+ .SH "COMMANDS"
16
+ .
17
+ .SS "start"
18
+ Starts Guard\. This is the default command if none is provided\.
19
+ .
20
+ .P
21
+ The following options are available:
22
+ .
23
+ .P
24
+ \fB\-c\fR, \fB\-\-clear\fR Clears the Shell after each change\.
25
+ .
26
+ .P
27
+ \fB\-n\fR, \fB\-\-notify\fR \fIFLAG\fR Disable notifications (Growl or Libnotify depending on your system)\. Notifications can be disabled globally by setting a GUARD_NOTIFY environment variable to false\. FLAG can be \fBtrue\fR/\fBfalse\fR or \fBt\fR/\fBf\fR\.
28
+ .
29
+ .P
30
+ \fB\-d\fR, \fB\-\-debug\fR Runs Guard in debug mode\.
31
+ .
32
+ .P
33
+ \fB\-g\fR, \fB\-\-group\fR \fIGROUP1\fR \fIGROUP2\fR\.\.\. Runs only the groups specified by GROUP1, GROUP2 etc\. Groups name should be separated by spaces\. Guards that don\'t belong to a group are considered global and are always run\.
34
+ .
35
+ .P
36
+ \fB\-w\fR, \fB\-\-watchdir\fR \fIPATH\fR Tells Guard to watch PATH instead of \fB\./\fR\.
37
+ .
38
+ .P
39
+ \fB\-G\fR, \fB\-\-guardfile\fR \fIFILE\fR Tells Guard to use FILE as its Guardfile instead of \fB\./Guardfile\fR or \fB~/\.Guardfile\fR\.
40
+ .
41
+ .P
42
+ \fB\-A\fR, \fB\-\-watch\-all\-modifications\fR Watch all file modifications like moves or deletions with\.
43
+ .
44
+ .P
45
+ \fB\-i\fR, \fB\-\-no\-interactions\fR Turn off completely any Guard terminal interactions\.
46
+ .
47
+ .SS "init <a href=\"guard\.html\">GUARD</a>"
48
+ If no Guardfile is present in the current directory, creates an empty Guardfile\.
49
+ .
50
+ .P
51
+ If \fIGUARD\fR is present, add its default Guardfile configuration to the current Guardfile\. Note that \fIGUARD\fR is the guard\'s name without the \fBguard\-\fR prefix\. For instance to initialize guard\-rspec, run \fBguard init rspec\fR\.
52
+ .
53
+ .SS "list"
54
+ Lists guards that can be used with the \fBinit\fR command\.
55
+ .
56
+ .SS "\-T, show"
57
+ List defined groups and guards for the current Guardfile\.
58
+ .
59
+ .SS "\-h, help [COMMAND]"
60
+ List all of Guard\'s available commands\.
61
+ .
62
+ .P
63
+ If \fICOMMAND\fR is given, displays a specific help for \fITASK\fR\.
64
+ .
65
+ .SH "EXAMPLES"
66
+ Initialize Guard and a specific guard at the same time:
67
+ .
68
+ .P
69
+ \fB[bundle exec] guard init [rspec]\fR
70
+ .
71
+ .P
72
+ Run Guard:
73
+ .
74
+ .P
75
+ \fB[bundle exec] guard [start] \-\-watchdir ~/dev \-\-guardfile ~/env/Guardfile \-\-clear \-\-group backend frontend \-\-notify false \-\-debug\fR
76
+ .
77
+ .P
78
+ or in a more concise way:
79
+ .
80
+ .P
81
+ \fB[bundle exec] guard [start] \-w ~/dev \-G ~/env/Guardfile \-c \-g backend frontend \-n f \-d\fR
82
+ .
83
+ .SH "AUTHORS / CONTRIBUTORS"
84
+ Thibaud Guillaume\-Gentil is the main author\.
85
+ .
86
+ .P
87
+ A list of contributors based on all commits can be found here: https://github\.com/guard/guard/contributors
88
+ .
89
+ .P
90
+ For an exhaustive list of all the contributors, please see the CHANGELOG: https://github\.com/guard/guard/blob/master/CHANGELOG\.md
91
+ .
92
+ .P
93
+ This manual has been written by Remy Coutable\.
94
+ .
95
+ .SH "WWW"
96
+ https://github\.com/guard/guard
@@ -0,0 +1,181 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
6
+ <title>guard(1) - Guard keeps an eye on your file modifications.</title>
7
+ <style type='text/css' media='all'>
8
+ /* style: man */
9
+ body#manpage {margin:0}
10
+ .mp {max-width:100ex;padding:0 9ex 1ex 4ex}
11
+ .mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
12
+ .mp h2 {margin:10px 0 0 0}
13
+ .mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
14
+ .mp h3 {margin:0 0 0 4ex}
15
+ .mp dt {margin:0;clear:left}
16
+ .mp dt.flush {float:left;width:8ex}
17
+ .mp dd {margin:0 0 0 9ex}
18
+ .mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
19
+ .mp pre {margin-bottom:20px}
20
+ .mp pre+h2,.mp pre+h3 {margin-top:22px}
21
+ .mp h2+pre,.mp h3+pre {margin-top:5px}
22
+ .mp img {display:block;margin:auto}
23
+ .mp h1.man-title {display:none}
24
+ .mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
25
+ .mp h2 {font-size:16px;line-height:1.25}
26
+ .mp h1 {font-size:20px;line-height:2}
27
+ .mp {text-align:justify;background:#fff}
28
+ .mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
29
+ .mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
30
+ .mp u {text-decoration:underline}
31
+ .mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
32
+ .mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
33
+ .mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
34
+ .mp b.man-ref {font-weight:normal;color:#434241}
35
+ .mp pre {padding:0 4ex}
36
+ .mp pre code {font-weight:normal;color:#434241}
37
+ .mp h2+pre,h3+pre {padding-left:0}
38
+ ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
39
+ ol.man-decor {width:100%}
40
+ ol.man-decor li.tl {text-align:left}
41
+ ol.man-decor li.tc {text-align:center;letter-spacing:4px}
42
+ ol.man-decor li.tr {text-align:right;float:right}
43
+ </style>
44
+ </head>
45
+ <!--
46
+ The following styles are deprecated and will be removed at some point:
47
+ div#man, div#man ol.man, div#man ol.head, div#man ol.man.
48
+
49
+ The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
50
+ .man-navigation should be used instead.
51
+ -->
52
+ <body id='manpage'>
53
+ <div class='mp' id='man'>
54
+
55
+ <div class='man-navigation' style='display:none'>
56
+ <a href="#NAME">NAME</a>
57
+ <a href="#DESCRIPTION">DESCRIPTION</a>
58
+ <a href="#SYNOPSIS">SYNOPSIS</a>
59
+ <a href="#COMMANDS">COMMANDS</a>
60
+ <a href="#EXAMPLES">EXAMPLES</a>
61
+ <a href="#AUTHORS-CONTRIBUTORS">AUTHORS / CONTRIBUTORS</a>
62
+ <a href="#WWW">WWW</a>
63
+ </div>
64
+
65
+ <ol class='man-decor man-head man head'>
66
+ <li class='tl'>guard(1)</li>
67
+ <li class='tc'></li>
68
+ <li class='tr'>guard(1)</li>
69
+ </ol>
70
+
71
+ <h2 id="NAME">NAME</h2>
72
+ <p class="man-name">
73
+ <code>guard</code> - <span class="man-whatis">Guard keeps an eye on your file modifications.</span>
74
+ </p>
75
+
76
+ <h2 id="DESCRIPTION">DESCRIPTION</h2>
77
+
78
+ <p>Guard is a command line tool that easily handle events on files modifications.</p>
79
+
80
+ <h2 id="SYNOPSIS">SYNOPSIS</h2>
81
+
82
+ <p><code>guard &lt;COMMAND> &lt;OPTIONS></code></p>
83
+
84
+ <h2 id="COMMANDS">COMMANDS</h2>
85
+
86
+ <h3 id="start">start</h3>
87
+
88
+ <p>Starts Guard. This is the default command if none is provided.</p>
89
+
90
+ <p>The following options are available:</p>
91
+
92
+ <p><code>-c</code>, <code>--clear</code>
93
+ Clears the Shell after each change.</p>
94
+
95
+ <p><code>-n</code>, <code>--notify</code> <var>FLAG</var>
96
+ Disable notifications (Growl or Libnotify depending on your system).
97
+ Notifications can be disabled globally by setting a GUARD_NOTIFY environment variable to false.
98
+ FLAG can be <code>true</code>/<code>false</code> or <code>t</code>/<code>f</code>.</p>
99
+
100
+ <p><code>-d</code>, <code>--debug</code>
101
+ Runs Guard in debug mode.</p>
102
+
103
+ <p><code>-g</code>, <code>--group</code> <var>GROUP1</var> <var>GROUP2</var>...
104
+ Runs only the groups specified by GROUP1, GROUP2 etc.
105
+ Groups name should be separated by spaces.
106
+ Guards that don't belong to a group are considered global and are always run.</p>
107
+
108
+ <p><code>-w</code>, <code>--watchdir</code> <var>PATH</var>
109
+ Tells Guard to watch PATH instead of <code>./</code>.</p>
110
+
111
+ <p><code>-G</code>, <code>--guardfile</code> <var>FILE</var>
112
+ Tells Guard to use FILE as its Guardfile instead of <code>./Guardfile</code> or <code>~/.Guardfile</code>.</p>
113
+
114
+ <p><code>-A</code>, <code>--watch-all-modifications</code>
115
+ Watch all file modifications like moves or deletions with.</p>
116
+
117
+ <p><code>-i</code>, <code>--no-interactions</code>
118
+ Turn off completely any Guard terminal interactions.</p>
119
+
120
+ <h3 id="init-GUARD">init <a href="guard.html">GUARD</a></h3>
121
+
122
+ <p>If no Guardfile is present in the current directory, creates an empty Guardfile.</p>
123
+
124
+ <p>If <var>GUARD</var> is present, add its default Guardfile configuration to the current Guardfile.
125
+ Note that <var>GUARD</var> is the guard's name without the <code>guard-</code> prefix.
126
+ For instance to initialize guard-rspec, run <code>guard init rspec</code>.</p>
127
+
128
+ <h3 id="list">list</h3>
129
+
130
+ <p>Lists guards that can be used with the <code>init</code> command.</p>
131
+
132
+ <h3 id="-T-show">-T, show</h3>
133
+
134
+ <p>List defined groups and guards for the current Guardfile.</p>
135
+
136
+ <h3 id="-h-help-COMMAND-">-h, help [COMMAND]</h3>
137
+
138
+ <p>List all of Guard's available commands.</p>
139
+
140
+ <p>If <var>COMMAND</var> is given, displays a specific help for <var>TASK</var>.</p>
141
+
142
+ <h2 id="EXAMPLES">EXAMPLES</h2>
143
+
144
+ <p>Initialize Guard and a specific guard at the same time:</p>
145
+
146
+ <p><code>[bundle exec] guard init [rspec]</code></p>
147
+
148
+ <p>Run Guard:</p>
149
+
150
+ <p><code>[bundle exec] guard [start] --watchdir ~/dev --guardfile ~/env/Guardfile --clear --group backend frontend --notify false --debug</code></p>
151
+
152
+ <p>or in a more concise way:</p>
153
+
154
+ <p><code>[bundle exec] guard [start] -w ~/dev -G ~/env/Guardfile -c -g backend frontend -n f -d</code></p>
155
+
156
+ <h2 id="AUTHORS-CONTRIBUTORS">AUTHORS / CONTRIBUTORS</h2>
157
+
158
+ <p>Thibaud Guillaume-Gentil is the main author.</p>
159
+
160
+ <p>A list of contributors based on all commits can be found here:
161
+ https://github.com/guard/guard/contributors</p>
162
+
163
+ <p>For an exhaustive list of all the contributors, please see the CHANGELOG:
164
+ https://github.com/guard/guard/blob/master/CHANGELOG.md</p>
165
+
166
+ <p>This manual has been written by Remy Coutable.</p>
167
+
168
+ <h2 id="WWW">WWW</h2>
169
+
170
+ <p>https://github.com/guard/guard</p>
171
+
172
+
173
+ <ol class='man-decor man-foot man foot'>
174
+ <li class='tl'></li>
175
+ <li class='tc'>October 2011</li>
176
+ <li class='tr'>guard(1)</li>
177
+ </ol>
178
+
179
+ </div>
180
+ </body>
181
+ </html>