imap_guard 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rspec +1 -1
- data/.rubocop.yml +26 -0
- data/.travis.yml +3 -10
- data/Gemfile +3 -1
- data/Guardfile +4 -3
- data/LICENSE.txt +1 -1
- data/README.md +14 -17
- data/Rakefile +6 -2
- data/examples/example.rb +15 -13
- data/imap_guard.gemspec +15 -15
- data/lib/imap_guard.rb +2 -0
- data/lib/imap_guard/guard.rb +36 -41
- data/lib/imap_guard/query.rb +33 -32
- data/spec/imap_guard/guard_spec.rb +60 -61
- data/spec/imap_guard/query_spec.rb +25 -26
- data/spec/spec_helper.rb +5 -4
- metadata +10 -26
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 99df3a5c8af846514e4270323a001ad4033f602f197965f6eec76dbf9cb999a0
|
4
|
+
data.tar.gz: 2be62429ce40e9b3e5edd27c8ff166fd5e62193c37cad995019958cf0997b7da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d777c406347aff9d485111676a39ce14ea3348e8c17daa5ce343db7a91b1c6a6a4dd57504fecde6a4fa719501f4d1cd848119e6820bc085c3a7fd33382b9c5c
|
7
|
+
data.tar.gz: eda7c841a6b0b6e86d4c4d3ab62f5f7992bff53d0510cd303afd46b29d5780e00f8b3769f0386e0baf70908a53a048799104d46c11629d46eaa88c9b4f2f41cf
|
data/.rspec
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.4
|
3
|
+
|
4
|
+
Metrics:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Layout/AccessModifierIndentation:
|
8
|
+
EnforcedStyle: outdent
|
9
|
+
|
10
|
+
Style/FormatStringToken:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
Style/SafeNavigation:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Style/SpecialGlobalVars:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Style/StringLiterals:
|
20
|
+
EnforcedStyle: double_quotes
|
21
|
+
|
22
|
+
Style/TrailingCommaInArguments:
|
23
|
+
EnforcedStyleForMultiline: comma
|
24
|
+
|
25
|
+
Style/TrailingCommaInHashLiteral:
|
26
|
+
EnforcedStyleForMultiline: comma
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Guardfile
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# More info at https://github.com/guard/guard#readme
|
2
4
|
|
3
|
-
guard
|
5
|
+
guard "rspec" do
|
4
6
|
watch(%r{^spec/.+_spec\.rb$})
|
5
7
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
6
8
|
watch(%r{^lib/(.+)/(.+)\.rb$}) { |m| "spec/#{m[1]}/#{m[2]}_spec.rb" }
|
7
|
-
watch(
|
9
|
+
watch("spec/spec_helper.rb") { "spec" }
|
8
10
|
watch(%r{^spec/support/.+\.rb$}) { "spec" }
|
9
11
|
end
|
10
|
-
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,13 +1,11 @@
|
|
1
|
-
# ImapGuard
|
1
|
+
# ImapGuard
|
2
2
|
|
3
|
-
|
3
|
+
[](https://badge.fury.io/rb/imap_guard)
|
4
|
+
[](https://travis-ci.org/infertux/imap_guard)
|
5
|
+
[](https://codeclimate.com/github/infertux/imap_guard)
|
6
|
+
[](http://inch-ci.org/github/infertux/imap_guard)
|
4
7
|
|
5
|
-
|
6
|
-
* [Bug Tracker](https://github.com/infertux/imap_guard/issues "Bug Tracker on Github")
|
7
|
-
* [API documentation](http://rubydoc.info/gems/imap_guard/frames "API Documentation on Rubydoc")
|
8
|
-
* [Rubygem](https://rubygems.org/gems/imap_guard "ImapGuard on Rubygems")
|
9
|
-
* [Continuous Integration](https://travis-ci.org/infertux/imap_guard "ImapGuard on Travis-CI")
|
10
|
-
* [Dependencies](https://gemnasium.com/infertux/imap_guard "ImapGuard dependencies on Gemnasium")
|
8
|
+
**A guard for your IMAP mailboxes.**
|
11
9
|
|
12
10
|
ImapGuard connects to your IMAP server and processes your emails.
|
13
11
|
You can finely pick them thanks to advanced search queries and Ruby blocks.
|
@@ -70,7 +68,7 @@ guard.delete base_query.dup.before(7).subject("Logwatch for ") do |mail|
|
|
70
68
|
end
|
71
69
|
```
|
72
70
|
|
73
|
-
|
71
|
+
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):
|
74
72
|
|
75
73
|
```ruby
|
76
74
|
query = 'SEEN SUBJECT "ALERT" FROM "root"'
|
@@ -79,19 +77,19 @@ guard.delete query do |mail|
|
|
79
77
|
end
|
80
78
|
```
|
81
79
|
|
82
|
-
|
80
|
+
There is a `move` method as well:
|
83
81
|
|
84
82
|
```ruby
|
85
|
-
guard.
|
86
|
-
|
83
|
+
guard.move query, 'destination_folder' do |mail|
|
84
|
+
# and it can take a filter block like `delete`
|
85
|
+
end
|
87
86
|
```
|
88
87
|
|
89
|
-
|
88
|
+
Finally, this should be handled automatically but you can explicitly expunge pending emails and close the connection:
|
90
89
|
|
91
90
|
```ruby
|
92
|
-
guard.
|
93
|
-
|
94
|
-
end
|
91
|
+
guard.expunge # effectively delete emails marked as deleted
|
92
|
+
guard.close # expunge then close the connection
|
95
93
|
```
|
96
94
|
|
97
95
|
### Advanced features
|
@@ -134,4 +132,3 @@ MIT
|
|
134
132
|
|
135
133
|
|
136
134
|
[Mail]: https://github.com/mikel/mail
|
137
|
-
|
data/Rakefile
CHANGED
@@ -1,9 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "bundler/gem_tasks"
|
2
4
|
require "rspec/core/rake_task"
|
5
|
+
require "rubocop/rake_task"
|
3
6
|
|
4
7
|
RSpec::Core::RakeTask.new(:spec) do |t|
|
5
|
-
t.ruby_opts =
|
8
|
+
t.ruby_opts = "-w"
|
6
9
|
end
|
7
10
|
|
8
|
-
|
11
|
+
RuboCop::RakeTask.new(:rubocop)
|
9
12
|
|
13
|
+
task default: %i[spec rubocop]
|
data/examples/example.rb
CHANGED
@@ -1,43 +1,45 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
3
|
+
# frozen_string_literal: true
|
4
|
+
# rubocop:disable all
|
5
|
+
|
6
|
+
require "imap_guard"
|
4
7
|
|
5
8
|
SETTINGS = {
|
6
|
-
host:
|
9
|
+
host: "imap.googlemail.com",
|
7
10
|
port: 993,
|
8
|
-
username:
|
9
|
-
password:
|
10
|
-
}
|
11
|
+
username: "you@gmail.com",
|
12
|
+
password: "your_pass",
|
13
|
+
}.freeze
|
11
14
|
|
12
|
-
settings = SETTINGS.merge(
|
15
|
+
settings = SETTINGS.merge(read_only: false)
|
13
16
|
base_query = ImapGuard::Query.new.unflagged.unanswered.freeze
|
14
17
|
guard = ImapGuard::Guard.new settings
|
15
18
|
# guard.debug = ->(mail) { print "#{mail.subject}: " }
|
16
19
|
guard.login
|
17
20
|
|
18
|
-
guard.select
|
21
|
+
guard.select "INBOX"
|
19
22
|
|
20
23
|
# Github
|
21
24
|
%w(github.com notifications@travis-ci.org app@gemnasium.com).map do |from|
|
22
25
|
base_query.dup.from(from)
|
23
26
|
end.each do |query|
|
24
|
-
guard.move query,
|
27
|
+
guard.move query, "INBOX.Github"
|
25
28
|
end
|
26
29
|
|
27
30
|
# To Do
|
28
|
-
guard.move base_query.dup.from("me").to("me"),
|
31
|
+
guard.move base_query.dup.from("me").to("me"), "INBOX.TODO"
|
29
32
|
|
30
33
|
# Ops
|
31
|
-
guard.select
|
34
|
+
guard.select "INBOX.Ops"
|
32
35
|
query = base_query.dup.seen
|
33
36
|
guard.delete query.dup.subject("monit alert -- ").before(7)
|
34
37
|
guard.delete query.dup.subject("CRON-APT completed on ").before(3)
|
35
38
|
guard.delete query.dup.subject("Logwatch for ").before(7)
|
36
|
-
guard.select
|
39
|
+
guard.select "INBOX"
|
37
40
|
|
38
41
|
# Uni
|
39
|
-
guard.move base_query.dup.or.from("uni.tld").to("uni.tld"),
|
42
|
+
guard.move base_query.dup.or.from("uni.tld").to("uni.tld"), "INBOX.Uni"
|
40
43
|
|
41
44
|
# Bye!
|
42
45
|
guard.disconnect
|
43
|
-
|
data/imap_guard.gemspec
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
|
5
6
|
Gem::Specification.new do |spec|
|
6
7
|
spec.name = "imap_guard"
|
7
|
-
spec.version = "1.
|
8
|
+
spec.version = "1.2.0"
|
8
9
|
spec.authors = ["Cédric Félizard"]
|
9
10
|
spec.email = ["cedric@felizard.fr"]
|
10
|
-
spec.description =
|
11
|
+
spec.description = "A guard for your IMAP server"
|
11
12
|
spec.summary = spec.description
|
12
13
|
spec.homepage = "https://github.com/infertux/imap_guard"
|
13
14
|
spec.license = "MIT"
|
@@ -17,16 +18,15 @@ Gem::Specification.new do |spec|
|
|
17
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
19
|
spec.require_paths = ["lib"]
|
19
20
|
|
20
|
-
spec.add_dependency
|
21
|
-
spec.add_dependency
|
21
|
+
spec.add_dependency "mail", ">= 2.5.3"
|
22
|
+
spec.add_dependency "term-ansicolor", ">= 1.2.2"
|
22
23
|
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency 'redcarpet' # for yardoc
|
24
|
+
spec.add_development_dependency "bundler", ">= 1.3"
|
25
|
+
spec.add_development_dependency "cane"
|
26
|
+
spec.add_development_dependency "rake"
|
27
|
+
spec.add_development_dependency "redcarpet" # for yardoc
|
28
|
+
spec.add_development_dependency "rspec"
|
29
|
+
spec.add_development_dependency "rubocop"
|
30
|
+
spec.add_development_dependency "simplecov"
|
31
|
+
spec.add_development_dependency "yard"
|
32
32
|
end
|
data/lib/imap_guard.rb
CHANGED
data/lib/imap_guard/guard.rb
CHANGED
@@ -1,18 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
4
|
-
require
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "net/imap"
|
4
|
+
require "ostruct"
|
5
|
+
require "mail"
|
6
|
+
require "term/ansicolor"
|
7
|
+
|
5
8
|
String.send(:include, Term::ANSIColor)
|
6
|
-
Term::ANSIColor
|
9
|
+
Term::ANSIColor.coloring = STDOUT.isatty
|
7
10
|
|
8
11
|
module ImapGuard
|
9
12
|
# Guard allows you to process your mailboxes.
|
10
13
|
class Guard
|
11
14
|
# List of required settings
|
12
|
-
REQUIRED_SETTINGS = [
|
15
|
+
REQUIRED_SETTINGS = %i[host port username password].freeze
|
13
16
|
|
14
17
|
# List of optional settings
|
15
|
-
OPTIONAL_SETTINGS = [
|
18
|
+
OPTIONAL_SETTINGS = %i[read_only verbose].freeze
|
16
19
|
|
17
20
|
# @return [Proc, nil] Matched emails are passed to this debug lambda if present
|
18
21
|
attr_accessor :debug
|
@@ -24,7 +27,7 @@ module ImapGuard
|
|
24
27
|
# @return [String, nil] Currently selected mailbox
|
25
28
|
attr_reader :mailbox
|
26
29
|
|
27
|
-
def initialize
|
30
|
+
def initialize(settings)
|
28
31
|
self.settings = settings
|
29
32
|
end
|
30
33
|
|
@@ -39,7 +42,7 @@ module ImapGuard
|
|
39
42
|
|
40
43
|
# Selects a mailbox (folder)
|
41
44
|
# @return [void]
|
42
|
-
def select
|
45
|
+
def select(mailbox)
|
43
46
|
if @settings.read_only
|
44
47
|
@imap.examine(mailbox) # open in read-only
|
45
48
|
else
|
@@ -53,15 +56,15 @@ module ImapGuard
|
|
53
56
|
# @param mailbox Destination mailbox
|
54
57
|
# @param filter Optional filter block
|
55
58
|
# @return [void]
|
56
|
-
def move
|
57
|
-
operation = lambda
|
59
|
+
def move(query, mailbox, &filter)
|
60
|
+
operation = lambda do |message_id|
|
58
61
|
unless @settings.read_only
|
59
62
|
@imap.copy(message_id, mailbox)
|
60
63
|
@imap.store(message_id, "+FLAGS", [Net::IMAP::DELETED])
|
61
64
|
end
|
62
65
|
|
63
66
|
"moved to #{mailbox}".yellow
|
64
|
-
|
67
|
+
end
|
65
68
|
process query, operation, &filter
|
66
69
|
end
|
67
70
|
|
@@ -69,14 +72,12 @@ module ImapGuard
|
|
69
72
|
# @param query IMAP query
|
70
73
|
# @param filter Optional filter block
|
71
74
|
# @return [void]
|
72
|
-
def delete
|
73
|
-
operation = lambda
|
74
|
-
unless @settings.read_only
|
75
|
-
@imap.store(message_id, "+FLAGS", [Net::IMAP::DELETED])
|
76
|
-
end
|
75
|
+
def delete(query, &filter)
|
76
|
+
operation = lambda do |message_id|
|
77
|
+
@imap.store(message_id, "+FLAGS", [Net::IMAP::DELETED]) unless @settings.read_only
|
77
78
|
|
78
|
-
|
79
|
-
|
79
|
+
"deleted".red
|
80
|
+
end
|
80
81
|
process query, operation, &filter
|
81
82
|
end
|
82
83
|
|
@@ -84,16 +85,16 @@ module ImapGuard
|
|
84
85
|
# @param query IMAP query
|
85
86
|
# @param opration Lambda to call on each message
|
86
87
|
# @return [void]
|
87
|
-
def each
|
88
|
-
operation =
|
88
|
+
def each(query)
|
89
|
+
operation = ->(message_id) { yield message_id }
|
89
90
|
process query, operation
|
90
91
|
end
|
91
92
|
|
92
93
|
# Fetches a message from its UID
|
93
94
|
# @return [Mail]
|
94
95
|
# @note We use "BODY.PEEK[]" to avoid setting the \Seen flag.
|
95
|
-
def fetch_mail
|
96
|
-
msg = @imap.fetch(message_id,
|
96
|
+
def fetch_mail(message_id)
|
97
|
+
msg = @imap.fetch(message_id, "BODY.PEEK[]").first.attr["BODY[]"]
|
97
98
|
Mail.read_from_string msg
|
98
99
|
end
|
99
100
|
|
@@ -125,7 +126,7 @@ module ImapGuard
|
|
125
126
|
|
126
127
|
private
|
127
128
|
|
128
|
-
def process
|
129
|
+
def process(query, operation)
|
129
130
|
message_ids = search query
|
130
131
|
count = message_ids.size
|
131
132
|
|
@@ -133,7 +134,7 @@ module ImapGuard
|
|
133
134
|
print "Processing UID #{message_id} (#{index.succ}/#{count}): "
|
134
135
|
|
135
136
|
result = true
|
136
|
-
if block_given?
|
137
|
+
if block_given? || debug
|
137
138
|
mail = fetch_mail message_id
|
138
139
|
|
139
140
|
debug.call(mail) if debug
|
@@ -146,15 +147,12 @@ module ImapGuard
|
|
146
147
|
|
147
148
|
puts result ? operation.call(message_id) : "ignored".green
|
148
149
|
end
|
149
|
-
|
150
150
|
ensure
|
151
151
|
expunge
|
152
152
|
end
|
153
153
|
|
154
|
-
def search
|
155
|
-
unless [Array, String].any? { |type| query.is_a? type }
|
156
|
-
raise TypeError, "Query must be either a string holding the entire search string, or a single-dimension array of search keywords and arguments."
|
157
|
-
end
|
154
|
+
def search(query)
|
155
|
+
raise TypeError, "Query must be either a string holding the entire search string, or a single-dimension array of search keywords and arguments." unless [Array, String].any? { |type| query.is_a? type }
|
158
156
|
|
159
157
|
messages = @imap.search query
|
160
158
|
puts "Query on #{mailbox}: #{query.inspect}: #{messages.count} results".cyan
|
@@ -164,18 +162,16 @@ module ImapGuard
|
|
164
162
|
|
165
163
|
def verbose
|
166
164
|
@verbose ||= if @settings.verbose
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
end.new
|
175
|
-
end
|
165
|
+
$stdout
|
166
|
+
else
|
167
|
+
# anonymous null object
|
168
|
+
# rubocop:disable all
|
169
|
+
Class.new do def method_missing(*); nil end end.new
|
170
|
+
# rubocop:enable all
|
171
|
+
end
|
176
172
|
end
|
177
173
|
|
178
|
-
def settings=
|
174
|
+
def settings=(settings)
|
179
175
|
missing = REQUIRED_SETTINGS - settings.keys
|
180
176
|
raise ArgumentError, "Missing settings: #{missing}" unless missing.empty?
|
181
177
|
|
@@ -187,4 +183,3 @@ module ImapGuard
|
|
187
183
|
end
|
188
184
|
end
|
189
185
|
end
|
190
|
-
|
data/lib/imap_guard/query.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module ImapGuard
|
2
4
|
# Query is a neat DSL to help you generate IMAP search queries.
|
3
5
|
# @note All methods return self so they can be chained.
|
@@ -5,31 +7,31 @@ module ImapGuard
|
|
5
7
|
# Messages that have the +\Seen+ flag set.
|
6
8
|
# @return [self]
|
7
9
|
def seen
|
8
|
-
self <<
|
10
|
+
self << "SEEN"
|
9
11
|
end
|
10
12
|
|
11
13
|
# Messages that do not have the +\Seen+ flag set.
|
12
14
|
# @return [self]
|
13
15
|
def unseen
|
14
|
-
self <<
|
16
|
+
self << "UNSEEN"
|
15
17
|
end
|
16
18
|
|
17
19
|
# Messages that do not have the +\Answered+ flag set.
|
18
20
|
# @return [self]
|
19
21
|
def unanswered
|
20
|
-
self <<
|
22
|
+
self << "UNANSWERED"
|
21
23
|
end
|
22
24
|
|
23
25
|
# Messages that do not have the +\Flagged+ flag set.
|
24
26
|
# @return [self]
|
25
27
|
def unflagged
|
26
|
-
self <<
|
28
|
+
self << "UNFLAGGED"
|
27
29
|
end
|
28
30
|
|
29
31
|
# Messages with the +\Deleted+ flag set.
|
30
32
|
# @return [self]
|
31
33
|
def deleted
|
32
|
-
self <<
|
34
|
+
self << "DELETED"
|
33
35
|
end
|
34
36
|
|
35
37
|
# Messages that match either search key.
|
@@ -41,13 +43,13 @@ module ImapGuard
|
|
41
43
|
# or.unanswered.unflagged #=> ["OR", "UNANSWERED", "UNFLAGGED"]
|
42
44
|
# or(:unanswered, :unflagged) #=> ["OR", "UNANSWERED", "UNFLAGGED"]
|
43
45
|
# @return [self]
|
44
|
-
def or
|
45
|
-
self <<
|
46
|
+
def or(search_key1 = nil, search_key2 = nil)
|
47
|
+
self << "OR"
|
46
48
|
|
47
|
-
if search_key1
|
49
|
+
if search_key1 && search_key2
|
48
50
|
send(search_key1)
|
49
51
|
send(search_key2)
|
50
|
-
elsif search_key1
|
52
|
+
elsif search_key1 || search_key2
|
51
53
|
raise ArgumentError, "You must give either zero or two arguments."
|
52
54
|
end
|
53
55
|
|
@@ -60,8 +62,8 @@ module ImapGuard
|
|
60
62
|
# not.deleted #=> ["NOT", "DELETED"]
|
61
63
|
# not(:deleted) #=> ["NOT", "DELETED"]
|
62
64
|
# @return [self]
|
63
|
-
def not
|
64
|
-
self <<
|
65
|
+
def not(search_key = nil)
|
66
|
+
self << "NOT"
|
65
67
|
send(search_key) if search_key
|
66
68
|
self
|
67
69
|
end
|
@@ -69,29 +71,29 @@ module ImapGuard
|
|
69
71
|
# Messages that contain the specified string in the envelope
|
70
72
|
# structure's SUBJECT field.
|
71
73
|
# @return [self]
|
72
|
-
def subject
|
73
|
-
self <<
|
74
|
+
def subject(string)
|
75
|
+
self << "SUBJECT" << string
|
74
76
|
end
|
75
77
|
|
76
78
|
# Messages that contain the specified string in the envelope
|
77
79
|
# structure's FROM field.
|
78
80
|
# @return [self]
|
79
|
-
def from
|
80
|
-
self <<
|
81
|
+
def from(string)
|
82
|
+
self << "FROM" << string
|
81
83
|
end
|
82
84
|
|
83
85
|
# Messages that contain the specified string in the envelope
|
84
86
|
# structure's TO field.
|
85
87
|
# @return [self]
|
86
|
-
def to
|
87
|
-
self <<
|
88
|
+
def to(string)
|
89
|
+
self << "TO" << string
|
88
90
|
end
|
89
91
|
|
90
92
|
# Messages that contain the specified string in the envelope
|
91
93
|
# structure's CC field.
|
92
94
|
# @return [self]
|
93
|
-
def cc
|
94
|
-
self <<
|
95
|
+
def cc(string)
|
96
|
+
self << "CC" << string
|
95
97
|
end
|
96
98
|
|
97
99
|
# Messages whose internal date (disregarding time and timezone)
|
@@ -101,20 +103,19 @@ module ImapGuard
|
|
101
103
|
# - [Fixnum]: _n_ days before today
|
102
104
|
# - [Date]: uses this date
|
103
105
|
# @return [self]
|
104
|
-
def before
|
105
|
-
case date
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
106
|
+
def before(date)
|
107
|
+
date = case date
|
108
|
+
when String
|
109
|
+
date
|
110
|
+
when Integer
|
111
|
+
(Date.today - date).strftime "%e-%b-%Y"
|
112
|
+
when Date
|
113
|
+
date.strftime "%e-%b-%Y"
|
114
|
+
else
|
115
|
+
raise ArgumentError, "#{date.inspect} is invalid."
|
116
|
+
end
|
115
117
|
|
116
|
-
self <<
|
118
|
+
self << "BEFORE" << date
|
117
119
|
end
|
118
120
|
end
|
119
121
|
end
|
120
|
-
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module ImapGuard
|
4
4
|
describe Guard do
|
@@ -12,21 +12,21 @@ module ImapGuard
|
|
12
12
|
|
13
13
|
let(:settings) do
|
14
14
|
{
|
15
|
-
host:
|
15
|
+
host: "localhost",
|
16
16
|
port: 993,
|
17
|
-
username:
|
18
|
-
password:
|
17
|
+
username: "bob",
|
18
|
+
password: "PASS",
|
19
19
|
}
|
20
20
|
end
|
21
21
|
|
22
22
|
let(:imap) do
|
23
|
-
double(
|
23
|
+
double("Net::IMAP", search: [7, 28], expunge: nil, select: nil, list: [])
|
24
24
|
end
|
25
25
|
|
26
|
-
def guard_instance
|
26
|
+
def guard_instance(custom_settings = {})
|
27
27
|
guard = Guard.new(settings.merge(custom_settings))
|
28
28
|
guard.instance_variable_set(:@imap, imap)
|
29
|
-
guard.
|
29
|
+
allow(guard).to receive(:fetch_mail)
|
30
30
|
guard
|
31
31
|
end
|
32
32
|
|
@@ -35,7 +35,7 @@ module ImapGuard
|
|
35
35
|
let(:guard) { guard_instance(read_only: true) }
|
36
36
|
|
37
37
|
it "opens the mailbox in read-only" do
|
38
|
-
imap.
|
38
|
+
expect(imap).to receive(:examine)
|
39
39
|
guard.select nil
|
40
40
|
end
|
41
41
|
end
|
@@ -44,7 +44,7 @@ module ImapGuard
|
|
44
44
|
let(:guard) { guard_instance(read_only: false) }
|
45
45
|
|
46
46
|
it "opens the mailbox in read-write" do
|
47
|
-
imap.
|
47
|
+
expect(imap).to receive(:select)
|
48
48
|
guard.select nil
|
49
49
|
end
|
50
50
|
end
|
@@ -52,46 +52,46 @@ module ImapGuard
|
|
52
52
|
|
53
53
|
describe "#mailbox" do
|
54
54
|
it "returns nil when no mailbox has been selected" do
|
55
|
-
guard_instance.mailbox.
|
55
|
+
expect(guard_instance.mailbox).to be_nil
|
56
56
|
end
|
57
57
|
|
58
58
|
it "returns the currently selected mailbox" do
|
59
59
|
guard = guard_instance
|
60
60
|
|
61
|
-
guard.select
|
62
|
-
guard.mailbox.
|
61
|
+
guard.select "Sent"
|
62
|
+
expect(guard.mailbox).to eq "Sent"
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
66
|
describe "#list" do
|
67
67
|
it "returns the list of mailboxes" do
|
68
|
-
imap.
|
69
|
-
guard_instance.list.
|
68
|
+
expect(imap).to receive(:list)
|
69
|
+
expect(guard_instance.list).to eq []
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
73
|
describe "#search" do
|
74
74
|
before do
|
75
|
-
imap.
|
76
|
-
[13, 37] if [[
|
75
|
+
expect(imap).to receive(:search) do |arg|
|
76
|
+
[13, 37] if [["ALL"], "ALL"].include? arg
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
80
|
it "accepts arrays" do
|
81
|
-
expect
|
82
|
-
guard_instance.send(:search, [
|
83
|
-
|
81
|
+
expect do
|
82
|
+
guard_instance.send(:search, ["ALL"])
|
83
|
+
end.to_not raise_error
|
84
84
|
end
|
85
85
|
|
86
86
|
it "accepts strings" do
|
87
|
-
expect
|
88
|
-
guard_instance.send(:search,
|
89
|
-
|
87
|
+
expect do
|
88
|
+
guard_instance.send(:search, "ALL")
|
89
|
+
end.to_not raise_error
|
90
90
|
end
|
91
91
|
|
92
92
|
it "returns results" do
|
93
|
-
messages = guard_instance.send(:search,
|
94
|
-
messages.
|
93
|
+
messages = guard_instance.send(:search, "ALL")
|
94
|
+
expect(messages).to eq [13, 37]
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -101,49 +101,49 @@ module ImapGuard
|
|
101
101
|
|
102
102
|
context "without a filter block" do
|
103
103
|
it "does perform the operation" do
|
104
|
-
opeartion.
|
105
|
-
opeartion.
|
104
|
+
expect(opeartion).to receive(:call).with(7)
|
105
|
+
expect(opeartion).to receive(:call).with(28)
|
106
106
|
|
107
|
-
guard.send(:process,
|
107
|
+
guard.send(:process, "ALL", opeartion)
|
108
108
|
end
|
109
109
|
|
110
110
|
it "does not execute the filter block" do
|
111
|
-
guard.
|
111
|
+
expect(guard).not_to receive(:fetch_mail)
|
112
112
|
|
113
|
-
guard.send(:process,
|
113
|
+
guard.send(:process, "ALL", opeartion)
|
114
114
|
end
|
115
115
|
|
116
116
|
context "with a debug proc" do
|
117
117
|
it "calls the proc" do
|
118
118
|
block = ->(mail) {}
|
119
119
|
guard.debug = block
|
120
|
-
block.
|
120
|
+
expect(block).to receive(:call).twice
|
121
121
|
|
122
|
-
guard.send(:process,
|
122
|
+
guard.send(:process, "ALL", opeartion)
|
123
123
|
end
|
124
124
|
end
|
125
125
|
end
|
126
126
|
|
127
127
|
context "with a filter block" do
|
128
128
|
it "executes the filter block" do
|
129
|
-
guard.
|
129
|
+
expect(guard).to receive(:fetch_mail).twice
|
130
130
|
|
131
|
-
guard.send(:process,
|
131
|
+
guard.send(:process, "ALL", opeartion) {}
|
132
132
|
end
|
133
133
|
|
134
134
|
context "returning false" do
|
135
135
|
it "does not perform the operation" do
|
136
|
-
opeartion.
|
136
|
+
expect(opeartion).not_to receive(:call)
|
137
137
|
|
138
|
-
guard.send(:process,
|
138
|
+
guard.send(:process, "ALL", opeartion) { false }
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
142
142
|
context "returning true" do
|
143
143
|
it "does perform the operation" do
|
144
|
-
opeartion.
|
144
|
+
expect(opeartion).to receive(:call).twice
|
145
145
|
|
146
|
-
guard.send(:process,
|
146
|
+
guard.send(:process, "ALL", opeartion) { true }
|
147
147
|
end
|
148
148
|
end
|
149
149
|
end
|
@@ -151,29 +151,29 @@ module ImapGuard
|
|
151
151
|
|
152
152
|
describe "#move" do
|
153
153
|
it "copies emails before adding the :Deleted flag" do
|
154
|
-
imap.
|
155
|
-
imap.
|
156
|
-
imap.
|
157
|
-
imap.
|
158
|
-
imap.
|
154
|
+
expect(imap).to receive(:search)
|
155
|
+
expect(imap).to receive(:copy).with(7, "destination").ordered
|
156
|
+
expect(imap).to receive(:store).with(7, "+FLAGS", [:Deleted]).ordered
|
157
|
+
expect(imap).to receive(:copy).with(28, "destination").ordered
|
158
|
+
expect(imap).to receive(:store).with(28, "+FLAGS", [:Deleted]).ordered
|
159
159
|
|
160
|
-
guard_instance.move
|
160
|
+
guard_instance.move "ALL", "destination"
|
161
161
|
end
|
162
162
|
end
|
163
163
|
|
164
164
|
describe "#delete" do
|
165
165
|
it "adds the :Deleted flag" do
|
166
|
-
imap.
|
167
|
-
imap.
|
168
|
-
imap.
|
166
|
+
expect(imap).to receive(:search)
|
167
|
+
expect(imap).to receive(:store).with(7, "+FLAGS", [:Deleted])
|
168
|
+
expect(imap).to receive(:store).with(28, "+FLAGS", [:Deleted])
|
169
169
|
|
170
|
-
guard_instance.delete
|
170
|
+
guard_instance.delete "ALL"
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
174
174
|
describe "#each" do
|
175
175
|
it "iterates over messages without errors" do
|
176
|
-
guard_instance.each
|
176
|
+
guard_instance.each "ALL" do |message_id|
|
177
177
|
# noop
|
178
178
|
end
|
179
179
|
end
|
@@ -181,21 +181,21 @@ module ImapGuard
|
|
181
181
|
|
182
182
|
describe "#expunge" do
|
183
183
|
it "expunges the folder" do
|
184
|
-
imap.
|
184
|
+
expect(imap).to receive(:expunge)
|
185
185
|
guard_instance.expunge
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
189
189
|
describe "#close" do
|
190
190
|
it "closes the IMAP connection" do
|
191
|
-
imap.
|
191
|
+
expect(imap).to receive(:close)
|
192
192
|
guard_instance.close
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
196
196
|
describe "#disconnect" do
|
197
197
|
it "disconnects from the server" do
|
198
|
-
imap.
|
198
|
+
expect(imap).to receive(:disconnect)
|
199
199
|
guard_instance.disconnect
|
200
200
|
end
|
201
201
|
end
|
@@ -205,7 +205,7 @@ module ImapGuard
|
|
205
205
|
let(:guard) { guard_instance(verbose: true) }
|
206
206
|
|
207
207
|
it "does output to $stdout" do
|
208
|
-
$stdout.
|
208
|
+
expect($stdout).to receive(:write).with("ham")
|
209
209
|
guard.send(:verbose).print "ham"
|
210
210
|
end
|
211
211
|
end
|
@@ -214,7 +214,7 @@ module ImapGuard
|
|
214
214
|
let(:guard) { guard_instance(verbose: false) }
|
215
215
|
|
216
216
|
it "does not output to $stdout" do
|
217
|
-
$stdout.
|
217
|
+
expect($stdout).not_to receive(:write)
|
218
218
|
guard.send(:verbose).print "ham"
|
219
219
|
end
|
220
220
|
end
|
@@ -226,23 +226,22 @@ module ImapGuard
|
|
226
226
|
|
227
227
|
exception = (RUBY_VERSION >= "2.1.0" ? RuntimeError : TypeError)
|
228
228
|
|
229
|
-
expect
|
230
|
-
guard.settings.host =
|
231
|
-
|
229
|
+
expect do
|
230
|
+
guard.settings.host = "example.net"
|
231
|
+
end.to raise_error(exception, /frozen/)
|
232
232
|
end
|
233
233
|
|
234
234
|
it "raises ArgumentError if any required key is missing" do
|
235
|
-
expect
|
235
|
+
expect do
|
236
236
|
Guard.new({})
|
237
|
-
|
237
|
+
end.to raise_error ArgumentError, /missing/i
|
238
238
|
end
|
239
239
|
|
240
240
|
it "raises ArgumentError if any key is unknown" do
|
241
|
-
expect
|
241
|
+
expect do
|
242
242
|
Guard.new(settings.merge(coffee: true))
|
243
|
-
|
243
|
+
end.to raise_error ArgumentError, /unknown/i
|
244
244
|
end
|
245
245
|
end
|
246
246
|
end
|
247
247
|
end
|
248
|
-
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module ImapGuard
|
4
4
|
describe Query do
|
@@ -9,35 +9,35 @@ module ImapGuard
|
|
9
9
|
describe "#seen" do
|
10
10
|
it "adds 'SEEN'" do
|
11
11
|
subject.seen
|
12
|
-
subject.last.
|
12
|
+
expect(subject.last).to eq "SEEN"
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
describe "#unseen" do
|
17
17
|
it "adds 'UNSEEN'" do
|
18
18
|
subject.unseen
|
19
|
-
subject.last.
|
19
|
+
expect(subject.last).to eq "UNSEEN"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
describe "#unanswered" do
|
24
24
|
it "adds 'UNANSWERED'" do
|
25
25
|
subject.unanswered
|
26
|
-
subject.last.
|
26
|
+
expect(subject.last).to eq "UNANSWERED"
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
describe "#unflagged" do
|
31
31
|
it "adds 'UNFLAGGED'" do
|
32
32
|
subject.unflagged
|
33
|
-
subject.last.
|
33
|
+
expect(subject.last).to eq "UNFLAGGED"
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
describe "#deleted" do
|
38
38
|
it "adds 'DELETED'" do
|
39
39
|
subject.deleted
|
40
|
-
subject.last.
|
40
|
+
expect(subject.last).to eq "DELETED"
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -45,26 +45,26 @@ module ImapGuard
|
|
45
45
|
context "without a search key" do
|
46
46
|
it "adds 'OR'" do
|
47
47
|
subject.or
|
48
|
-
subject.last.
|
48
|
+
expect(subject.last).to eq "OR"
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
52
|
context "with search keys" do
|
53
53
|
it "adds 'OR UNANSWERED UNFLAGGED '" do
|
54
54
|
subject.or(:unanswered, :unflagged)
|
55
|
-
subject.last(3).
|
55
|
+
expect(subject.last(3)).to eq %w[OR UNANSWERED UNFLAGGED]
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
59
|
context "with only one non-nil search key" do
|
60
60
|
it "raises ArgumentError" do
|
61
|
-
expect
|
61
|
+
expect do
|
62
62
|
subject.or(:whatever)
|
63
|
-
|
63
|
+
end.to raise_error(ArgumentError)
|
64
64
|
|
65
|
-
expect
|
65
|
+
expect do
|
66
66
|
subject.or(nil, :whatever)
|
67
|
-
|
67
|
+
end.to raise_error(ArgumentError)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|
@@ -72,28 +72,28 @@ module ImapGuard
|
|
72
72
|
describe "#subject" do
|
73
73
|
it "adds the search value" do
|
74
74
|
subject.subject("Hey you")
|
75
|
-
subject.last.
|
75
|
+
expect(subject.last).to eq "Hey you"
|
76
76
|
end
|
77
77
|
end
|
78
78
|
|
79
79
|
describe "#from" do
|
80
80
|
it "adds the search value" do
|
81
81
|
subject.from("root@example.net")
|
82
|
-
subject.last.
|
82
|
+
expect(subject.last).to eq "root@example.net"
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
86
|
describe "#to" do
|
87
87
|
it "adds the search value" do
|
88
88
|
subject.to("root@example.net")
|
89
|
-
subject.last.
|
89
|
+
expect(subject.last).to eq "root@example.net"
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
93
|
describe "#cc" do
|
94
94
|
it "adds the search value" do
|
95
95
|
subject.cc("root@example.net")
|
96
|
-
subject.last.
|
96
|
+
expect(subject.last).to eq "root@example.net"
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -101,14 +101,14 @@ module ImapGuard
|
|
101
101
|
context "without a search key" do
|
102
102
|
it "adds 'NOT'" do
|
103
103
|
subject.not.deleted
|
104
|
-
subject.last(2).
|
104
|
+
expect(subject.last(2)).to eq %w[NOT DELETED]
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
108
|
context "with a search key" do
|
109
109
|
it "adds 'NOT DELETED'" do
|
110
110
|
subject.not(:deleted)
|
111
|
-
subject.last(2).
|
111
|
+
expect(subject.last(2)).to eq %w[NOT DELETED]
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
@@ -116,40 +116,39 @@ module ImapGuard
|
|
116
116
|
describe "#before" do
|
117
117
|
context "when I pass 'nil' as an argument" do
|
118
118
|
it "raises" do
|
119
|
-
expect
|
119
|
+
expect do
|
120
120
|
subject.before(nil)
|
121
|
-
|
121
|
+
end.to raise_error ArgumentError
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
125
|
context "when I pass '1' as an argument" do
|
126
126
|
it "returns yesterday" do
|
127
127
|
subject.before(1)
|
128
|
-
Date.parse(subject.last).
|
128
|
+
expect(Date.parse(subject.last)).to eq Date.today.prev_day
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
132
|
context "when I pass an integer" do
|
133
133
|
it "uses it as a negative offset in days" do
|
134
134
|
subject.before(3)
|
135
|
-
(Date.today - Date.parse(subject.last)).
|
135
|
+
expect((Date.today - Date.parse(subject.last))).to eq 3
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
139
|
context "when I pass '18-Mar-2013' as an argument" do
|
140
140
|
it "uses it as is" do
|
141
|
-
subject.before(
|
142
|
-
subject.last.
|
141
|
+
subject.before("18-Mar-2013")
|
142
|
+
expect(subject.last).to eq "18-Mar-2013"
|
143
143
|
end
|
144
144
|
end
|
145
145
|
|
146
146
|
context "when I pass an instance of Date as an argument" do
|
147
147
|
it "extracts the date" do
|
148
148
|
subject.before(Date.today)
|
149
|
-
Date.parse(subject.last).
|
149
|
+
expect(Date.parse(subject.last)).to eq Date.today
|
150
150
|
end
|
151
151
|
end
|
152
152
|
end
|
153
153
|
end
|
154
154
|
end
|
155
|
-
|
data/spec/spec_helper.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "simplecov"
|
2
4
|
SimpleCov.start do
|
3
|
-
minimum_coverage
|
5
|
+
minimum_coverage 95
|
4
6
|
add_group "Sources", "lib"
|
5
7
|
add_group "Tests", "spec"
|
6
8
|
end
|
7
9
|
|
8
|
-
require
|
10
|
+
require "imap_guard"
|
9
11
|
|
10
12
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |file| require file }
|
11
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imap_guard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cédric Félizard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.3'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: cane
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: redcarpet
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: rspec
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rubocop
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: simplecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
@@ -150,20 +150,6 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: redcarpet
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - ">="
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
153
|
description: A guard for your IMAP server
|
168
154
|
email:
|
169
155
|
- cedric@felizard.fr
|
@@ -173,7 +159,7 @@ extra_rdoc_files: []
|
|
173
159
|
files:
|
174
160
|
- ".gitignore"
|
175
161
|
- ".rspec"
|
176
|
-
- ".
|
162
|
+
- ".rubocop.yml"
|
177
163
|
- ".travis.yml"
|
178
164
|
- Gemfile
|
179
165
|
- Guardfile
|
@@ -207,8 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
193
|
- !ruby/object:Gem::Version
|
208
194
|
version: '0'
|
209
195
|
requirements: []
|
210
|
-
|
211
|
-
rubygems_version: 2.4.6
|
196
|
+
rubygems_version: 3.0.1
|
212
197
|
signing_key:
|
213
198
|
specification_version: 4
|
214
199
|
summary: A guard for your IMAP server
|
@@ -216,4 +201,3 @@ test_files:
|
|
216
201
|
- spec/imap_guard/guard_spec.rb
|
217
202
|
- spec/imap_guard/query_spec.rb
|
218
203
|
- spec/spec_helper.rb
|
219
|
-
has_rdoc:
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.2
|