Permalink
Browse files

Update the `filter` and `ignore` README section. (Closes #309)

Use @Maher4Ever words from #309, where he explains the different
purposes of the `filter` and `ignore` DSL methods. [ci skip]
  • Loading branch information...
1 parent d68b9d7 commit a3220bd5ae20116c5d17fd4843d1f1c7adf69de0 @netzpirat netzpirat committed Aug 3, 2012
Showing with 16 additions and 5 deletions.
  1. +16 −5 README.md
View
@@ -680,18 +680,29 @@ more details.
### ignore
-The `ignore` method allows you to ignore specific paths. This comes in handy when you have large
-amounts of non-source data in you project. By default [`.rbx`, `.bundle`, `.git`, `.svn`, `log`, `tmp`, `vendor`](https://github.com/guard/listen/blob/master/lib/listen/directory_record.rb#L14) are ignored.
-Please note that method only accept regexps. More on the [Listen README](https://github.com/guard/listen#the-patterns-for-filtering-and-ignoring-paths).
+The `ignore` method can be used to exclude files and directories from the set of files being watched. Let's say you have
+used the `watch` method to monitor a directory, but you are not interested in changes happening to images, you could use
+the ignore method to exclude them.
+
+This comes in handy when you have large amounts of non-source data in you project. By default
+[`.rbx`, `.bundle`, `.git`, `.svn`, `log`, `tmp`, `vendor`](https://github.com/guard/listen/blob/master/lib/listen/directory_record.rb#L14)
+are ignored.
+
+Please note that method only accept regexps. More on the
+[Listen README](https://github.com/guard/listen#the-patterns-for-filtering-and-ignoring-paths).
```ruby
ignore %r{^ignored/path/}, /public/
```
### filter
-The `filter` method allows you to filter specific paths.
-Please note that method only accept regexps. More on the [Listen README](https://github.com/guard/listen#the-patterns-for-filtering-and-ignoring-paths).
+The `filter` method allows you to focus by filtering files and directories without having to specify them by hand in the
+`watch` method. E.g. if you are watching multiple directories but only interested in changes to the Ruby files, then use
+the `filter` method.
+
+Please note that method only accept regexps. More on the
+[Listen README](https://github.com/guard/listen#the-patterns-for-filtering-and-ignoring-paths).
```ruby
filter /\.txt$/, /.*\.zip/

0 comments on commit a3220bd

Please sign in to comment.