guard 0.8.0 → 0.8.1
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.
- data/CHANGELOG.md +310 -303
- data/LICENSE +19 -19
- data/README.md +434 -434
- data/bin/guard +6 -6
- data/lib/guard.rb +384 -384
- data/lib/guard/cli.rb +178 -179
- data/lib/guard/dsl.rb +370 -370
- data/lib/guard/dsl_describer.rb +60 -60
- data/lib/guard/group.rb +22 -22
- data/lib/guard/guard.rb +98 -98
- data/lib/guard/hook.rb +118 -118
- data/lib/guard/interactor.rb +78 -78
- data/lib/guard/listener.rb +346 -346
- data/lib/guard/listeners/darwin.rb +66 -66
- data/lib/guard/listeners/linux.rb +98 -98
- data/lib/guard/listeners/polling.rb +55 -55
- data/lib/guard/listeners/windows.rb +61 -61
- data/lib/guard/notifier.rb +211 -211
- data/lib/guard/templates/Guardfile +2 -2
- data/lib/guard/ui.rb +188 -188
- data/lib/guard/version.rb +6 -6
- data/lib/guard/watcher.rb +110 -110
- data/man/guard.1 +93 -93
- data/man/guard.1.html +176 -176
- metadata +15 -15
data/lib/guard/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
module Guard
|
2
|
-
unless defined? Guard::VERSION
|
3
|
-
# The current gem version of Guard
|
4
|
-
VERSION = '0.8.
|
5
|
-
end
|
6
|
-
end
|
1
|
+
module Guard
|
2
|
+
unless defined? Guard::VERSION
|
3
|
+
# The current gem version of Guard
|
4
|
+
VERSION = '0.8.1'
|
5
|
+
end
|
6
|
+
end
|
data/lib/guard/watcher.rb
CHANGED
@@ -1,110 +1,110 @@
|
|
1
|
-
module Guard
|
2
|
-
|
3
|
-
# The watcher defines a RegExp that will be matched against file system modifications.
|
4
|
-
# When a watcher matches a change, an optional action block is executed to enable
|
5
|
-
# processing the file system change result.
|
6
|
-
#
|
7
|
-
class Watcher
|
8
|
-
|
9
|
-
attr_accessor :pattern, :action
|
10
|
-
|
11
|
-
# Initialize a file watcher.
|
12
|
-
#
|
13
|
-
# @param [String, Regexp] pattern the pattern to be watched by the guard
|
14
|
-
# @param [Block] action the action to execute before passing the result to the Guard
|
15
|
-
#
|
16
|
-
def initialize(pattern, action = nil)
|
17
|
-
@pattern, @action = pattern, action
|
18
|
-
@@warning_printed ||= false
|
19
|
-
|
20
|
-
# deprecation warning
|
21
|
-
if @pattern.is_a?(String) && @pattern =~ /(^(\^))|(>?(\\\.)|(\.\*))|(\(.*\))|(\[.*\])|(\$$)/
|
22
|
-
unless @@warning_printed
|
23
|
-
UI.info "*"*20 + "\nDEPRECATION WARNING!\n" + "*"*20
|
24
|
-
UI.info <<-MSG
|
25
|
-
You have a string in your Guardfile watch patterns that seem to represent a Regexp.
|
26
|
-
Guard matches String with == and Regexp with Regexp#match.
|
27
|
-
You should either use plain String (without Regexp special characters) or real Regexp.
|
28
|
-
MSG
|
29
|
-
@@warning_printed = true
|
30
|
-
end
|
31
|
-
|
32
|
-
UI.info "\"#{@pattern}\" has been converted to #{ Regexp.new(@pattern).inspect }\n"
|
33
|
-
@pattern = Regexp.new(@pattern)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
# Finds the files that matches a Guard.
|
38
|
-
#
|
39
|
-
# @param [Guard::Guard] guard the guard which watchers are used
|
40
|
-
# @param [Array<String>] files the changed files
|
41
|
-
# @return [Array<String>] the matched files
|
42
|
-
#
|
43
|
-
def self.match_files(guard, files)
|
44
|
-
guard.watchers.inject([]) do |paths, watcher|
|
45
|
-
files.each do |file|
|
46
|
-
if matches = watcher.match_file?(file)
|
47
|
-
if watcher.action
|
48
|
-
result = watcher.call_action(matches)
|
49
|
-
paths << Array(result) if result.respond_to?(:empty?) && !result.empty?
|
50
|
-
else
|
51
|
-
paths << matches[0]
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
paths.flatten.map { |p| p.to_s }
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
# Test if a file would be matched by any of the Guards watchers.
|
61
|
-
#
|
62
|
-
# @param [Array<Guard::Guard>] guards the guards to use the watchers from
|
63
|
-
# @param [Array<String>] files the files to test
|
64
|
-
# @return [Boolean] Whether a file matches
|
65
|
-
#
|
66
|
-
def self.match_files?(guards, files)
|
67
|
-
guards.any? do |guard|
|
68
|
-
guard.watchers.any? do |watcher|
|
69
|
-
files.any? { |file| watcher.match_file?(file) }
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
# Test the watchers pattern against a file.
|
75
|
-
#
|
76
|
-
# @param [String] file the file to test
|
77
|
-
# @return [Boolean] whether the given file is matched
|
78
|
-
#
|
79
|
-
def match_file?(file)
|
80
|
-
if @pattern.is_a?(Regexp)
|
81
|
-
file.match(@pattern)
|
82
|
-
else
|
83
|
-
file == @pattern ? [file] : nil
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
# Test if any of the files is the Guardfile.
|
88
|
-
#
|
89
|
-
# @param [Array<String>] the files to test
|
90
|
-
# @return [Boolean] whether one of these files is the Guardfile
|
91
|
-
#
|
92
|
-
def self.match_guardfile?(files)
|
93
|
-
files.any? { |file| "#{ Dir.pwd }/#{ file }" == Dsl.guardfile_path }
|
94
|
-
end
|
95
|
-
|
96
|
-
# Executes a watcher action.
|
97
|
-
#
|
98
|
-
# @param [String, MatchData] the matched path or the match from the Regex
|
99
|
-
# @return [String] the final paths
|
100
|
-
#
|
101
|
-
def call_action(matches)
|
102
|
-
begin
|
103
|
-
@action.arity > 0 ? @action.call(matches) : @action.call
|
104
|
-
rescue Exception => e
|
105
|
-
UI.error "Problem with watch action!\n#{ e.message }\n\n#{ e.backtrace.join("\n") }"
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
end
|
110
|
-
end
|
1
|
+
module Guard
|
2
|
+
|
3
|
+
# The watcher defines a RegExp that will be matched against file system modifications.
|
4
|
+
# When a watcher matches a change, an optional action block is executed to enable
|
5
|
+
# processing the file system change result.
|
6
|
+
#
|
7
|
+
class Watcher
|
8
|
+
|
9
|
+
attr_accessor :pattern, :action
|
10
|
+
|
11
|
+
# Initialize a file watcher.
|
12
|
+
#
|
13
|
+
# @param [String, Regexp] pattern the pattern to be watched by the guard
|
14
|
+
# @param [Block] action the action to execute before passing the result to the Guard
|
15
|
+
#
|
16
|
+
def initialize(pattern, action = nil)
|
17
|
+
@pattern, @action = pattern, action
|
18
|
+
@@warning_printed ||= false
|
19
|
+
|
20
|
+
# deprecation warning
|
21
|
+
if @pattern.is_a?(String) && @pattern =~ /(^(\^))|(>?(\\\.)|(\.\*))|(\(.*\))|(\[.*\])|(\$$)/
|
22
|
+
unless @@warning_printed
|
23
|
+
UI.info "*"*20 + "\nDEPRECATION WARNING!\n" + "*"*20
|
24
|
+
UI.info <<-MSG
|
25
|
+
You have a string in your Guardfile watch patterns that seem to represent a Regexp.
|
26
|
+
Guard matches String with == and Regexp with Regexp#match.
|
27
|
+
You should either use plain String (without Regexp special characters) or real Regexp.
|
28
|
+
MSG
|
29
|
+
@@warning_printed = true
|
30
|
+
end
|
31
|
+
|
32
|
+
UI.info "\"#{@pattern}\" has been converted to #{ Regexp.new(@pattern).inspect }\n"
|
33
|
+
@pattern = Regexp.new(@pattern)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# Finds the files that matches a Guard.
|
38
|
+
#
|
39
|
+
# @param [Guard::Guard] guard the guard which watchers are used
|
40
|
+
# @param [Array<String>] files the changed files
|
41
|
+
# @return [Array<String>] the matched files
|
42
|
+
#
|
43
|
+
def self.match_files(guard, files)
|
44
|
+
guard.watchers.inject([]) do |paths, watcher|
|
45
|
+
files.each do |file|
|
46
|
+
if matches = watcher.match_file?(file)
|
47
|
+
if watcher.action
|
48
|
+
result = watcher.call_action(matches)
|
49
|
+
paths << Array(result) if result.respond_to?(:empty?) && !result.empty?
|
50
|
+
else
|
51
|
+
paths << matches[0]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
paths.flatten.map { |p| p.to_s }
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# Test if a file would be matched by any of the Guards watchers.
|
61
|
+
#
|
62
|
+
# @param [Array<Guard::Guard>] guards the guards to use the watchers from
|
63
|
+
# @param [Array<String>] files the files to test
|
64
|
+
# @return [Boolean] Whether a file matches
|
65
|
+
#
|
66
|
+
def self.match_files?(guards, files)
|
67
|
+
guards.any? do |guard|
|
68
|
+
guard.watchers.any? do |watcher|
|
69
|
+
files.any? { |file| watcher.match_file?(file) }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Test the watchers pattern against a file.
|
75
|
+
#
|
76
|
+
# @param [String] file the file to test
|
77
|
+
# @return [Boolean] whether the given file is matched
|
78
|
+
#
|
79
|
+
def match_file?(file)
|
80
|
+
if @pattern.is_a?(Regexp)
|
81
|
+
file.match(@pattern)
|
82
|
+
else
|
83
|
+
file == @pattern ? [file] : nil
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Test if any of the files is the Guardfile.
|
88
|
+
#
|
89
|
+
# @param [Array<String>] the files to test
|
90
|
+
# @return [Boolean] whether one of these files is the Guardfile
|
91
|
+
#
|
92
|
+
def self.match_guardfile?(files)
|
93
|
+
files.any? { |file| "#{ Dir.pwd }/#{ file }" == Dsl.guardfile_path }
|
94
|
+
end
|
95
|
+
|
96
|
+
# Executes a watcher action.
|
97
|
+
#
|
98
|
+
# @param [String, MatchData] the matched path or the match from the Regex
|
99
|
+
# @return [String] the final paths
|
100
|
+
#
|
101
|
+
def call_action(matches)
|
102
|
+
begin
|
103
|
+
@action.arity > 0 ? @action.call(matches) : @action.call
|
104
|
+
rescue Exception => e
|
105
|
+
UI.error "Problem with watch action!\n#{ e.message }\n\n#{ e.backtrace.join("\n") }"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
end
|
data/man/guard.1
CHANGED
@@ -1,93 +1,93 @@
|
|
1
|
-
.\" generated with Ronn/v0.7.3
|
2
|
-
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
-
.
|
4
|
-
.TH "GUARD" "1" "September 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
|
37
|
-
.
|
38
|
-
.P
|
39
|
-
Tells Guard to watch PATH instead of \fB\./\fR\.
|
40
|
-
.
|
41
|
-
.P
|
42
|
-
\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\.
|
43
|
-
.
|
44
|
-
.SS "init [GUARD]"
|
45
|
-
If no Guardfile is present in the current directory, creates an empty Guardfile\.
|
46
|
-
.
|
47
|
-
.P
|
48
|
-
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\.
|
49
|
-
.
|
50
|
-
.SS "list"
|
51
|
-
Lists guards that can be used with the \fBinit\fR command\.
|
52
|
-
.
|
53
|
-
.SS "\-T, show"
|
54
|
-
List defined groups and guards for the current Guardfile\.
|
55
|
-
.
|
56
|
-
.SS "\-h, help [COMMAND]"
|
57
|
-
List all of Guard\'s available commands\.
|
58
|
-
.
|
59
|
-
.P
|
60
|
-
If \fICOMMAND\fR is given, displays a specific help for \fITASK\fR\.
|
61
|
-
.
|
62
|
-
.SH "EXAMPLES"
|
63
|
-
Initialize Guard and a specific guard at the same time:
|
64
|
-
.
|
65
|
-
.P
|
66
|
-
\fB[bundle exec] guard init [rspec]\fR
|
67
|
-
.
|
68
|
-
.P
|
69
|
-
Run Guard:
|
70
|
-
.
|
71
|
-
.P
|
72
|
-
\fB[bundle exec] guard [start] \-\-watchdir ~/dev \-\-guardfile ~/env/Guardfile \-\-clear \-\-group backend frontend \-\-notify false \-\-debug\fR
|
73
|
-
.
|
74
|
-
.P
|
75
|
-
or in a more concise way:
|
76
|
-
.
|
77
|
-
.P
|
78
|
-
\fB[bundle exec] guard [start] \-w ~/dev \-G ~/env/Guardfile \-c \-g backend frontend \-n f \-d\fR
|
79
|
-
.
|
80
|
-
.SH "AUTHORS / CONTRIBUTORS"
|
81
|
-
Thibaud Guillaume\-Gentil is the main author\.
|
82
|
-
.
|
83
|
-
.P
|
84
|
-
A list of contributors based on all commits can be found here: https://github\.com/guard/guard/contributors
|
85
|
-
.
|
86
|
-
.P
|
87
|
-
For an exhaustive list of all the contributors, please see the CHANGELOG: https://github\.com/guard/guard/blob/master/CHANGELOG\.md
|
88
|
-
.
|
89
|
-
.P
|
90
|
-
This manual has been written by Remy Coutable\.
|
91
|
-
.
|
92
|
-
.SH "WWW"
|
93
|
-
https://github\.com/guard/guard
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "GUARD" "1" "September 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
|
37
|
+
.
|
38
|
+
.P
|
39
|
+
Tells Guard to watch PATH instead of \fB\./\fR\.
|
40
|
+
.
|
41
|
+
.P
|
42
|
+
\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\.
|
43
|
+
.
|
44
|
+
.SS "init [GUARD]"
|
45
|
+
If no Guardfile is present in the current directory, creates an empty Guardfile\.
|
46
|
+
.
|
47
|
+
.P
|
48
|
+
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\.
|
49
|
+
.
|
50
|
+
.SS "list"
|
51
|
+
Lists guards that can be used with the \fBinit\fR command\.
|
52
|
+
.
|
53
|
+
.SS "\-T, show"
|
54
|
+
List defined groups and guards for the current Guardfile\.
|
55
|
+
.
|
56
|
+
.SS "\-h, help [COMMAND]"
|
57
|
+
List all of Guard\'s available commands\.
|
58
|
+
.
|
59
|
+
.P
|
60
|
+
If \fICOMMAND\fR is given, displays a specific help for \fITASK\fR\.
|
61
|
+
.
|
62
|
+
.SH "EXAMPLES"
|
63
|
+
Initialize Guard and a specific guard at the same time:
|
64
|
+
.
|
65
|
+
.P
|
66
|
+
\fB[bundle exec] guard init [rspec]\fR
|
67
|
+
.
|
68
|
+
.P
|
69
|
+
Run Guard:
|
70
|
+
.
|
71
|
+
.P
|
72
|
+
\fB[bundle exec] guard [start] \-\-watchdir ~/dev \-\-guardfile ~/env/Guardfile \-\-clear \-\-group backend frontend \-\-notify false \-\-debug\fR
|
73
|
+
.
|
74
|
+
.P
|
75
|
+
or in a more concise way:
|
76
|
+
.
|
77
|
+
.P
|
78
|
+
\fB[bundle exec] guard [start] \-w ~/dev \-G ~/env/Guardfile \-c \-g backend frontend \-n f \-d\fR
|
79
|
+
.
|
80
|
+
.SH "AUTHORS / CONTRIBUTORS"
|
81
|
+
Thibaud Guillaume\-Gentil is the main author\.
|
82
|
+
.
|
83
|
+
.P
|
84
|
+
A list of contributors based on all commits can be found here: https://github\.com/guard/guard/contributors
|
85
|
+
.
|
86
|
+
.P
|
87
|
+
For an exhaustive list of all the contributors, please see the CHANGELOG: https://github\.com/guard/guard/blob/master/CHANGELOG\.md
|
88
|
+
.
|
89
|
+
.P
|
90
|
+
This manual has been written by Remy Coutable\.
|
91
|
+
.
|
92
|
+
.SH "WWW"
|
93
|
+
https://github\.com/guard/guard
|
data/man/guard.1.html
CHANGED
@@ -1,176 +1,176 @@
|
|
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 <COMMAND> <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></p>
|
109
|
-
|
110
|
-
<p>Tells Guard to watch PATH instead of <code>./</code>.</p>
|
111
|
-
|
112
|
-
<p><code>-G</code>, <code>--guardfile</code> <var>FILE</var>
|
113
|
-
Tells Guard to use FILE as its Guardfile instead of <code>./Guardfile</code> or <code>~/.Guardfile</code>.</p>
|
114
|
-
|
115
|
-
<h3 id="init-GUARD-">init [GUARD]</h3>
|
116
|
-
|
117
|
-
<p>If no Guardfile is present in the current directory, creates an empty Guardfile.</p>
|
118
|
-
|
119
|
-
<p>If <var>GUARD</var> is present, add its default Guardfile configuration to the current Guardfile.
|
120
|
-
Note that <var>GUARD</var> is the guard's name without the <code>guard-</code> prefix.
|
121
|
-
For instance to initialize guard-rspec, run <code>guard init rspec</code>.</p>
|
122
|
-
|
123
|
-
<h3 id="list">list</h3>
|
124
|
-
|
125
|
-
<p>Lists guards that can be used with the <code>init</code> command.</p>
|
126
|
-
|
127
|
-
<h3 id="-T-show">-T, show</h3>
|
128
|
-
|
129
|
-
<p>List defined groups and guards for the current Guardfile.</p>
|
130
|
-
|
131
|
-
<h3 id="-h-help-COMMAND-">-h, help [COMMAND]</h3>
|
132
|
-
|
133
|
-
<p>List all of Guard's available commands.</p>
|
134
|
-
|
135
|
-
<p>If <var>COMMAND</var> is given, displays a specific help for <var>TASK</var>.</p>
|
136
|
-
|
137
|
-
<h2 id="EXAMPLES">EXAMPLES</h2>
|
138
|
-
|
139
|
-
<p>Initialize Guard and a specific guard at the same time:</p>
|
140
|
-
|
141
|
-
<p><code>[bundle exec] guard init [rspec]</code></p>
|
142
|
-
|
143
|
-
<p>Run Guard:</p>
|
144
|
-
|
145
|
-
<p><code>[bundle exec] guard [start] --watchdir ~/dev --guardfile ~/env/Guardfile --clear --group backend frontend --notify false --debug</code></p>
|
146
|
-
|
147
|
-
<p>or in a more concise way:</p>
|
148
|
-
|
149
|
-
<p><code>[bundle exec] guard [start] -w ~/dev -G ~/env/Guardfile -c -g backend frontend -n f -d</code></p>
|
150
|
-
|
151
|
-
<h2 id="AUTHORS-CONTRIBUTORS">AUTHORS / CONTRIBUTORS</h2>
|
152
|
-
|
153
|
-
<p>Thibaud Guillaume-Gentil is the main author.</p>
|
154
|
-
|
155
|
-
<p>A list of contributors based on all commits can be found here:
|
156
|
-
https://github.com/guard/guard/contributors</p>
|
157
|
-
|
158
|
-
<p>For an exhaustive list of all the contributors, please see the CHANGELOG:
|
159
|
-
https://github.com/guard/guard/blob/master/CHANGELOG.md</p>
|
160
|
-
|
161
|
-
<p>This manual has been written by Remy Coutable.</p>
|
162
|
-
|
163
|
-
<h2 id="WWW">WWW</h2>
|
164
|
-
|
165
|
-
<p>https://github.com/guard/guard</p>
|
166
|
-
|
167
|
-
|
168
|
-
<ol class='man-decor man-foot man foot'>
|
169
|
-
<li class='tl'></li>
|
170
|
-
<li class='tc'>September 2011</li>
|
171
|
-
<li class='tr'>guard(1)</li>
|
172
|
-
</ol>
|
173
|
-
|
174
|
-
</div>
|
175
|
-
</body>
|
176
|
-
</html>
|
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 <COMMAND> <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></p>
|
109
|
+
|
110
|
+
<p>Tells Guard to watch PATH instead of <code>./</code>.</p>
|
111
|
+
|
112
|
+
<p><code>-G</code>, <code>--guardfile</code> <var>FILE</var>
|
113
|
+
Tells Guard to use FILE as its Guardfile instead of <code>./Guardfile</code> or <code>~/.Guardfile</code>.</p>
|
114
|
+
|
115
|
+
<h3 id="init-GUARD-">init [GUARD]</h3>
|
116
|
+
|
117
|
+
<p>If no Guardfile is present in the current directory, creates an empty Guardfile.</p>
|
118
|
+
|
119
|
+
<p>If <var>GUARD</var> is present, add its default Guardfile configuration to the current Guardfile.
|
120
|
+
Note that <var>GUARD</var> is the guard's name without the <code>guard-</code> prefix.
|
121
|
+
For instance to initialize guard-rspec, run <code>guard init rspec</code>.</p>
|
122
|
+
|
123
|
+
<h3 id="list">list</h3>
|
124
|
+
|
125
|
+
<p>Lists guards that can be used with the <code>init</code> command.</p>
|
126
|
+
|
127
|
+
<h3 id="-T-show">-T, show</h3>
|
128
|
+
|
129
|
+
<p>List defined groups and guards for the current Guardfile.</p>
|
130
|
+
|
131
|
+
<h3 id="-h-help-COMMAND-">-h, help [COMMAND]</h3>
|
132
|
+
|
133
|
+
<p>List all of Guard's available commands.</p>
|
134
|
+
|
135
|
+
<p>If <var>COMMAND</var> is given, displays a specific help for <var>TASK</var>.</p>
|
136
|
+
|
137
|
+
<h2 id="EXAMPLES">EXAMPLES</h2>
|
138
|
+
|
139
|
+
<p>Initialize Guard and a specific guard at the same time:</p>
|
140
|
+
|
141
|
+
<p><code>[bundle exec] guard init [rspec]</code></p>
|
142
|
+
|
143
|
+
<p>Run Guard:</p>
|
144
|
+
|
145
|
+
<p><code>[bundle exec] guard [start] --watchdir ~/dev --guardfile ~/env/Guardfile --clear --group backend frontend --notify false --debug</code></p>
|
146
|
+
|
147
|
+
<p>or in a more concise way:</p>
|
148
|
+
|
149
|
+
<p><code>[bundle exec] guard [start] -w ~/dev -G ~/env/Guardfile -c -g backend frontend -n f -d</code></p>
|
150
|
+
|
151
|
+
<h2 id="AUTHORS-CONTRIBUTORS">AUTHORS / CONTRIBUTORS</h2>
|
152
|
+
|
153
|
+
<p>Thibaud Guillaume-Gentil is the main author.</p>
|
154
|
+
|
155
|
+
<p>A list of contributors based on all commits can be found here:
|
156
|
+
https://github.com/guard/guard/contributors</p>
|
157
|
+
|
158
|
+
<p>For an exhaustive list of all the contributors, please see the CHANGELOG:
|
159
|
+
https://github.com/guard/guard/blob/master/CHANGELOG.md</p>
|
160
|
+
|
161
|
+
<p>This manual has been written by Remy Coutable.</p>
|
162
|
+
|
163
|
+
<h2 id="WWW">WWW</h2>
|
164
|
+
|
165
|
+
<p>https://github.com/guard/guard</p>
|
166
|
+
|
167
|
+
|
168
|
+
<ol class='man-decor man-foot man foot'>
|
169
|
+
<li class='tl'></li>
|
170
|
+
<li class='tc'>September 2011</li>
|
171
|
+
<li class='tr'>guard(1)</li>
|
172
|
+
</ol>
|
173
|
+
|
174
|
+
</div>
|
175
|
+
</body>
|
176
|
+
</html>
|