Skip to content

Commit

Permalink
Respect Ruby convention
Browse files Browse the repository at this point in the history
Doh!
  • Loading branch information
infertux committed Apr 4, 2013
1 parent 46f84d1 commit 0d9276e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -32,16 +32,16 @@ SETTINGS = {
read_only: true # don't perform any modification aka dry-run mode
}

guard = IMAPGuard::Guard.new SETTINGS
guard = ImapGuard::Guard.new SETTINGS
guard.login # authenticate the user
guard.select 'INBOX.ops' # select the mailbox
```

IMAP search query syntax can be a bit tricky.
`IMAPGuard::Query` can help you to build queries with a simple Ruby DSL:
`ImapGuard::Query` can help you to build queries with a simple Ruby DSL:

```ruby
base_query = IMAPGuard::Query.new.unflagged.unanswered.seen.freeze
base_query = ImapGuard::Query.new.unflagged.unanswered.seen.freeze
query = base_query.dup.before(7).subject("abc").from("root")
p query #=> ["UNFLAGGED", "UNANSWERED", "SEEN", "BEFORE", "13-Mar-2013", "SUBJECT", "abc", "FROM", "root"]
guard.delete query # will delete every emails which match this query
Expand Down
4 changes: 2 additions & 2 deletions examples/example.rb
Expand Up @@ -10,8 +10,8 @@
}

settings = SETTINGS.merge({ read_only: false })
base_query = IMAPGuard::Query.new.unflagged.unanswered.freeze
guard = IMAPGuard::Guard.new settings
base_query = ImapGuard::Query.new.unflagged.unanswered.freeze
guard = ImapGuard::Guard.new settings
# guard.debug = ->(mail) { print "#{mail.subject}: " }
guard.login

Expand Down
4 changes: 2 additions & 2 deletions lib/imap_guard/guard.rb
Expand Up @@ -3,7 +3,7 @@
require 'mail'
require 'colored'

module IMAPGuard
module ImapGuard
# Guard allows you to process your mailboxes.
class Guard
# List of required settings
Expand All @@ -16,7 +16,7 @@ class Guard
attr_accessor :debug

# @note The settings are frozen
# @return [OpenStruct] IMAPGuard settings
# @return [OpenStruct] ImapGuard settings
attr_reader :settings

# @return [String, nil] Currently selected mailbox
Expand Down
2 changes: 1 addition & 1 deletion lib/imap_guard/query.rb
@@ -1,4 +1,4 @@
module IMAPGuard
module ImapGuard
# Query is a neat DSL to help you generate IMAP search queries.
# @note All methods return self so they can be chained.
class Query < Array
Expand Down
2 changes: 1 addition & 1 deletion spec/imap_guard/guard_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'

module IMAPGuard
module ImapGuard
describe Guard do
before do
$stdout = StringIO.new # mute stdout - comment to debug
Expand Down
2 changes: 1 addition & 1 deletion spec/imap_guard/query_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'

module IMAPGuard
module ImapGuard
describe Query do
describe "#initialize" do
it { should be_empty }
Expand Down

0 comments on commit 0d9276e

Please sign in to comment.