sup 1.0 → 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/checks.yml +58 -0
  3. data/.rubocop.yml +5 -0
  4. data/CONTRIBUTORS +5 -2
  5. data/Gemfile +5 -1
  6. data/History.txt +33 -0
  7. data/Manifest.txt +171 -0
  8. data/README.md +9 -4
  9. data/Rakefile +40 -1
  10. data/bin/sup-add +4 -8
  11. data/bin/sup-sync-back-maildir +1 -1
  12. data/contrib/nix/Gemfile +22 -0
  13. data/contrib/nix/Gemfile.lock +80 -0
  14. data/contrib/nix/README +7 -0
  15. data/contrib/nix/gem-install-shell.nix +12 -0
  16. data/contrib/nix/gemset.nix +339 -0
  17. data/contrib/nix/ruby2.4-Gemfile.lock +81 -0
  18. data/contrib/nix/ruby2.4-gemset.nix +309 -0
  19. data/contrib/nix/ruby2.4-shell.nix +30 -0
  20. data/contrib/nix/ruby2.5-Gemfile.lock +81 -0
  21. data/contrib/nix/ruby2.5-gemset.nix +309 -0
  22. data/contrib/nix/ruby2.5-shell.nix +30 -0
  23. data/contrib/nix/ruby2.6-Gemfile.lock +83 -0
  24. data/contrib/nix/ruby2.6-gemset.nix +319 -0
  25. data/contrib/nix/ruby2.6-shell.nix +30 -0
  26. data/contrib/nix/ruby2.7-shell.nix +23 -0
  27. data/contrib/nix/ruby3.0-shell.nix +23 -0
  28. data/contrib/nix/ruby3.1-shell.nix +23 -0
  29. data/contrib/nix/ruby3.2-shell.nix +23 -0
  30. data/contrib/nix/ruby3.3-shell.nix +23 -0
  31. data/contrib/nix/test-all-rubies.sh +6 -0
  32. data/doc/Hooks.txt +1 -1
  33. data/ext/mkrf_conf_xapian.rb +12 -6
  34. data/lib/sup/colormap.rb +1 -1
  35. data/lib/sup/crypto.rb +1 -1
  36. data/lib/sup/hook.rb +1 -1
  37. data/lib/sup/index.rb +4 -4
  38. data/lib/sup/keymap.rb +1 -1
  39. data/lib/sup/maildir.rb +5 -5
  40. data/lib/sup/mbox.rb +5 -5
  41. data/lib/sup/message.rb +8 -7
  42. data/lib/sup/message_chunks.rb +27 -19
  43. data/lib/sup/modes/completion_mode.rb +0 -1
  44. data/lib/sup/modes/console_mode.rb +1 -1
  45. data/lib/sup/modes/file_browser_mode.rb +2 -2
  46. data/lib/sup/modes/label_list_mode.rb +1 -1
  47. data/lib/sup/modes/search_list_mode.rb +2 -2
  48. data/lib/sup/modes/thread_view_mode.rb +1 -2
  49. data/lib/sup/rfc2047.rb +21 -6
  50. data/lib/sup/source.rb +8 -2
  51. data/lib/sup/textfield.rb +0 -1
  52. data/lib/sup/thread.rb +20 -21
  53. data/lib/sup/util.rb +31 -53
  54. data/lib/sup/version.rb +1 -1
  55. data/lib/sup.rb +12 -8
  56. data/man/sup-add.1 +39 -39
  57. data/man/sup-config.1 +31 -27
  58. data/man/sup-dump.1 +34 -35
  59. data/man/sup-import-dump.1 +36 -32
  60. data/man/sup-psych-ify-config-files.1 +29 -25
  61. data/man/sup-recover-sources.1 +32 -28
  62. data/man/sup-sync-back-maildir.1 +34 -30
  63. data/man/sup-sync.1 +40 -36
  64. data/man/sup-tweak-labels.1 +36 -32
  65. data/man/sup.1 +41 -37
  66. data/shell.nix +1 -0
  67. data/sup.gemspec +6 -4
  68. data/test/dummy_source.rb +21 -15
  69. data/test/fixtures/embedded-message.eml +34 -0
  70. data/test/fixtures/non-ascii-header-in-nested-message.eml +36 -0
  71. data/test/fixtures/non-ascii-header.eml +8 -0
  72. data/test/fixtures/rfc2047-header-encoding.eml +15 -0
  73. data/test/fixtures/text-attachments-with-charset.eml +15 -1
  74. data/test/fixtures/utf8-header.eml +17 -0
  75. data/test/integration/test_maildir.rb +3 -0
  76. data/test/integration/test_mbox.rb +4 -1
  77. data/test/integration/test_sup-add.rb +83 -0
  78. data/test/integration/test_sup-sync-back-maildir.rb +40 -0
  79. data/test/test_crypto.rb +44 -0
  80. data/test/test_header_parsing.rb +11 -3
  81. data/test/test_helper.rb +7 -4
  82. data/test/test_message.rb +124 -32
  83. data/test/test_messages_dir.rb +13 -15
  84. data/test/unit/test_horizontal_selector.rb +4 -4
  85. data/test/unit/test_locale_fiddler.rb +1 -1
  86. data/test/unit/util/test_query.rb +1 -1
  87. data/test/unit/util/test_string.rb +3 -3
  88. data/test/unit/util/test_uri.rb +2 -2
  89. metadata +69 -18
  90. data/.travis.yml +0 -18
  91. data/bin/sup-psych-ify-config-files +0 -21
  92. data/test/integration/test_label_service.rb +0 -18
  93. data/test/test_yaml_migration.rb +0 -85
@@ -0,0 +1,319 @@
1
+ {
2
+ ast = {
3
+ groups = ["default"];
4
+ platforms = [];
5
+ source = {
6
+ remotes = ["https://rubygems.org"];
7
+ sha256 = "04nc8x27hlzlrr5c2gn7mar4vdr0apw5xg22wp6m8dx3wqr04a0y";
8
+ type = "gem";
9
+ };
10
+ version = "2.4.2";
11
+ };
12
+ chronic = {
13
+ groups = ["default"];
14
+ platforms = [];
15
+ source = {
16
+ remotes = ["https://rubygems.org"];
17
+ sha256 = "1hrdkn4g8x7dlzxwb1rfgr8kw3bp4ywg5l4y4i9c2g5cwv62yvvn";
18
+ type = "gem";
19
+ };
20
+ version = "0.10.2";
21
+ };
22
+ coderay = {
23
+ groups = ["default"];
24
+ platforms = [];
25
+ source = {
26
+ remotes = ["https://rubygems.org"];
27
+ sha256 = "0jvxqxzply1lwp7ysn94zjhh57vc14mcshw1ygw14ib8lhc00lyw";
28
+ type = "gem";
29
+ };
30
+ version = "1.1.3";
31
+ };
32
+ gpgme = {
33
+ dependencies = ["mini_portile2"];
34
+ groups = ["default"];
35
+ platforms = [];
36
+ source = {
37
+ remotes = ["https://rubygems.org"];
38
+ sha256 = "010wr6nnifi952bx4v5c49q25yx1g8lhib5wiv2sg7bip3yvlyy8";
39
+ type = "gem";
40
+ };
41
+ version = "2.0.23";
42
+ };
43
+ highline = {
44
+ groups = ["default"];
45
+ platforms = [];
46
+ source = {
47
+ remotes = ["https://rubygems.org"];
48
+ sha256 = "0yclf57n2j3cw8144ania99h1zinf8q3f5zrhqa754j6gl95rp9d";
49
+ type = "gem";
50
+ };
51
+ version = "2.0.3";
52
+ };
53
+ json = {
54
+ groups = ["default"];
55
+ platforms = [];
56
+ source = {
57
+ remotes = ["https://rubygems.org"];
58
+ sha256 = "0yk5d10yvspkc5jyvx9gc1a9pn1z8v4k2hvjk1l88zixwf3wf3cl";
59
+ type = "gem";
60
+ };
61
+ version = "2.6.2";
62
+ };
63
+ locale = {
64
+ groups = ["default"];
65
+ platforms = [];
66
+ source = {
67
+ remotes = ["https://rubygems.org"];
68
+ sha256 = "0997465kxvpxm92fiwc2b16l49mngk7b68g5k35ify0m3q0yxpdn";
69
+ type = "gem";
70
+ };
71
+ version = "2.1.3";
72
+ };
73
+ lockfile = {
74
+ groups = ["default"];
75
+ platforms = [];
76
+ source = {
77
+ remotes = ["https://rubygems.org"];
78
+ sha256 = "0dij3ijywylvfgrpi2i0k17f6w0wjhnjjw0k9030f54z56cz7jrr";
79
+ type = "gem";
80
+ };
81
+ version = "2.1.3";
82
+ };
83
+ method_source = {
84
+ groups = ["default"];
85
+ platforms = [];
86
+ source = {
87
+ remotes = ["https://rubygems.org"];
88
+ sha256 = "1pnyh44qycnf9mzi1j6fywd5fkskv3x7nmsqrrws0rjn5dd4ayfp";
89
+ type = "gem";
90
+ };
91
+ version = "1.0.0";
92
+ };
93
+ mime-types = {
94
+ dependencies = ["mime-types-data"];
95
+ groups = ["default"];
96
+ platforms = [];
97
+ source = {
98
+ remotes = ["https://rubygems.org"];
99
+ sha256 = "0ipw892jbksbxxcrlx9g5ljq60qx47pm24ywgfbyjskbcl78pkvb";
100
+ type = "gem";
101
+ };
102
+ version = "3.4.1";
103
+ };
104
+ mime-types-data = {
105
+ groups = ["default"];
106
+ platforms = [];
107
+ source = {
108
+ remotes = ["https://rubygems.org"];
109
+ sha256 = "003gd7mcay800k2q4pb2zn8lwwgci4bhi42v2jvlidm8ksx03i6q";
110
+ type = "gem";
111
+ };
112
+ version = "3.2022.0105";
113
+ };
114
+ mini_portile2 = {
115
+ groups = ["default"];
116
+ platforms = [];
117
+ source = {
118
+ remotes = ["https://rubygems.org"];
119
+ sha256 = "1kl9c3kdchjabrihdqfmcplk3lq4cw1rr9f378y6q22qwy5dndvs";
120
+ type = "gem";
121
+ };
122
+ version = "2.8.5";
123
+ };
124
+ minitest = {
125
+ groups = ["default"];
126
+ platforms = [];
127
+ source = {
128
+ remotes = ["https://rubygems.org"];
129
+ sha256 = "14a9ign0hj3z3j4cpfplj2djaskx3skzyx4fl3x53d7saxmhrgn1";
130
+ type = "gem";
131
+ };
132
+ version = "5.16.2";
133
+ };
134
+ ncursesw = {
135
+ groups = ["default"];
136
+ platforms = [];
137
+ source = {
138
+ remotes = ["https://rubygems.org"];
139
+ sha256 = "0qlfhp9b445g0qp9kkdiylfjlpfzrv6nqvry4ar6y0yacn0zr5y8";
140
+ type = "gem";
141
+ };
142
+ version = "1.4.11";
143
+ };
144
+ optimist = {
145
+ groups = ["default"];
146
+ platforms = [];
147
+ source = {
148
+ remotes = ["https://rubygems.org"];
149
+ sha256 = "1vg2chy1cfmdj6c1gryl8zvjhhmb3plwgyh1jfnpq4fnfqv7asrk";
150
+ type = "gem";
151
+ };
152
+ version = "3.0.1";
153
+ };
154
+ parallel = {
155
+ groups = ["default"];
156
+ platforms = [];
157
+ source = {
158
+ remotes = ["https://rubygems.org"];
159
+ sha256 = "07vnk6bb54k4yc06xnwck7php50l09vvlw1ga8wdz0pia461zpzb";
160
+ type = "gem";
161
+ };
162
+ version = "1.22.1";
163
+ };
164
+ parser = {
165
+ dependencies = ["ast"];
166
+ groups = ["default"];
167
+ platforms = [];
168
+ source = {
169
+ remotes = ["https://rubygems.org"];
170
+ sha256 = "0xhfghgidj8cbdnqp01f7kvnrv1f60izpkd9dhxsvpdzkfsdg97d";
171
+ type = "gem";
172
+ };
173
+ version = "3.1.2.0";
174
+ };
175
+ pry = {
176
+ dependencies = ["coderay" "method_source"];
177
+ groups = ["default"];
178
+ platforms = [];
179
+ source = {
180
+ remotes = ["https://rubygems.org"];
181
+ sha256 = "0m445x8fwcjdyv2bc0glzss2nbm1ll51bq45knixapc7cl3dzdlr";
182
+ type = "gem";
183
+ };
184
+ version = "0.14.1";
185
+ };
186
+ rainbow = {
187
+ groups = ["default"];
188
+ platforms = [];
189
+ source = {
190
+ remotes = ["https://rubygems.org"];
191
+ sha256 = "0smwg4mii0fm38pyb5fddbmrdpifwv22zv3d3px2xx497am93503";
192
+ type = "gem";
193
+ };
194
+ version = "3.1.1";
195
+ };
196
+ rake = {
197
+ groups = ["default"];
198
+ platforms = [];
199
+ source = {
200
+ remotes = ["https://rubygems.org"];
201
+ sha256 = "15whn7p9nrkxangbs9hh75q585yfn66lv0v2mhj6q6dl6x8bzr2w";
202
+ type = "gem";
203
+ };
204
+ version = "13.0.6";
205
+ };
206
+ regexp_parser = {
207
+ groups = ["default"];
208
+ platforms = [];
209
+ source = {
210
+ remotes = ["https://rubygems.org"];
211
+ sha256 = "1rfd3q17p7q7pa67844q8b16ipy6ksh8mkzynpm1zldqbb9x4xm0";
212
+ type = "gem";
213
+ };
214
+ version = "2.5.0";
215
+ };
216
+ rexml = {
217
+ groups = ["default"];
218
+ platforms = [];
219
+ source = {
220
+ remotes = ["https://rubygems.org"];
221
+ sha256 = "08ximcyfjy94pm1rhcx04ny1vx2sk0x4y185gzn86yfsbzwkng53";
222
+ type = "gem";
223
+ };
224
+ version = "3.2.5";
225
+ };
226
+ rmail = {
227
+ groups = ["default"];
228
+ platforms = [];
229
+ source = {
230
+ remotes = ["https://rubygems.org"];
231
+ sha256 = "0m5npkmv764m725wzjzasgf3k8q5anf3vfr6k2cac1xj6jc8lcqi";
232
+ type = "gem";
233
+ };
234
+ version = "1.1.4";
235
+ };
236
+ rr = {
237
+ groups = ["default"];
238
+ platforms = [];
239
+ source = {
240
+ remotes = ["https://rubygems.org"];
241
+ sha256 = "1n9g78ba4c2zzmz8cdb97c38h1xm0clircag00vbcxwqs4dq0ymp";
242
+ type = "gem";
243
+ };
244
+ version = "1.2.1";
245
+ };
246
+ rubocop = {
247
+ dependencies = ["json" "parallel" "parser" "rainbow" "regexp_parser" "rexml" "rubocop-ast" "ruby-progressbar" "unicode-display_width"];
248
+ groups = ["default"];
249
+ platforms = [];
250
+ source = {
251
+ remotes = ["https://rubygems.org"];
252
+ sha256 = "09k371m1l177ca8w70hfbjb1w0hasfb46pxp4w6yw92kk71akll2";
253
+ type = "gem";
254
+ };
255
+ version = "1.32.0";
256
+ };
257
+ rubocop-ast = {
258
+ dependencies = ["parser"];
259
+ groups = ["default"];
260
+ platforms = [];
261
+ source = {
262
+ remotes = ["https://rubygems.org"];
263
+ sha256 = "0h8q3gwqs8afshjd2l52ywf48md9rskr3q2y4fydgm536vvahjgm";
264
+ type = "gem";
265
+ };
266
+ version = "1.19.1";
267
+ };
268
+ rubocop-packaging = {
269
+ dependencies = ["rubocop"];
270
+ groups = ["default"];
271
+ platforms = [];
272
+ source = {
273
+ remotes = ["https://rubygems.org"];
274
+ sha256 = "0bzjd1077v96pyp62jg7s8ndxqbdhfnrdpdnmgi7h88xw22fp5xf";
275
+ type = "gem";
276
+ };
277
+ version = "0.5.1";
278
+ };
279
+ ruby-progressbar = {
280
+ groups = ["default"];
281
+ platforms = [];
282
+ source = {
283
+ remotes = ["https://rubygems.org"];
284
+ sha256 = "02nmaw7yx9kl7rbaan5pl8x5nn0y4j5954mzrkzi9i3dhsrps4nc";
285
+ type = "gem";
286
+ };
287
+ version = "1.11.0";
288
+ };
289
+ unicode = {
290
+ groups = ["default"];
291
+ platforms = [];
292
+ source = {
293
+ remotes = ["https://rubygems.org"];
294
+ sha256 = "1v8kxmq9i85agjpl7pnl72688901xhs8wxhmj6lpy16a8xz3nzxk";
295
+ type = "gem";
296
+ };
297
+ version = "0.4.4.4";
298
+ };
299
+ unicode-display_width = {
300
+ groups = ["default"];
301
+ platforms = [];
302
+ source = {
303
+ remotes = ["https://rubygems.org"];
304
+ sha256 = "1nlfck6z986fngp0r74maswmyb1rcksc8xc3mfpw9cj23c3s8zwn";
305
+ type = "gem";
306
+ };
307
+ version = "2.2.0";
308
+ };
309
+ xapian-ruby = {
310
+ groups = ["default"];
311
+ platforms = [];
312
+ source = {
313
+ remotes = ["https://rubygems.org"];
314
+ sha256 = "1z8arjkd0nlj6zv9in2sihmbwpbd17a10lsv7nwii7z0jjscyxpp";
315
+ type = "gem";
316
+ };
317
+ version = "1.4.18";
318
+ };
319
+ }
@@ -0,0 +1,30 @@
1
+ let
2
+ pkgs = import (builtins.fetchGit {
3
+ url = "https://github.com/NixOS/nixpkgs";
4
+ ref = "refs/heads/master";
5
+ rev = "3ef1d2a9602c18f8742e1fb63d5ae9867092e3d6";
6
+ }) {};
7
+ gems = pkgs.bundlerEnv {
8
+ name = "ruby2.6-gems-for-sup";
9
+ ruby = pkgs.ruby_2_6;
10
+ gemfile = ./Gemfile;
11
+ lockfile = ./ruby2.6-Gemfile.lock;
12
+ gemset = ./ruby2.6-gemset.nix;
13
+ gemConfig = pkgs.defaultGemConfig // {
14
+ # Workaround for a new error in clang 16 (MacOS):
15
+ # https://github.com/blackwinter/unicode/pull/11
16
+ unicode = attrs: {
17
+ buildFlags = [
18
+ "--with-cflags=-Wno-incompatible-function-pointer-types"
19
+ ];
20
+ };
21
+ # Workaround: remove rake from nativeBuildInputs, otherwise it causes
22
+ # xapian-bindings to build against the default Ruby version
23
+ # instead of our chosen version.
24
+ xapian-ruby = attrs: pkgs.defaultGemConfig.xapian-ruby attrs // {
25
+ dependencies = [ "rake" ];
26
+ nativeBuildInputs = [ pkgs.pkg-config ];
27
+ };
28
+ };
29
+ };
30
+ in pkgs.mkShell { packages = [ gems gems.wrappedRuby pkgs.pandoc ]; }
@@ -0,0 +1,23 @@
1
+ let
2
+ pkgs = import (builtins.fetchGit {
3
+ url = "https://github.com/NixOS/nixpkgs";
4
+ ref = "refs/heads/master";
5
+ rev = "402cc3633cc60dfc50378197305c984518b30773";
6
+ }) {};
7
+ gems = pkgs.bundlerEnv {
8
+ name = "ruby2.7-gems-for-sup";
9
+ ruby = pkgs.ruby_2_7;
10
+ gemfile = ./Gemfile;
11
+ lockfile = ./Gemfile.lock;
12
+ gemset = ./gemset.nix;
13
+ gemConfig = pkgs.defaultGemConfig // {
14
+ # Workaround for a new error in clang 16 (MacOS):
15
+ # https://github.com/blackwinter/unicode/pull/11
16
+ unicode = attrs: {
17
+ buildFlags = [
18
+ "--with-cflags=-Wno-incompatible-function-pointer-types"
19
+ ];
20
+ };
21
+ };
22
+ };
23
+ in pkgs.mkShell { packages = [ gems gems.wrappedRuby pkgs.pandoc ]; }
@@ -0,0 +1,23 @@
1
+ let
2
+ pkgs = import (builtins.fetchGit {
3
+ url = "https://github.com/NixOS/nixpkgs";
4
+ ref = "refs/heads/master";
5
+ rev = "402cc3633cc60dfc50378197305c984518b30773";
6
+ }) {};
7
+ gems = pkgs.bundlerEnv {
8
+ name = "ruby3.0-gems-for-sup";
9
+ ruby = pkgs.ruby_3_0;
10
+ gemfile = ./Gemfile;
11
+ lockfile = ./Gemfile.lock;
12
+ gemset = ./gemset.nix;
13
+ gemConfig = pkgs.defaultGemConfig // {
14
+ # Workaround for a new error in clang 16 (MacOS):
15
+ # https://github.com/blackwinter/unicode/pull/11
16
+ unicode = attrs: {
17
+ buildFlags = [
18
+ "--with-cflags=-Wno-incompatible-function-pointer-types"
19
+ ];
20
+ };
21
+ };
22
+ };
23
+ in pkgs.mkShell { packages = [ gems gems.wrappedRuby pkgs.pandoc ]; }
@@ -0,0 +1,23 @@
1
+ let
2
+ pkgs = import (builtins.fetchGit {
3
+ url = "https://github.com/NixOS/nixpkgs";
4
+ ref = "refs/heads/master";
5
+ rev = "0e2ba0d131331e318eba20fcb03db0372dc2a926";
6
+ }) {};
7
+ gems = pkgs.bundlerEnv {
8
+ name = "ruby3.1-gems-for-sup";
9
+ ruby = pkgs.ruby_3_1;
10
+ gemfile = ./Gemfile;
11
+ lockfile = ./Gemfile.lock;
12
+ gemset = ./gemset.nix;
13
+ gemConfig = pkgs.defaultGemConfig // {
14
+ # Workaround for a new error in clang 16 (MacOS):
15
+ # https://github.com/blackwinter/unicode/pull/11
16
+ unicode = attrs: {
17
+ buildFlags = [
18
+ "--with-cflags=-Wno-incompatible-function-pointer-types"
19
+ ];
20
+ };
21
+ };
22
+ };
23
+ in pkgs.mkShell { packages = [ gems gems.wrappedRuby pkgs.pandoc ]; }
@@ -0,0 +1,23 @@
1
+ let
2
+ pkgs = import (builtins.fetchGit {
3
+ url = "https://github.com/NixOS/nixpkgs";
4
+ ref = "refs/heads/master";
5
+ rev = "0e2ba0d131331e318eba20fcb03db0372dc2a926";
6
+ }) {};
7
+ gems = pkgs.bundlerEnv {
8
+ name = "ruby3.2-gems-for-sup";
9
+ ruby = pkgs.ruby_3_2;
10
+ gemfile = ./Gemfile;
11
+ lockfile = ./Gemfile.lock;
12
+ gemset = ./gemset.nix;
13
+ gemConfig = pkgs.defaultGemConfig // {
14
+ # Workaround for a new error in clang 16 (MacOS):
15
+ # https://github.com/blackwinter/unicode/pull/11
16
+ unicode = attrs: {
17
+ buildFlags = [
18
+ "--with-cflags=-Wno-incompatible-function-pointer-types"
19
+ ];
20
+ };
21
+ };
22
+ };
23
+ in pkgs.mkShell { packages = [ gems gems.wrappedRuby pkgs.pandoc ]; }
@@ -0,0 +1,23 @@
1
+ let
2
+ pkgs = import (builtins.fetchGit {
3
+ url = "https://github.com/NixOS/nixpkgs";
4
+ ref = "refs/heads/master";
5
+ rev = "0e2ba0d131331e318eba20fcb03db0372dc2a926";
6
+ }) {};
7
+ gems = pkgs.bundlerEnv {
8
+ name = "ruby3.3-gems-for-sup";
9
+ ruby = pkgs.ruby_3_3;
10
+ gemfile = ./Gemfile;
11
+ lockfile = ./Gemfile.lock;
12
+ gemset = ./gemset.nix;
13
+ gemConfig = pkgs.defaultGemConfig // {
14
+ # Workaround for a new error in clang 16 (MacOS):
15
+ # https://github.com/blackwinter/unicode/pull/11
16
+ unicode = attrs: {
17
+ buildFlags = [
18
+ "--with-cflags=-Wno-incompatible-function-pointer-types"
19
+ ];
20
+ };
21
+ };
22
+ };
23
+ in pkgs.mkShell { packages = [ gems gems.wrappedRuby pkgs.pandoc ]; }
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env bash
2
+ set -e
3
+ cd "$(dirname "$0")/../.."
4
+ for rubyversion in 2.4 2.5 2.6 2.7 3.0 3.1 3.2 ; do
5
+ nix-shell contrib/nix/ruby$rubyversion-shell.nix --run 'rake ci'
6
+ done
data/doc/Hooks.txt CHANGED
@@ -69,7 +69,7 @@ startup:
69
69
  set 'bgtask_pid' @bgtask_pid
70
70
  Process.detach(@bgtask_pid) # so we don't have to wait on it when we go to kill it
71
71
  else
72
- exec "background-task args 2&>1 >> /tmp/logfile"
72
+ exec "background-task args 2>&1 >> /tmp/logfile"
73
73
  end
74
74
 
75
75
  after-poll:
@@ -10,13 +10,19 @@ end
10
10
 
11
11
  puts "xapian: platform specific dependencies.."
12
12
 
13
- inst = Gem::DependencyInstaller.new
13
+ destination = File.writable?(Gem.dir) ? Gem.dir : Gem.user_dir
14
+ inst = Gem::DependencyInstaller.new(:install_dir => destination)
14
15
  begin
15
16
 
16
- if !RbConfig::CONFIG['arch'].include?('openbsd')
17
+ if not ENV.include? "SUP_SKIP_XAPIAN_GEM_INSTALL"
17
18
  # update version in Gemfile as well
18
19
  name = "xapian-ruby"
19
- version = "~> 1.2"
20
+ version =
21
+ if /^2\.0\./ =~ RUBY_VERSION
22
+ ["~> 1.2", "< 1.3.6"]
23
+ else
24
+ "~> 1.2"
25
+ end
20
26
 
21
27
  begin
22
28
  # try to load gem
@@ -31,11 +37,11 @@ begin
31
37
 
32
38
  end
33
39
  else
34
- STDERR.puts "xapian: openbsd: you have to install xapian-core and xapian-bindings manually, have a look at: https://github.com/sup-heliotrope/sup/wiki/Installation%3A-OpenBSD"
40
+ STDERR.puts "xapian: you have to install xapian-core and xapian-bindings manually"
35
41
  end
36
42
 
37
- rescue
38
-
43
+ rescue StandardError => e
44
+ STDERR.puts "Unable to install #{name} gem: #{e.inspect}"
39
45
  exit(1)
40
46
 
41
47
  end
data/lib/sup/colormap.rb CHANGED
@@ -236,7 +236,7 @@ class Colormap
236
236
  @@instance.send meth, *a
237
237
  end
238
238
  # Performance shortcut
239
- def self.color_for *a; @@instance.color_for *a; end
239
+ def self.color_for(*a); @@instance.color_for(*a); end
240
240
  end
241
241
 
242
242
  end
data/lib/sup/crypto.rb CHANGED
@@ -369,7 +369,7 @@ EOS
369
369
  def retrieve fingerprint
370
370
  require 'net/http'
371
371
  uri = URI($config[:keyserver_url] || KEYSERVER_URL)
372
- unless uri.scheme == "http" and not uri.host.nil?
372
+ unless uri.scheme == "http" and not uri.host.nil? and not uri.host.empty?
373
373
  return "Invalid url: #{uri}"
374
374
  end
375
375
 
data/lib/sup/hook.rb CHANGED
@@ -138,7 +138,7 @@ private
138
138
  returning IO.read(fn_for(name)) do
139
139
  debug "read '#{name}' from #{fn_for(name)}"
140
140
  end
141
- rescue SystemCallError => e
141
+ rescue SystemCallError
142
142
  #debug "disabled hook for '#{name}': #{e.message}"
143
143
  nil
144
144
  end
data/lib/sup/index.rb CHANGED
@@ -99,14 +99,14 @@ EOS
99
99
  end
100
100
 
101
101
  def load failsafe=false
102
- SourceManager.load_sources
102
+ SourceManager.load_sources File.join(@dir, "sources.yaml")
103
103
  load_index failsafe
104
104
  end
105
105
 
106
106
  def save
107
107
  debug "saving index and sources..."
108
108
  FileUtils.mkdir_p @dir unless File.exist? @dir
109
- SourceManager.save_sources
109
+ SourceManager.save_sources File.join(@dir, "sources.yaml")
110
110
  save_index
111
111
  end
112
112
 
@@ -425,7 +425,7 @@ EOS
425
425
 
426
426
  ## gmail style "is" operator
427
427
  subs = subs.gsub(/\b(is|has):(\S+)\b/) do
428
- field, label = $1, $2
428
+ _field, label = $1, $2
429
429
  case label
430
430
  when "read"
431
431
  "-label:unread"
@@ -649,7 +649,7 @@ EOS
649
649
  end
650
650
 
651
651
  def synchronize &b
652
- @index_mutex.synchronize &b
652
+ @index_mutex.synchronize(&b)
653
653
  end
654
654
 
655
655
  def run_query xapian_query, offset, limit, checkatleast=0
data/lib/sup/keymap.rb CHANGED
@@ -98,7 +98,7 @@ EOS
98
98
  end
99
99
 
100
100
  def action_for kc
101
- action, help, keys = @map[kc.code]
101
+ action, help, _keys = @map[kc.code]
102
102
  [action, help]
103
103
  end
104
104
 
data/lib/sup/maildir.rb CHANGED
@@ -12,25 +12,25 @@ class Maildir < Source
12
12
  def initialize uri, usual=true, archived=false, sync_back=true, id=nil, labels=[]
13
13
  super uri, usual, archived, id
14
14
  @expanded_uri = Source.expand_filesystem_uri(uri)
15
- parts = @expanded_uri.match /^([a-zA-Z0-9]*:(\/\/)?)(.*)/
15
+ parts = /^([a-zA-Z0-9]*:(\/\/)?)(.*)/.match @expanded_uri
16
16
  if parts
17
17
  prefix = parts[1]
18
18
  @path = parts[3]
19
- uri = URI(prefix + URI.encode(@path, URI_ENCODE_CHARS))
19
+ uri = URI(prefix + Source.encode_path_for_uri(@path))
20
20
  else
21
- uri = URI(URI.encode @expanded_uri, URI_ENCODE_CHARS)
21
+ uri = URI(Source.encode_path_for_uri @path)
22
22
  @path = uri.path
23
23
  end
24
24
 
25
25
  raise ArgumentError, "not a maildir URI" unless uri.scheme == "maildir"
26
- raise ArgumentError, "maildir URI cannot have a host: #{uri.host}" if uri.host
26
+ raise ArgumentError, "maildir URI cannot have a host: #{uri.host}" unless uri.host.nil? || uri.host.empty?
27
27
  raise ArgumentError, "maildir URI must have a path component" unless uri.path
28
28
 
29
29
  @sync_back = sync_back
30
30
  # sync by default if not specified
31
31
  @sync_back = true if @sync_back.nil?
32
32
 
33
- @dir = URI.decode uri.path
33
+ @dir = URI.decode_www_form_component uri.path
34
34
  @labels = Set.new(labels || [])
35
35
  @mutex = Mutex.new
36
36
  @ctimes = { 'cur' => Time.at(0), 'new' => Time.at(0) }
data/lib/sup/mbox.rb CHANGED
@@ -19,24 +19,24 @@ class MBox < Source
19
19
  case uri_or_fp
20
20
  when String
21
21
  @expanded_uri = Source.expand_filesystem_uri(uri_or_fp)
22
- parts = @expanded_uri.match /^([a-zA-Z0-9]*:(\/\/)?)(.*)/
22
+ parts = /^([a-zA-Z0-9]*:(\/\/)?)(.*)/.match @expanded_uri
23
23
  if parts
24
24
  prefix = parts[1]
25
25
  @path = parts[3]
26
- uri = URI(prefix + URI.encode(@path, URI_ENCODE_CHARS))
26
+ uri = URI(prefix + Source.encode_path_for_uri(@path))
27
27
  else
28
- uri = URI(URI.encode @expanded_uri, URI_ENCODE_CHARS)
28
+ uri = URI(Source.encode_path_for_uri @expanded_uri)
29
29
  @path = uri.path
30
30
  end
31
31
 
32
32
  raise ArgumentError, "not an mbox uri" unless uri.scheme == "mbox"
33
- raise ArgumentError, "mbox URI ('#{uri}') cannot have a host: #{uri.host}" if uri.host
33
+ raise ArgumentError, "mbox URI ('#{uri}') cannot have a host: #{uri.host}" unless uri.host.nil? || uri.host.empty?
34
34
  raise ArgumentError, "mbox URI must have a path component" unless uri.path
35
35
  @f = nil
36
36
  else
37
37
  @f = uri_or_fp
38
38
  @path = uri_or_fp.path
39
- @expanded_uri = "mbox://#{URI.encode @path, URI_ENCODE_CHARS}"
39
+ @expanded_uri = "mbox://#{Source.encode_path_for_uri @path}"
40
40
  end
41
41
 
42
42
  super uri_or_fp, usual, archived, id