gmail-britta 0.1.3 → 0.1.4
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.
- data/VERSION +1 -1
- data/gmail-britta.gemspec +1 -1
- data/lib/gmail-britta/filter.rb +3 -3
- data/test/test_gmail-britta.rb +8 -5
- metadata +3 -3
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.4
|
data/gmail-britta.gemspec
CHANGED
data/lib/gmail-britta/filter.rb
CHANGED
|
@@ -104,7 +104,7 @@ ATOM
|
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
def otherwise(&block)
|
|
107
|
-
filter = Filter.new(@britta).perform(&block)
|
|
107
|
+
filter = Filter.new(@britta, :log => @log).perform(&block)
|
|
108
108
|
filter.merge_negated_criteria(self)
|
|
109
109
|
filter.log_definition
|
|
110
110
|
filter
|
|
@@ -118,7 +118,7 @@ ATOM
|
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
def also(&block)
|
|
121
|
-
filter = Filter.new(@britta).perform(&block)
|
|
121
|
+
filter = Filter.new(@britta, :log => @log).perform(&block)
|
|
122
122
|
filter.merge_positive_criteria(self)
|
|
123
123
|
filter.log_definition
|
|
124
124
|
filter
|
|
@@ -127,7 +127,7 @@ ATOM
|
|
|
127
127
|
def archive_unless_directed(options={})
|
|
128
128
|
mark_as_read=options[:mark_read]
|
|
129
129
|
tos=(options[:to] || me).to_a
|
|
130
|
-
filter = Filter.new(@britta).perform do
|
|
130
|
+
filter = Filter.new(@britta, :log => @log).perform do
|
|
131
131
|
has_not [{:or => tos.map {|to| "to:#{to}"}}]
|
|
132
132
|
archive
|
|
133
133
|
if mark_as_read
|
data/test/test_gmail-britta.rb
CHANGED
|
@@ -9,9 +9,9 @@ describe GmailBritta do
|
|
|
9
9
|
def simple_filterset
|
|
10
10
|
fs = GmailBritta.filterset() do
|
|
11
11
|
filter {
|
|
12
|
-
has
|
|
12
|
+
has %w{to:asf@boinkor.net}
|
|
13
13
|
label 'ohai'
|
|
14
|
-
}
|
|
14
|
+
}.archive_unless_directed
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
@@ -37,9 +37,12 @@ describe GmailBritta do
|
|
|
37
37
|
it "generates xml" do
|
|
38
38
|
filters = dom(simple_filterset)
|
|
39
39
|
|
|
40
|
-
assert_equal(
|
|
41
|
-
assert_equal(
|
|
40
|
+
assert_equal(2, filters.xpath('/a:feed/a:entry',ns).length, "Should have exactly one filter entry")
|
|
41
|
+
assert_equal(5, filters.xpath('/a:feed/a:entry/apps:property',ns).length, "Should have two properties")
|
|
42
42
|
assert_equal(1, filters.xpath('/a:feed/a:entry/apps:property[@name="label"]',ns).length, "Should have exactly one 'label' property")
|
|
43
|
-
assert_equal(1, filters.xpath('/a:feed/a:entry/apps:property[@name="
|
|
43
|
+
assert_equal(1, filters.xpath('/a:feed/a:entry/apps:property[@name="shouldArchive"]',ns).length, "Should have exactly one 'shouldArchive' property")
|
|
44
|
+
assert_equal(2, filters.xpath('/a:feed/a:entry/apps:property[@name="hasTheWord"]',ns).length, "Should have exactly one 'has' property")
|
|
44
45
|
end
|
|
46
|
+
|
|
47
|
+
|
|
45
48
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gmail-britta
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 19
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 1
|
|
9
|
-
-
|
|
10
|
-
version: 0.1.
|
|
9
|
+
- 4
|
|
10
|
+
version: 0.1.4
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Andreas Fuchs
|