Permalink
Browse files

Deprecations must be explicit enabled. (Closes #298)

Guard will not show any deprecation messages by default,
instead a plugin author has to explicit enable them by passing
`--show-deprecations` to Guard on startup.
  • Loading branch information...
1 parent fef1cb4 commit 23777b7b6152a8e0c497a12637ef2c5cd66e31b1 @netzpirat netzpirat committed Jul 2, 2012
Showing with 32 additions and 345 deletions.
  1. +1 −1 lib/guard.rb
  2. +5 −0 lib/guard/cli.rb
  3. +0 −69 man/guard
  4. +5 −2 man/guard.1
  5. +5 −2 man/guard.1.html
  6. +4 −1 man/guard.1.ronn
  7. +0 −270 man/guard.html
  8. +12 −0 spec/guard_spec.rb
View
@@ -60,7 +60,7 @@ def setup(options = {})
Dsl.evaluate_guardfile(options)
UI.error 'No guards found in Guardfile, please add at least one.' if @guards.empty?
- runner.deprecation_warning # Guard deprecation go here
+ runner.deprecation_warning if @options[:show_deprecations]
setup_notifier
setup_interactor
View
@@ -73,6 +73,11 @@ class CLI < Thor
:aliases => '-B',
:banner => 'Turn off warning when Bundler is not present'
+ method_option :show_deprecations,
+ :type => :boolean,
+ :default => false,
+ :banner => 'Turn on deprecation warnings'
+
# Listen options
method_option :latency,
:type => :numeric,
View
@@ -1,69 +0,0 @@
-.\" generated with Ronn/v0.7.3
-.\" http://github.com/rtomayko/ronn/tree/0.7.3
-.
-.TH "GUARD" "" "July 2012" "" ""
-.
-.SH "NAME"
-\fBguard\fR
-.
-.P
-\fI!DOCTYPE html\fR
-.
-.P
-.
-.P
-.
-.IP "" 4
-.
-.nf
-
-<a href="#NAME">NAME</a>
-.
-.fi
-.
-.IP "" 0
-.
-.P
-.
-.P
-.
-.IP "" 4
-.
-.nf
-
-<li class=\'tl\'>guard</li>
-<li class=\'tc\'></li>
-<li class=\'tr\'>guard</li>
-.
-.fi
-.
-.IP "" 0
-.
-.P
-.
-.P
-.
-.P
-\fBguard\fR
-.
-.P
-\&\.\e" generated with Ronn/v0\.7\.3 \.\e" http://github\.com/rtomayko/ronn/tree/0\.7\.3 \. \.TH "GUARD" "1" "December 2011" "" "" \. \.SH "NAME" \efBguard\efR \- Guard keeps an eye on your file modifications\. \. \.SH "DESCRIPTION" Guard is a command line tool that easily handle events on files modifications\. \. \.SH "SYNOPSIS" \efBguard \fICOMMAND\fR \fIOPTIONS\fR\efR \. \.SH "COMMANDS" \. \.SS "start" Starts Guard\. This is the default command if none is provided\. \. \.P The following options are available: \. \.P \efB\-c\efR, \efB\-\-clear\efR Clears the Shell after each change\. \. \.P \efB\-n\efR, \efB\-\-notify\efR \efIFLAG\efR 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 \efBtrue\efR/\efBfalse\efR or \efBt\efR/\efBf\efR\. \. \.P \efB\-d\efR, \efB\-\-debug\efR Runs Guard in debug mode\. \. \.P \efB\-g\efR, \efB\-\-group\efR \efIGROUP1\efR \efIGROUP2\efR\.\.\. Runs only the groups specified by GROUP1, GROUP2 etc\. Groups name should be separated by spaces\. Guards that don\e\'t belong to a group are considered global and are always run\. \. \.P \efB\-w\efR, \efB\-\-watchdir\efR \efIPATH\efR Tells Guard to watch PATH instead of \efB\./\efR\. \. \.P \efB\-G\efR, \efB\-\-guardfile\efR \efIFILE\efR Tells Guard to use FILE as its Guardfile instead of \efB\./Guardfile\efR or \efB~/\.Guardfile\efR\. \. \.P \efB\-A\efR, \efB\-\-watch\-all\-modifications\efR Watch all file modifications like moves or deletions with\. \. \.P \efB\-i\efR, \efB\-\-no\-interactions\efR Turn off completely any Guard terminal interactions\. \. \.SS "init [GUARD]" If no Guardfile is present in the current directory, creates an empty Guardfile\. \. \.P If \efIGUARD\efR is present, add its default Guardfile configuration to the current Guardfile\. Note that \efIGUARD\efR is the guard\e\'s name without the \efBguard\-\efR prefix\. For instance to initialize guard\-rspec, run \efBguard init rspec\efR\. \. \.SS "list" Lists guards that can be used with the \efBinit\efR command\. \. \.SS "\-T, show" List defined groups and guards for the current Guardfile\. \. \.SS "\-h, help [COMMAND]" List all of Guard\e\'s available commands\. \. \.P If \efICOMMAND\efR is given, displays a specific help for \efITASK\efR\. \. \.SH "EXAMPLES" Initialize Guard and a specific guard at the same time: \. \.P \efB[bundle exec] guard init [rspec]\efR \. \.P Run Guard: \. \.P \efB[bundle exec] guard [start] \-\-watchdir ~/dev \-\-guardfile ~/env/Guardfile \-\-clear \-\-group backend frontend \-\-notify false \-\-debug\efR \. \.P or in a more concise way: \. \.P \efB[bundle exec] guard [start] \-w ~/dev \-G ~/env/Guardfile \-c \-g backend frontend \-n f \-d\efR \. \.SH "AUTHORS / CONTRIBUTORS" Thibaud Guillaume\-Gentil is the main author\. \. \.P A list of contributors based on all commits can be found here: https://github\.com/guard/guard/contributors \. \.P For an exhaustive list of all the contributors, please see the CHANGELOG: https://github\.com/guard/guard/blob/master/CHANGELOG\.md \. \.P This manual has been written by Remy Coutable\. \. \.SH "WWW" https://github\.com/guard/guard
-.
-.P
-.
-.IP "" 4
-.
-.nf
-
-<li class=\'tl\'></li>
-<li class=\'tc\'>June 2012</li>
-<li class=\'tr\'>guard</li>
-.
-.fi
-.
-.IP "" 0
-.
-.P
-.
-.P
-
View
@@ -45,12 +45,15 @@ The following options are available:
\fB\-B\fR, \fB\-\-no\-bundler\-warning\fR Turn off warning when Bundler is not present\.
.
.P
+\fB\-\-show\-deprecations\fR Turn on deprecation warnings\.
+.
+.P
\fB\-l\fR, \fB\-\-latency\fR Overwrite Listen\'s default latency\.
.
.P
-\fB\-p\fR, \fB\-\-force\-pollingg\fR Force usage of the Listen polling listener\.
+\fB\-p\fR, \fB\-\-force\-polling\fR Force usage of the Listen polling listener\.
.
-.SS "init <a href=\"guard\.html\">GUARD</a>"
+.SS "init [GUARD]"
If no Guardfile is present in the current directory, creates an empty Guardfile\.
.
.P
View
@@ -117,13 +117,16 @@ <h3 id="start">start</h3>
<p><code>-B</code>, <code>--no-bundler-warning</code>
Turn off warning when Bundler is not present.</p>
+<p><code>--show-deprecations</code>
+ Turn on deprecation warnings.</p>
+
<p><code>-l</code>, <code>--latency</code>
Overwrite Listen's default latency.</p>
-<p><code>-p</code>, <code>--force-pollingg</code>
+<p><code>-p</code>, <code>--force-polling</code>
Force usage of the Listen polling listener.</p>
-<h3 id="init-GUARD">init <a href="guard.html">GUARD</a></h3>
+<h3 id="init-GUARD-">init [GUARD]</h3>
<p>If no Guardfile is present in the current directory, creates an empty Guardfile.</p>
View
@@ -45,10 +45,13 @@ The following options are available:
`-B`, `--no-bundler-warning`
Turn off warning when Bundler is not present.
+`--show-deprecations`
+ Turn on deprecation warnings.
+
`-l`, `--latency`
Overwrite Listen's default latency.
-`-p`, `--force-pollingg`
+`-p`, `--force-polling`
Force usage of the Listen polling listener.
### init [GUARD]
Oops, something went wrong.

0 comments on commit 23777b7

Please sign in to comment.