Skip to content
Browse files

Rename Guard::Dsl.revaluate_guardfile to Guard::Dsl.reevaludate_guard…

…file
  • Loading branch information...
1 parent 48057cb commit 1481604411fab6449b89539dfbf7b0c8497f5148 Rémy Coutable committed
Showing with 7 additions and 5 deletions.
  1. +1 −0 CHANGELOG.md
  2. +2 −2 lib/guard.rb
  3. +2 −1 lib/guard/dsl.rb
  4. +2 −2 spec/guard/dsl_spec.rb
View
1 CHANGELOG.md
@@ -6,6 +6,7 @@
## Improvements
+- `Guard::Dsl.revaluate_guardfile` has been renamed to `Guard::Dsl.reevaluate_guardfile`. ([@rymai][])
- New CLI options: ([@nestegg][])
- `watchdir`/`-w` to specify the directory in which Guard should watch for changes,
- `guardfile`/`-G` to specify an alternate location for the Guardfile to use.
View
4 lib/guard.rb
@@ -19,18 +19,18 @@ def setup(options = {})
@options[:notify] && ENV["GUARD_NOTIFY"] != 'false' ? Notifier.turn_on : Notifier.turn_off
+ UI.clear if @options[:clear]
self
end
def start(options = {})
- UI.clear if options[:clear]
setup(options)
Interactor.init_signal_traps
Dsl.evaluate_guardfile(options)
listener.on_change do |files|
- Dsl.revaluate_guardfile if Watcher.match_guardfile?(files)
+ Dsl.reevaluate_guardfile if Watcher.match_guardfile?(files)
run { run_on_change_for_all_guards(files) } if Watcher.match_files?(guards, files)
end
View
3 lib/guard/dsl.rb
@@ -12,7 +12,7 @@ def evaluate_guardfile(options = {})
UI.error "No guards found in Guardfile, please add at least one." if !::Guard.guards.nil? && ::Guard.guards.empty?
end
- def revaluate_guardfile
+ def reevaluate_guardfile
::Guard.guards.clear
Dsl.evaluate_guardfile(@@options)
msg = "Guardfile has been re-evaluated."
@@ -50,6 +50,7 @@ def fetch_guardfile_contents
@@options[:guardfile_path] = 'Inline Guardfile'
elsif @@options.has_key?(:guardfile)
+ UI.debug File.exist?(@@options[:guardfile])
if File.exist?(@@options[:guardfile])
read_guardfile(@@options[:guardfile])
UI.info "Using Guardfile at #{@@options[:guardfile]}."
View
4 spec/guard/dsl_spec.rb
@@ -127,7 +127,7 @@
lambda { subject.evaluate_guardfile(:guardfile_contents => invalid_guardfile_string ) }.should raise_error
end
- describe ".revaluate_guardfile" do
+ describe ".reevaluate_guardfile" do
before(:each) { ::Guard::Dsl.stub!(:instance_eval_guardfile) }
it "resets already definded guards before calling evaluate_guardfile" do
@@ -135,7 +135,7 @@
subject.evaluate_guardfile(:guardfile_contents => invalid_guardfile_string)
::Guard.guards.should_not be_empty
::Guard::Dsl.should_receive(:evaluate_guardfile)
- subject.revaluate_guardfile
+ subject.reevaluate_guardfile
::Guard.guards.should be_empty
end
end

0 comments on commit 1481604

Please sign in to comment.
Something went wrong with that request. Please try again.