Permalink
Browse files

Support for precedence setting.

  • Loading branch information...
1 parent f74a3dd commit 50283628c759dadfa323d23a6cc8fe83757b3490 @skalee committed May 27, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/watchr/script.rb
View
2 lib/watchr/script.rb
@@ -261,7 +261,7 @@ def path
# rules corresponding to `path`
#
def rules_for(path)
- @rules.reverse.select {|rule| path.match(rule.pattern) }
+ (@precedence == :last_match ? @rules.reverse : @rules).select{ |rule| path.match(rule.pattern) }
end
# Make a path relative to current working directory.

0 comments on commit 5028362

Please sign in to comment.