gmail-britta 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
data/gmail-britta.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gmail-britta"
8
- s.version = "0.1.3"
8
+ s.version = "0.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andreas Fuchs"]
@@ -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
@@ -9,9 +9,9 @@ describe GmailBritta do
9
9
  def simple_filterset
10
10
  fs = GmailBritta.filterset() do
11
11
  filter {
12
- has 'to:asf@boinkor.net'
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(1, filters.xpath('/a:feed/a:entry',ns).length, "Should have exactly one filter entry")
41
- assert_equal(2, filters.xpath('/a:feed/a:entry/apps:property',ns).length, "Should have two properties")
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="hasTheWord"]',ns).length, "Should have exactly one 'has' property")
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: 29
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andreas Fuchs