README.md in imap_guard-1.0.0 vs README.md in imap_guard-1.2.0
- old
+ new
@@ -1,16 +1,14 @@
-# ImapGuard [](https://travis-ci.org/infertux/imap_guard) [](https://gemnasium.com/infertux/imap_guard) [](https://codeclimate.com/github/infertux/imap_guard)
+# ImapGuard
+[](https://badge.fury.io/rb/imap_guard)
+[](https://travis-ci.org/infertux/imap_guard)
+[](https://codeclimate.com/github/infertux/imap_guard)
+[](http://inch-ci.org/github/infertux/imap_guard)
+
**A guard for your IMAP mailboxes.**
- * [Source Code](https://github.com/infertux/imap_guard "Source Code on Github")
- * [Bug Tracker](https://github.com/infertux/imap_guard/issues "Bug Tracker on Github")
- * [API documentation](http://rubydoc.info/gems/imap_guard/frames "API Documentation on Rubydoc")
- * [Rubygem](https://rubygems.org/gems/imap_guard "ImapGuard on Rubygems")
- * [Continuous Integration](https://travis-ci.org/infertux/imap_guard "ImapGuard on Travis-CI")
- * [Dependencies](https://gemnasium.com/infertux/imap_guard "ImapGuard dependencies on Gemnasium")
-
ImapGuard connects to your IMAP server and processes your emails.
You can finely pick them thanks to advanced search queries and Ruby blocks.
Then you can `move` or `delete` them in batch.
Of course, there is a _dry-run_ mode (i.e. read-only) available to double check what it would do.
@@ -68,32 +66,32 @@
mail.multipart? and \
mail.parts.length == 2
end
```
-Finally, you can always forge your own raw IMAP search queries (the [RFC](http://tools.ietf.org/html/rfc3501#section-6.4.4) can help in that case):
+You can always forge your own raw IMAP search queries (the [RFC](http://tools.ietf.org/html/rfc3501#section-6.4.4) can help in that case):
```ruby
query = 'SEEN SUBJECT "ALERT" FROM "root"'
guard.delete query do |mail|
mail.body == "ALERT"
end
```
-Be aware that emails won't be touched until you `expunge` or `close` the mailbox:
+There is a `move` method as well:
```ruby
-guard.expunge # effectively delete emails marked as deleted
-guard.close # expunge then close the connection
+guard.move query, 'destination_folder' do |mail|
+ # and it can take a filter block like `delete`
+end
```
-Oh, and there is a `move` method as well:
+Finally, this should be handled automatically but you can explicitly expunge pending emails and close the connection:
```ruby
-guard.move query, 'destination_folder' do |mail|
- # and it can take a filter block like `delete`
-end
+guard.expunge # effectively delete emails marked as deleted
+guard.close # expunge then close the connection
```
### Advanced features
#### Mailbox list
@@ -132,6 +130,5 @@
MIT
[Mail]: https://github.com/mikel/mail
-