gmail-britta 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +5 -8
- data/.yardopts +2 -1
- data/Gemfile +3 -2
- data/Gemfile.lock +66 -21
- data/README.md +3 -1
- data/THANKS.md +15 -0
- data/TODO.org +6 -0
- data/VERSION +1 -1
- data/examples/Gemfile.lock +2 -2
- data/examples/asf.rb +29 -2
- data/gmail-britta.gemspec +14 -11
- data/lib/gmail-britta.rb +2 -0
- data/lib/gmail-britta/chaining_filter.rb +82 -0
- data/lib/gmail-britta/filter.rb +117 -62
- data/lib/gmail-britta/filter_set.rb +5 -2
- data/lib/gmail-britta/single_write_accessors.rb +54 -21
- data/test/test_gmail-britta.rb +249 -21
- metadata +24 -39
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5acae2c6d653e50ff1c4413e7a7f42eacdcc11dd
|
4
|
+
data.tar.gz: 1689894828d5a50fe79748301f328fd17ad70b73
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: af88b3bd91040b219f373aa0439945078f2cbed5ba12ecd767a7c959b2811ed08d546e87c672eb9e229fac82a0ef2460b8111b9e2547f1d65bdd6e3ddbf40805
|
7
|
+
data.tar.gz: d613aa4da1249f9eac1f4f33fd5bf858d163eec703c743c3ae97739dc7c287ce5233ad37d4d7a36a9f832606db0d80b7666ae7aff329a79d48d822cc7786d1ea
|
data/.travis.yml
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
2
3
|
rvm:
|
3
|
-
- "
|
4
|
-
- "1
|
5
|
-
- "
|
6
|
-
- jruby-18mode # JRuby in 1.8 mode
|
7
|
-
- jruby-19mode # JRuby in 1.9 mode
|
8
|
-
- rbx-18mode
|
9
|
-
- rbx-19mode
|
4
|
+
- "2.2"
|
5
|
+
- "2.1"
|
6
|
+
- "2.0"
|
10
7
|
before_install: gem install bundler -v "~> 1.2.0"
|
11
|
-
bundler_args: --without doc release
|
8
|
+
bundler_args: --without doc release
|
data/.yardopts
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
--markup markdown
|
1
|
+
--markup markdown
|
2
|
+
--embed-mixins *::ClassMethods
|
data/Gemfile
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
3
|
gem 'haml', '~> 3.1.6'
|
4
|
+
gem "codeclimate-test-reporter", group: :test, require: nil
|
4
5
|
|
5
6
|
|
6
7
|
# Add dependencies to develop your gem here.
|
7
8
|
# Include everything needed to run rake, tests, features, etc.
|
8
9
|
group :development do
|
9
|
-
gem "rake", "
|
10
|
+
gem "rake", ">= 0.9.2"
|
10
11
|
gem "shoulda", ">= 0"
|
11
|
-
gem "bundler", "
|
12
|
+
gem "bundler", ">= 1.2.0"
|
12
13
|
gem "minitest"
|
13
14
|
gem "nokogiri"
|
14
15
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,44 +1,89 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
activesupport (
|
5
|
-
i18n (~> 0.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
activesupport (4.2.5)
|
5
|
+
i18n (~> 0.7)
|
6
|
+
json (~> 1.7, >= 1.7.7)
|
7
|
+
minitest (~> 5.1)
|
8
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
9
|
+
tzinfo (~> 1.1)
|
10
|
+
addressable (2.4.0)
|
11
|
+
builder (3.2.2)
|
12
|
+
codeclimate-test-reporter (0.4.8)
|
13
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
14
|
+
docile (1.1.5)
|
15
|
+
faraday (0.8.11)
|
16
|
+
multipart-post (~> 1.2.0)
|
17
|
+
git (1.2.9.1)
|
18
|
+
github_api (0.10.1)
|
19
|
+
addressable
|
20
|
+
faraday (~> 0.8.1)
|
21
|
+
hashie (>= 1.2)
|
22
|
+
multi_json (~> 1.4)
|
23
|
+
nokogiri (~> 1.5.2)
|
24
|
+
oauth2
|
25
|
+
haml (3.1.8)
|
26
|
+
hashie (3.4.3)
|
27
|
+
highline (1.7.8)
|
28
|
+
i18n (0.7.0)
|
29
|
+
jeweler (1.8.8)
|
30
|
+
builder
|
11
31
|
bundler (~> 1.0)
|
12
32
|
git (>= 1.2.5)
|
33
|
+
github_api (= 0.10.1)
|
34
|
+
highline (>= 1.6.15)
|
35
|
+
nokogiri (= 1.5.10)
|
13
36
|
rake
|
14
37
|
rdoc
|
15
|
-
json (1.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
38
|
+
json (1.8.3)
|
39
|
+
jwt (1.5.2)
|
40
|
+
minitest (5.8.3)
|
41
|
+
multi_json (1.11.2)
|
42
|
+
multi_xml (0.5.5)
|
43
|
+
multipart-post (1.2.0)
|
44
|
+
nokogiri (1.5.10)
|
45
|
+
oauth2 (1.0.0)
|
46
|
+
faraday (>= 0.8, < 0.10)
|
47
|
+
jwt (~> 1.0)
|
48
|
+
multi_json (~> 1.3)
|
49
|
+
multi_xml (~> 0.5)
|
50
|
+
rack (~> 1.2)
|
51
|
+
rack (1.6.4)
|
52
|
+
rake (10.4.2)
|
53
|
+
rdoc (3.12.2)
|
21
54
|
json (~> 1.4)
|
22
55
|
redcarpet (2.2.2)
|
23
|
-
shoulda (3.
|
24
|
-
shoulda-context (~> 1.0)
|
25
|
-
shoulda-matchers (
|
26
|
-
shoulda-context (1.
|
27
|
-
shoulda-matchers (
|
56
|
+
shoulda (3.5.0)
|
57
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
58
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
59
|
+
shoulda-context (1.2.1)
|
60
|
+
shoulda-matchers (2.8.0)
|
28
61
|
activesupport (>= 3.0.0)
|
29
|
-
|
62
|
+
simplecov (0.11.1)
|
63
|
+
docile (~> 1.1.0)
|
64
|
+
json (~> 1.8)
|
65
|
+
simplecov-html (~> 0.10.0)
|
66
|
+
simplecov-html (0.10.0)
|
67
|
+
thread_safe (0.3.5)
|
68
|
+
tzinfo (1.2.2)
|
69
|
+
thread_safe (~> 0.1)
|
70
|
+
yard (0.8.7.6)
|
30
71
|
|
31
72
|
PLATFORMS
|
32
73
|
ruby
|
33
74
|
|
34
75
|
DEPENDENCIES
|
35
|
-
bundler (
|
76
|
+
bundler (>= 1.2.0)
|
77
|
+
codeclimate-test-reporter
|
36
78
|
haml (~> 3.1.6)
|
37
79
|
jeweler (~> 1.8.4)
|
38
80
|
minitest
|
39
81
|
nokogiri
|
40
|
-
rake (
|
82
|
+
rake (>= 0.9.2)
|
41
83
|
rdoc (~> 3.12)
|
42
84
|
redcarpet (~> 2.2.2)
|
43
85
|
shoulda
|
44
86
|
yard (~> 0.8.3)
|
87
|
+
|
88
|
+
BUNDLED WITH
|
89
|
+
1.10.6
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# gmail-britta
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Gem Version](https://img.shields.io/gem/v/gmail-britta.svg)](https://rubygems.org/gems/gmail-britta)
|
4
|
+
[![Build Status](https://img.shields.io/travis/antifuchs/gmail-britta/master.svg)](https://travis-ci.org/antifuchs/gmail-britta)
|
5
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/antifuchs/gmail-britta.svg)](https://codeclimate.com/github/antifuchs/gmail-britta)
|
4
6
|
|
5
7
|
This library helps you generate XML that you can import into gmail's
|
6
8
|
filter settings. It makes it more pleasant to write simple (and even
|
data/THANKS.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
gmail-britta is a project originally created by
|
2
|
+
[Andreas Fuchs](https://boinkor.net), but there are a bunch of people that have
|
3
|
+
contributed as well. We try to keep this list up-to-date, but you can also
|
4
|
+
have a look at the contributor graphs produced by
|
5
|
+
[GitHub](https://github.com/antifuchs/gmail-britta/graphs/contributors).
|
6
|
+
|
7
|
+
* [John Piasetzki](https://github.com/jpiasetz)
|
8
|
+
* [Ryan Brown](https://github.com/ryansb)
|
9
|
+
* [yalon](https://github.com/yalon)
|
10
|
+
* [sidgopalan](https://github.com/sidgopalan)
|
11
|
+
* [Brian Krausz](https://github.com/bkrausz)
|
12
|
+
* [Ben Gardiner](https://github.com/BenGardiner)
|
13
|
+
* [Evan Broder](https://github.com/ebroder)
|
14
|
+
* [Patrick Koch](https://github.com/pathzzrd)
|
15
|
+
* [James Abley](https://github.com/jabley)
|
data/TODO.org
CHANGED
@@ -4,6 +4,9 @@
|
|
4
4
|
* TODO Finalization model for single-filter definition
|
5
5
|
Allow defining multible conditions, actions in the filter body. Then
|
6
6
|
at the end of the block finalize into filter object & register that.
|
7
|
+
*** Bonus points: Filter chain subclasses
|
8
|
+
This would make it much easier to reason about / test filter
|
9
|
+
negation & stuff like archive_unless_directed.
|
7
10
|
* TODO Check for maximum length of filter conditions
|
8
11
|
* TODO Avoid emitting empty filters if there is a .archive_unless_directed
|
9
12
|
* TODO Maybe a more convenient has/has_not criteria format?
|
@@ -14,3 +17,6 @@
|
|
14
17
|
#+END_SRC
|
15
18
|
Might also make it easier to optimize filter expressions for length
|
16
19
|
(but how to specify OR? Guess this is for a version 1.0/2.0)
|
20
|
+
* TODO Extract my personal filters from this repo
|
21
|
+
While it's neat that I can keep them in here, I should just make a
|
22
|
+
separate repo for them.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.7
|
data/examples/Gemfile.lock
CHANGED
data/examples/asf.rb
CHANGED
@@ -22,6 +22,7 @@ puts(GmailBritta.filterset(:me => MY_EMAILS) do
|
|
22
22
|
filter {
|
23
23
|
has ['subject:"moderator request"']
|
24
24
|
label 'bulk/mailman'
|
25
|
+
smart_label 'notifications'
|
25
26
|
archive
|
26
27
|
mark_read
|
27
28
|
}
|
@@ -29,6 +30,7 @@ puts(GmailBritta.filterset(:me => MY_EMAILS) do
|
|
29
30
|
filter {
|
30
31
|
has ['list:mailman@', 'subject:reminder']
|
31
32
|
label 'bulk/mailman'
|
33
|
+
smart_label 'notifications'
|
32
34
|
archive
|
33
35
|
mark_read
|
34
36
|
}
|
@@ -37,9 +39,11 @@ puts(GmailBritta.filterset(:me => MY_EMAILS) do
|
|
37
39
|
filter {
|
38
40
|
has %w{from:mailman subject:confirm}
|
39
41
|
label 'bulk'
|
42
|
+
smart_label 'notifications'
|
40
43
|
}.otherwise {
|
41
44
|
has %w{from:mailman}
|
42
45
|
label 'bulk'
|
46
|
+
smart_label 'notifications'
|
43
47
|
archive
|
44
48
|
}
|
45
49
|
|
@@ -48,63 +52,75 @@ puts(GmailBritta.filterset(:me => MY_EMAILS) do
|
|
48
52
|
has %w{to:root}
|
49
53
|
archive
|
50
54
|
label 'bulk/admin'
|
55
|
+
smart_label 'notifications'
|
51
56
|
}
|
52
57
|
|
53
58
|
# Mailing lists I read:
|
54
59
|
filter {
|
55
60
|
has %w{list:mcclim-*@common-lisp.net}
|
56
61
|
label 'lisp/McCLIM'
|
62
|
+
smart_label 'forums'
|
57
63
|
}.archive_unless_directed.otherwise {
|
58
64
|
has [{:or => %w{list:*@common-lisp.net list:summeroflisp-discuss@lispnyc.org}}]
|
59
65
|
label 'lisp'
|
66
|
+
smart_label 'forums'
|
60
67
|
}.archive_unless_directed
|
61
68
|
|
62
69
|
filter {
|
63
70
|
has [{:or => %w{list:sbcl-devel list:sbcl-help}}]
|
64
71
|
never_spam
|
65
72
|
label 'lisp/sbcl'
|
73
|
+
smart_label 'forums'
|
66
74
|
}.archive_unless_directed
|
67
75
|
|
68
76
|
filter {
|
69
77
|
has %w{list:cclan-list@lists.sourceforge.net}
|
70
78
|
never_spam
|
71
79
|
label 'lisp/cclan'
|
80
|
+
smart_label 'forums'
|
72
81
|
}.archive_unless_directed
|
73
82
|
|
74
83
|
filter {
|
75
84
|
has %w{list:openmcl-*}
|
76
85
|
label 'lisp/clozure'
|
86
|
+
smart_label 'forums'
|
77
87
|
}.archive_unless_directed
|
78
88
|
|
79
89
|
filter {
|
80
90
|
has %w{list:quicklisp@googlegroups.com}
|
81
91
|
label 'lisp/quicklisp'
|
92
|
+
smart_label 'forums'
|
82
93
|
}.archive_unless_directed
|
83
94
|
|
84
95
|
filter {
|
85
96
|
has [{:or => %w{list:thingiverse@googlegroups.com list:replicatorg-dev@googlegroups.com}}]
|
86
97
|
label 'thingiverse'
|
98
|
+
smart_label 'forums'
|
87
99
|
}.archive_unless_directed
|
88
100
|
|
89
101
|
filter {
|
90
102
|
has %w{list:openscad@rocklinux.org}
|
91
103
|
label 'thingiverse'
|
104
|
+
smart_label 'forums'
|
92
105
|
}.archive_unless_directed
|
93
106
|
|
94
107
|
filter {
|
95
108
|
has %w{list:emacs-orgmode@gnu.org}
|
96
109
|
label 'orgmode'
|
110
|
+
smart_label 'forums'
|
97
111
|
}.archive_unless_directed
|
98
112
|
|
99
113
|
filter {
|
100
114
|
has %w{list:elixir-lang-core@googlegroups.com}
|
101
115
|
label 'elixir'
|
116
|
+
smart_label 'forums'
|
102
117
|
}.archive_unless_directed
|
103
118
|
|
104
119
|
filter {
|
105
120
|
has [{:or => %w{list:discuss@lists.acemonstertoys.org list:amt-laserific@googlegroups.com
|
106
121
|
list:noisebridge-discuss@lists.noisebridge.net list:*@lists.metalab.at}}]
|
107
122
|
label 'hackerspaces'
|
123
|
+
smart_label 'forums'
|
108
124
|
}.archive_unless_directed
|
109
125
|
|
110
126
|
# Stuff from the bank:
|
@@ -128,18 +144,27 @@ puts(GmailBritta.filterset(:me => MY_EMAILS) do
|
|
128
144
|
}.archive_unless_directed
|
129
145
|
|
130
146
|
filter {
|
131
|
-
has
|
147
|
+
has %w{notifications@github.com}
|
148
|
+
label 'open-source'
|
149
|
+
}
|
150
|
+
|
151
|
+
filter {
|
152
|
+
has [FB_EMAIL, {:or => ['subject:"added you as a friend"', 'subject:"new messages from"', 'subject:"new message from"', 'subject:"changed the time"']}]
|
132
153
|
label 'bulk/fb'
|
154
|
+
smart_label 'social'
|
133
155
|
}.otherwise {
|
134
156
|
has [FB_EMAIL]
|
135
157
|
label 'bulk/fb'
|
158
|
+
smart_label 'social'
|
136
159
|
archive
|
137
160
|
}.otherwise {
|
138
161
|
has TWITTER_EMAILS + [{:or => ['subject:"is now following"', 'subject:"direct message"']}]
|
139
162
|
label 'bulk/twitter'
|
163
|
+
smart_label 'social'
|
140
164
|
}.otherwise {
|
141
165
|
has [{:or => TWITTER_EMAILS + TWITTER_TEST_EMAILS}]
|
142
166
|
label 'bulk/twitter'
|
167
|
+
smart_label 'social'
|
143
168
|
archive
|
144
169
|
mark_read
|
145
170
|
}.otherwise {
|
@@ -158,6 +183,7 @@ puts(GmailBritta.filterset(:me => MY_EMAILS) do
|
|
158
183
|
has [{:or => "from:(#{bacon_senders.join("|")})"}]
|
159
184
|
archive
|
160
185
|
label 'bulk'
|
186
|
+
smart_label 'notifications'
|
161
187
|
}.otherwise {
|
162
188
|
to_me = me.map {|address| "to:#{address}"}
|
163
189
|
has [{:or => to_me}]
|
@@ -165,8 +191,9 @@ puts(GmailBritta.filterset(:me => MY_EMAILS) do
|
|
165
191
|
}
|
166
192
|
|
167
193
|
filter {
|
168
|
-
has
|
194
|
+
has [{:or => ['from:ship-confirm@amazon.com', 'from:auto-confirm@amazon.com', 'subject:"shipped"', '"tracking number"']}]
|
169
195
|
label 'bulk/packages'
|
196
|
+
smart_label 'notifications'
|
170
197
|
forward_to AMAZON_PACKAGE_TRACKING_EMAIL
|
171
198
|
}
|
172
199
|
|
data/gmail-britta.gemspec
CHANGED
@@ -2,14 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: gmail-britta 0.1.7 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
8
|
s.name = "gmail-britta"
|
8
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.7"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["Andreas Fuchs"]
|
12
|
-
s.date = "
|
14
|
+
s.date = "2016-01-29"
|
13
15
|
s.description = "This gem helps create large (>50) gmail filter chains by writing xml compatible with gmail's \"import/export filters\" feature."
|
14
16
|
s.email = "asf@boinkor.net"
|
15
17
|
s.extra_rdoc_files = [
|
@@ -25,6 +27,7 @@ Gem::Specification.new do |s|
|
|
25
27
|
"LICENSE.txt",
|
26
28
|
"README.md",
|
27
29
|
"Rakefile",
|
30
|
+
"THANKS.md",
|
28
31
|
"TODO.org",
|
29
32
|
"VERSION",
|
30
33
|
"examples/Gemfile",
|
@@ -33,6 +36,7 @@ Gem::Specification.new do |s|
|
|
33
36
|
"examples/asf.rb",
|
34
37
|
"gmail-britta.gemspec",
|
35
38
|
"lib/gmail-britta.rb",
|
39
|
+
"lib/gmail-britta/chaining_filter.rb",
|
36
40
|
"lib/gmail-britta/filter.rb",
|
37
41
|
"lib/gmail-britta/filter_set.rb",
|
38
42
|
"lib/gmail-britta/single_write_accessors.rb",
|
@@ -40,33 +44,32 @@ Gem::Specification.new do |s|
|
|
40
44
|
]
|
41
45
|
s.homepage = "http://github.com/antifuchs/gmail-britta"
|
42
46
|
s.licenses = ["MIT"]
|
43
|
-
s.
|
44
|
-
s.rubygems_version = "1.8.23"
|
47
|
+
s.rubygems_version = "2.2.5"
|
45
48
|
s.summary = "Create complex gmail filtersets with a ruby DSL."
|
46
49
|
|
47
50
|
if s.respond_to? :specification_version then
|
48
|
-
s.specification_version =
|
51
|
+
s.specification_version = 4
|
49
52
|
|
50
53
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
51
54
|
s.add_runtime_dependency(%q<haml>, ["~> 3.1.6"])
|
52
|
-
s.add_development_dependency(%q<rake>, ["
|
55
|
+
s.add_development_dependency(%q<rake>, [">= 0.9.2"])
|
53
56
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
54
|
-
s.add_development_dependency(%q<bundler>, ["
|
57
|
+
s.add_development_dependency(%q<bundler>, [">= 1.2.0"])
|
55
58
|
s.add_development_dependency(%q<minitest>, [">= 0"])
|
56
59
|
s.add_development_dependency(%q<nokogiri>, [">= 0"])
|
57
60
|
else
|
58
61
|
s.add_dependency(%q<haml>, ["~> 3.1.6"])
|
59
|
-
s.add_dependency(%q<rake>, ["
|
62
|
+
s.add_dependency(%q<rake>, [">= 0.9.2"])
|
60
63
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
61
|
-
s.add_dependency(%q<bundler>, ["
|
64
|
+
s.add_dependency(%q<bundler>, [">= 1.2.0"])
|
62
65
|
s.add_dependency(%q<minitest>, [">= 0"])
|
63
66
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
64
67
|
end
|
65
68
|
else
|
66
69
|
s.add_dependency(%q<haml>, ["~> 3.1.6"])
|
67
|
-
s.add_dependency(%q<rake>, ["
|
70
|
+
s.add_dependency(%q<rake>, [">= 0.9.2"])
|
68
71
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
69
|
-
s.add_dependency(%q<bundler>, ["
|
72
|
+
s.add_dependency(%q<bundler>, [">= 1.2.0"])
|
70
73
|
s.add_dependency(%q<minitest>, [">= 0"])
|
71
74
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
72
75
|
end
|