sup 1.2 → 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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/checks.yml +19 -4
  3. data/.gitmodules +1 -0
  4. data/.rubocop.yml +1 -1
  5. data/History.txt +33 -0
  6. data/Manifest.txt +21 -2
  7. data/README.md +5 -3
  8. data/Rakefile +1 -1
  9. data/bin/sup +5 -3
  10. data/contrib/nix/Gemfile +2 -0
  11. data/contrib/nix/Gemfile.lock +62 -34
  12. data/contrib/nix/gem-install-shell.nix +2 -0
  13. data/contrib/nix/gemset.nix +130 -56
  14. data/contrib/nix/ruby2.4-Gemfile.lock +6 -2
  15. data/contrib/nix/ruby2.4-gemset.nix +24 -4
  16. data/contrib/nix/ruby2.4-shell.nix +2 -6
  17. data/contrib/nix/ruby2.5-Gemfile.lock +6 -2
  18. data/contrib/nix/ruby2.5-gemset.nix +24 -4
  19. data/contrib/nix/ruby2.5-shell.nix +2 -6
  20. data/contrib/nix/ruby2.6-Gemfile.lock +6 -2
  21. data/contrib/nix/ruby2.6-gemset.nix +24 -4
  22. data/contrib/nix/ruby2.6-shell.nix +2 -6
  23. data/contrib/nix/ruby2.7-Gemfile.lock +91 -0
  24. data/contrib/nix/ruby2.7-gemset.nix +359 -0
  25. data/contrib/nix/ruby2.7-shell.nix +2 -11
  26. data/contrib/nix/ruby3.0-Gemfile.lock +91 -0
  27. data/contrib/nix/ruby3.0-gemset.nix +359 -0
  28. data/contrib/nix/ruby3.0-shell.nix +2 -11
  29. data/contrib/nix/ruby3.1-Gemfile.lock +101 -0
  30. data/contrib/nix/ruby3.1-gemset.nix +391 -0
  31. data/contrib/nix/ruby3.1-shell.nix +3 -12
  32. data/contrib/nix/ruby3.2-Gemfile.lock +101 -0
  33. data/contrib/nix/ruby3.2-gemset.nix +391 -0
  34. data/contrib/nix/ruby3.2-shell.nix +3 -12
  35. data/contrib/nix/ruby3.3-shell.nix +1 -10
  36. data/contrib/nix/ruby3.4-shell.nix +27 -0
  37. data/contrib/nix/ruby4.0-shell.nix +40 -0
  38. data/contrib/nix/test-all-rubies.sh +1 -1
  39. data/lib/sup/account.rb +2 -0
  40. data/lib/sup/buffer.rb +1 -0
  41. data/lib/sup/contact.rb +3 -4
  42. data/lib/sup/crypto.rb +7 -5
  43. data/lib/sup/draft.rb +15 -11
  44. data/lib/sup/index.rb +8 -4
  45. data/lib/sup/maildir.rb +4 -0
  46. data/lib/sup/mbox.rb +25 -7
  47. data/lib/sup/message.rb +13 -10
  48. data/lib/sup/message_chunks.rb +0 -24
  49. data/lib/sup/mode.rb +1 -0
  50. data/lib/sup/modes/contact_list_mode.rb +0 -1
  51. data/lib/sup/modes/edit_message_mode.rb +6 -6
  52. data/lib/sup/modes/label_search_results_mode.rb +1 -2
  53. data/lib/sup/modes/line_cursor_mode.rb +22 -20
  54. data/lib/sup/modes/search_results_mode.rb +0 -1
  55. data/lib/sup/modes/thread_view_mode.rb +1 -2
  56. data/lib/sup/rfc2047.rb +5 -2
  57. data/lib/sup/source.rb +2 -0
  58. data/lib/sup/util.rb +9 -2
  59. data/lib/sup/version.rb +1 -1
  60. data/lib/sup.rb +1 -1
  61. data/man/sup-add.1 +18 -18
  62. data/man/sup-config.1 +12 -12
  63. data/man/sup-dump.1 +15 -14
  64. data/man/sup-import-dump.1 +24 -24
  65. data/man/sup-psych-ify-config-files.1 +11 -11
  66. data/man/sup-recover-sources.1 +20 -20
  67. data/man/sup-sync-back-maildir.1 +24 -23
  68. data/man/sup-sync.1 +35 -35
  69. data/man/sup-tweak-labels.1 +27 -26
  70. data/man/sup.1 +27 -27
  71. data/sup.gemspec +3 -1
  72. data/test/dummy_buffer.rb +34 -0
  73. data/test/dummy_source.rb +6 -0
  74. data/test/fixtures/contacts.txt +2 -1
  75. data/test/fixtures/embedded-message-rfc6532.eml +33 -0
  76. data/test/fixtures/invalid-date.eml +8 -0
  77. data/test/fixtures/rfc2047-header-encoding.eml +1 -1
  78. data/test/gnupg_test_home/private-keys-v1.d/26C05E44706A8E230B3255BB9532B34DC9420232.key +42 -0
  79. data/test/gnupg_test_home/private-keys-v1.d/D187ADC90EC4DEB7047678EAA37E33A53A465D47.key +5 -0
  80. data/test/gnupg_test_home/private-keys-v1.d/FB2D9BD3B1BE90B5BCF697781F8404224B0FCF5B.key +5 -0
  81. data/test/gnupg_test_home/pubring.gpg +0 -0
  82. data/test/gnupg_test_home/receiver_pubring.gpg +0 -0
  83. data/test/gnupg_test_home/receiver_secring.gpg +0 -0
  84. data/test/gnupg_test_home/regen_keys.sh +11 -2
  85. data/test/gnupg_test_home/secring.gpg +0 -0
  86. data/test/gnupg_test_home/sup-test-2@foo.bar.asc +20 -20
  87. data/test/integration/test_draft.rb +128 -0
  88. data/test/integration/test_maildir.rb +17 -1
  89. data/test/integration/test_mbox.rb +12 -0
  90. data/test/integration/test_sup-add.rb +4 -0
  91. data/test/test_crypto.rb +114 -72
  92. data/test/test_message.rb +43 -0
  93. data/test/unit/test_contact.rb +16 -4
  94. data/test/unit/test_edit_message_mode.rb +99 -0
  95. data/test/unit/test_index.rb +65 -0
  96. data/test/unit/test_line_cursor_mode.rb +208 -0
  97. data/test/unit/test_person.rb +3 -3
  98. data/test/unit/test_rmail_message.rb +36 -0
  99. data/test/unit/util/test_string.rb +3 -3
  100. metadata +64 -9
  101. data/shell.nix +0 -1
  102. data/test/gnupg_test_home/private-keys-v1.d/306D2EE90FF0014B5B9FD07E265C751791674140.key +0 -0
@@ -0,0 +1,391 @@
1
+ {
2
+ ast = {
3
+ groups = ["default"];
4
+ platforms = [];
5
+ source = {
6
+ remotes = ["https://rubygems.org"];
7
+ sha256 = "10yknjyn0728gjn6b5syynvrvrwm66bhssbxq8mkhshxghaiailm";
8
+ type = "gem";
9
+ };
10
+ version = "2.4.3";
11
+ };
12
+ benchmark = {
13
+ groups = ["default"];
14
+ platforms = [];
15
+ source = {
16
+ remotes = ["https://rubygems.org"];
17
+ sha256 = "0jl71qcgamm96dzyqk695j24qszhcc7liw74qc83fpjljp2gh4hg";
18
+ type = "gem";
19
+ };
20
+ version = "0.4.0";
21
+ };
22
+ chronic = {
23
+ groups = ["default"];
24
+ platforms = [];
25
+ source = {
26
+ remotes = ["https://rubygems.org"];
27
+ sha256 = "1hrdkn4g8x7dlzxwb1rfgr8kw3bp4ywg5l4y4i9c2g5cwv62yvvn";
28
+ type = "gem";
29
+ };
30
+ version = "0.10.2";
31
+ };
32
+ coderay = {
33
+ groups = ["default"];
34
+ platforms = [];
35
+ source = {
36
+ remotes = ["https://rubygems.org"];
37
+ sha256 = "0jvxqxzply1lwp7ysn94zjhh57vc14mcshw1ygw14ib8lhc00lyw";
38
+ type = "gem";
39
+ };
40
+ version = "1.1.3";
41
+ };
42
+ fiddle = {
43
+ groups = ["default"];
44
+ platforms = [];
45
+ source = {
46
+ remotes = ["https://rubygems.org"];
47
+ sha256 = "1as92bp6pgkab73kj3mh5d1idjr9wykczz7r9i1pkn82wq4xks3r";
48
+ type = "gem";
49
+ };
50
+ version = "1.1.6";
51
+ };
52
+ gpgme = {
53
+ dependencies = ["mini_portile2"];
54
+ groups = ["default"];
55
+ platforms = [];
56
+ source = {
57
+ remotes = ["https://rubygems.org"];
58
+ sha256 = "0r1vmql7w7ka5xzj1aqf8pk2a4sv0znwj2zkg1fgvd5b89qcvv2k";
59
+ type = "gem";
60
+ };
61
+ version = "2.0.24";
62
+ };
63
+ highline = {
64
+ dependencies = ["reline"];
65
+ groups = ["default"];
66
+ platforms = [];
67
+ source = {
68
+ remotes = ["https://rubygems.org"];
69
+ sha256 = "0jmvyhjp2v3iq47la7w6psrxbprnbnmzz0hxxski3vzn356x7jv7";
70
+ type = "gem";
71
+ };
72
+ version = "3.1.2";
73
+ };
74
+ io-console = {
75
+ groups = ["default"];
76
+ platforms = [];
77
+ source = {
78
+ remotes = ["https://rubygems.org"];
79
+ sha256 = "18pgvl7lfjpichdfh1g50rpz0zpaqrpr52ybn9liv1v9pjn9ysnd";
80
+ type = "gem";
81
+ };
82
+ version = "0.8.0";
83
+ };
84
+ json = {
85
+ groups = ["default"];
86
+ platforms = [];
87
+ source = {
88
+ remotes = ["https://rubygems.org"];
89
+ sha256 = "01lbdaizhkxmrw4y8j3wpvsryvnvzmg0pfs56c52laq2jgdfmq1l";
90
+ type = "gem";
91
+ };
92
+ version = "2.10.2";
93
+ };
94
+ language_server-protocol = {
95
+ groups = ["default"];
96
+ platforms = [];
97
+ source = {
98
+ remotes = ["https://rubygems.org"];
99
+ sha256 = "0scnz2fvdczdgadvjn0j9d49118aqm3hj66qh8sd2kv6g1j65164";
100
+ type = "gem";
101
+ };
102
+ version = "3.17.0.4";
103
+ };
104
+ locale = {
105
+ groups = ["default"];
106
+ platforms = [];
107
+ source = {
108
+ remotes = ["https://rubygems.org"];
109
+ sha256 = "107pm4ccmla23z963kyjldgngfigvchnv85wr6m69viyxxrrjbsj";
110
+ type = "gem";
111
+ };
112
+ version = "2.1.4";
113
+ };
114
+ lockfile = {
115
+ groups = ["default"];
116
+ platforms = [];
117
+ source = {
118
+ remotes = ["https://rubygems.org"];
119
+ sha256 = "0dij3ijywylvfgrpi2i0k17f6w0wjhnjjw0k9030f54z56cz7jrr";
120
+ type = "gem";
121
+ };
122
+ version = "2.1.3";
123
+ };
124
+ logger = {
125
+ groups = ["default"];
126
+ platforms = [];
127
+ source = {
128
+ remotes = ["https://rubygems.org"];
129
+ sha256 = "00q2zznygpbls8asz5knjvvj2brr3ghmqxgr83xnrdj4rk3xwvhr";
130
+ type = "gem";
131
+ };
132
+ version = "1.7.0";
133
+ };
134
+ method_source = {
135
+ groups = ["default"];
136
+ platforms = [];
137
+ source = {
138
+ remotes = ["https://rubygems.org"];
139
+ sha256 = "1igmc3sq9ay90f8xjvfnswd1dybj1s3fi0dwd53inwsvqk4h24qq";
140
+ type = "gem";
141
+ };
142
+ version = "1.1.0";
143
+ };
144
+ mime-types = {
145
+ dependencies = ["logger" "mime-types-data"];
146
+ groups = ["default"];
147
+ platforms = [];
148
+ source = {
149
+ remotes = ["https://rubygems.org"];
150
+ sha256 = "1bv08jvx1g9ifjdyrp5hgalxkv7qxwfmfx0ba43ncrbfda7182b1";
151
+ type = "gem";
152
+ };
153
+ version = "3.6.2";
154
+ };
155
+ mime-types-data = {
156
+ groups = ["default"];
157
+ platforms = [];
158
+ source = {
159
+ remotes = ["https://rubygems.org"];
160
+ sha256 = "1h0rhy0zf4ssrdr6cyliqijxga94cd64ij2gkw6jdx3bww1cap25";
161
+ type = "gem";
162
+ };
163
+ version = "3.2025.0402";
164
+ };
165
+ mini_portile2 = {
166
+ groups = ["default"];
167
+ platforms = [];
168
+ source = {
169
+ remotes = ["https://rubygems.org"];
170
+ sha256 = "0x8asxl83msn815lwmb2d7q5p29p7drhjv5va0byhk60v9n16iwf";
171
+ type = "gem";
172
+ };
173
+ version = "2.8.8";
174
+ };
175
+ minitest = {
176
+ groups = ["default"];
177
+ platforms = [];
178
+ source = {
179
+ remotes = ["https://rubygems.org"];
180
+ sha256 = "0mn7q9yzrwinvfvkyjiz548a4rmcwbmz2fn9nyzh4j1snin6q6rr";
181
+ type = "gem";
182
+ };
183
+ version = "5.25.5";
184
+ };
185
+ ncursesw = {
186
+ groups = ["default"];
187
+ platforms = [];
188
+ source = {
189
+ remotes = ["https://rubygems.org"];
190
+ sha256 = "1x06374njjl4xfxwkp6nq71akhazmqp9fyhkgxf6gac81p5wwdk6";
191
+ type = "gem";
192
+ };
193
+ version = "1.4.13";
194
+ };
195
+ optimist = {
196
+ groups = ["default"];
197
+ platforms = [];
198
+ source = {
199
+ remotes = ["https://rubygems.org"];
200
+ sha256 = "0kp3f8g7g7cbw5vfkmpdv71pphhpcxk3lpc892mj9apkd7ys1y4c";
201
+ type = "gem";
202
+ };
203
+ version = "3.2.1";
204
+ };
205
+ parallel = {
206
+ groups = ["default"];
207
+ platforms = [];
208
+ source = {
209
+ remotes = ["https://rubygems.org"];
210
+ sha256 = "1vy7sjs2pgz4i96v5yk9b7aafbffnvq7nn419fgvw55qlavsnsyq";
211
+ type = "gem";
212
+ };
213
+ version = "1.26.3";
214
+ };
215
+ parser = {
216
+ dependencies = ["ast" "racc"];
217
+ groups = ["default"];
218
+ platforms = [];
219
+ source = {
220
+ remotes = ["https://rubygems.org"];
221
+ sha256 = "1awq9rswd3mj8sr5acp1ca6nbkk57zpw8388j7w163i8fhi2h9ib";
222
+ type = "gem";
223
+ };
224
+ version = "3.3.7.4";
225
+ };
226
+ pry = {
227
+ dependencies = ["coderay" "method_source"];
228
+ groups = ["default"];
229
+ platforms = [];
230
+ source = {
231
+ remotes = ["https://rubygems.org"];
232
+ sha256 = "0ssv704qg75mwlyagdfr9xxbzn1ziyqgzm0x474jkynk8234pm8j";
233
+ type = "gem";
234
+ };
235
+ version = "0.15.2";
236
+ };
237
+ racc = {
238
+ groups = ["default"];
239
+ platforms = [];
240
+ source = {
241
+ remotes = ["https://rubygems.org"];
242
+ sha256 = "0byn0c9nkahsl93y9ln5bysq4j31q8xkf2ws42swighxd4lnjzsa";
243
+ type = "gem";
244
+ };
245
+ version = "1.8.1";
246
+ };
247
+ rainbow = {
248
+ groups = ["default"];
249
+ platforms = [];
250
+ source = {
251
+ remotes = ["https://rubygems.org"];
252
+ sha256 = "0smwg4mii0fm38pyb5fddbmrdpifwv22zv3d3px2xx497am93503";
253
+ type = "gem";
254
+ };
255
+ version = "3.1.1";
256
+ };
257
+ rake = {
258
+ groups = ["default"];
259
+ platforms = [];
260
+ source = {
261
+ remotes = ["https://rubygems.org"];
262
+ sha256 = "17850wcwkgi30p7yqh60960ypn7yibacjjha0av78zaxwvd3ijs6";
263
+ type = "gem";
264
+ };
265
+ version = "13.2.1";
266
+ };
267
+ regexp_parser = {
268
+ groups = ["default"];
269
+ platforms = [];
270
+ source = {
271
+ remotes = ["https://rubygems.org"];
272
+ sha256 = "1ndxm0xnv27p4gv6xynk6q41irckj76q1jsqpysd9h6f86hhp841";
273
+ type = "gem";
274
+ };
275
+ version = "2.9.0";
276
+ };
277
+ reline = {
278
+ dependencies = ["io-console"];
279
+ groups = ["default"];
280
+ platforms = [];
281
+ source = {
282
+ remotes = ["https://rubygems.org"];
283
+ sha256 = "1yvm0svcdk6377ng6l00g39ldkjijbqg4whdg2zcsa8hrgbwkz0s";
284
+ type = "gem";
285
+ };
286
+ version = "0.6.1";
287
+ };
288
+ rexml = {
289
+ groups = ["default"];
290
+ platforms = [];
291
+ source = {
292
+ remotes = ["https://rubygems.org"];
293
+ sha256 = "05i8518ay14kjbma550mv0jm8a6di8yp5phzrd8rj44z9qnrlrp0";
294
+ type = "gem";
295
+ };
296
+ version = "3.2.6";
297
+ };
298
+ rmail = {
299
+ groups = ["default"];
300
+ platforms = [];
301
+ source = {
302
+ remotes = ["https://rubygems.org"];
303
+ sha256 = "0m5npkmv764m725wzjzasgf3k8q5anf3vfr6k2cac1xj6jc8lcqi";
304
+ type = "gem";
305
+ };
306
+ version = "1.1.4";
307
+ };
308
+ rr = {
309
+ groups = ["default"];
310
+ platforms = [];
311
+ source = {
312
+ remotes = ["https://rubygems.org"];
313
+ sha256 = "1n9g78ba4c2zzmz8cdb97c38h1xm0clircag00vbcxwqs4dq0ymp";
314
+ type = "gem";
315
+ };
316
+ version = "1.2.1";
317
+ };
318
+ rubocop = {
319
+ dependencies = ["json" "language_server-protocol" "parallel" "parser" "rainbow" "regexp_parser" "rexml" "rubocop-ast" "ruby-progressbar" "unicode-display_width"];
320
+ groups = ["default"];
321
+ platforms = [];
322
+ source = {
323
+ remotes = ["https://rubygems.org"];
324
+ sha256 = "1dmj955zbvhlrzzag6hc77xdyyzn8ihvffpjalnzn5asxhz7jcdl";
325
+ type = "gem";
326
+ };
327
+ version = "1.63.2";
328
+ };
329
+ rubocop-ast = {
330
+ dependencies = ["parser"];
331
+ groups = ["default"];
332
+ platforms = [];
333
+ source = {
334
+ remotes = ["https://rubygems.org"];
335
+ sha256 = "1v3q8n48w8h809rqbgzihkikr4g3xk72m1na7s97jdsmjjq6y83w";
336
+ type = "gem";
337
+ };
338
+ version = "1.31.2";
339
+ };
340
+ rubocop-packaging = {
341
+ dependencies = ["rubocop"];
342
+ groups = ["default"];
343
+ platforms = [];
344
+ source = {
345
+ remotes = ["https://rubygems.org"];
346
+ sha256 = "1iqgsbpj7y8ksddbb9gj5vpzs2y8202khyk2mcc165kkfmvm6rx3";
347
+ type = "gem";
348
+ };
349
+ version = "0.5.2";
350
+ };
351
+ ruby-progressbar = {
352
+ groups = ["default"];
353
+ platforms = [];
354
+ source = {
355
+ remotes = ["https://rubygems.org"];
356
+ sha256 = "0cwvyb7j47m7wihpfaq7rc47zwwx9k4v7iqd9s1xch5nm53rrz40";
357
+ type = "gem";
358
+ };
359
+ version = "1.13.0";
360
+ };
361
+ unicode = {
362
+ groups = ["default"];
363
+ platforms = [];
364
+ source = {
365
+ remotes = ["https://rubygems.org"];
366
+ sha256 = "1mx9lwzy021lpcqql5kn4yi20njhf5h7c7wxm2fx51p1r2zr9wj2";
367
+ type = "gem";
368
+ };
369
+ version = "0.4.4.5";
370
+ };
371
+ unicode-display_width = {
372
+ groups = ["default"];
373
+ platforms = [];
374
+ source = {
375
+ remotes = ["https://rubygems.org"];
376
+ sha256 = "1d0azx233nags5jx3fqyr23qa2rhgzbhv8pxp46dgbg1mpf82xky";
377
+ type = "gem";
378
+ };
379
+ version = "2.5.0";
380
+ };
381
+ xapian-ruby = {
382
+ groups = ["default"];
383
+ platforms = [];
384
+ source = {
385
+ remotes = ["https://rubygems.org"];
386
+ sha256 = "0070gc3q3j41wxajakhj8vpyp2p18j1rhl20cpcj645vccgvqd21";
387
+ type = "gem";
388
+ };
389
+ version = "1.4.27";
390
+ };
391
+ }
@@ -2,22 +2,13 @@ let
2
2
  pkgs = import (builtins.fetchGit {
3
3
  url = "https://github.com/NixOS/nixpkgs";
4
4
  ref = "refs/heads/master";
5
- rev = "0e2ba0d131331e318eba20fcb03db0372dc2a926";
5
+ rev = "5d0ebea1934d80948ff7b84f3b06e4ec9d99ee49";
6
6
  }) {};
7
7
  gems = pkgs.bundlerEnv {
8
8
  name = "ruby3.2-gems-for-sup";
9
9
  ruby = pkgs.ruby_3_2;
10
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
- };
11
+ lockfile = ./ruby3.2-Gemfile.lock;
12
+ gemset = ./ruby3.2-gemset.nix;
22
13
  };
23
14
  in pkgs.mkShell { packages = [ gems gems.wrappedRuby pkgs.pandoc ]; }
@@ -2,7 +2,7 @@ let
2
2
  pkgs = import (builtins.fetchGit {
3
3
  url = "https://github.com/NixOS/nixpkgs";
4
4
  ref = "refs/heads/master";
5
- rev = "0e2ba0d131331e318eba20fcb03db0372dc2a926";
5
+ rev = "6de3b4b649253e8e0c7229edc3726d8a717b93fe";
6
6
  }) {};
7
7
  gems = pkgs.bundlerEnv {
8
8
  name = "ruby3.3-gems-for-sup";
@@ -10,14 +10,5 @@ let
10
10
  gemfile = ./Gemfile;
11
11
  lockfile = ./Gemfile.lock;
12
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
13
  };
23
14
  in pkgs.mkShell { packages = [ gems gems.wrappedRuby pkgs.pandoc ]; }
@@ -0,0 +1,27 @@
1
+ let
2
+ pkgs = import (builtins.fetchGit {
3
+ url = "https://github.com/NixOS/nixpkgs";
4
+ ref = "refs/heads/master";
5
+ rev = "6de3b4b649253e8e0c7229edc3726d8a717b93fe";
6
+ }) {};
7
+ gems = pkgs.bundlerEnv {
8
+ name = "ruby3.4-gems-for-sup";
9
+ ruby = pkgs.ruby_3_4;
10
+ gemfile = ./Gemfile;
11
+ lockfile = ./Gemfile.lock;
12
+ gemset = ./gemset.nix;
13
+ gemConfig = pkgs.defaultGemConfig // {
14
+ rmail = attrs: {
15
+ dontBuild = false;
16
+ patches = [
17
+ # Frozen string literals: https://github.com/terceiro/rmail/pull/13
18
+ (pkgs.fetchpatch2 {
19
+ name = "rmail-frozen-string-literals.patch";
20
+ url = "https://github.com/terceiro/rmail/pull/13/commits/27f455af1fea0be0aa09959cc2237cbdf68de2a1.patch";
21
+ hash = "sha256-N5X9zix+WPoEugp2DBTu7dRDmesrF5pT/8Td2wraYoA=";
22
+ })
23
+ ];
24
+ };
25
+ };
26
+ };
27
+ in pkgs.mkShell { packages = [ gems gems.wrappedRuby pkgs.pandoc ]; }
@@ -0,0 +1,40 @@
1
+ let
2
+ pkgs = import (builtins.fetchGit {
3
+ url = "https://github.com/NixOS/nixpkgs";
4
+ ref = "refs/heads/master";
5
+ rev = "6de3b4b649253e8e0c7229edc3726d8a717b93fe";
6
+ }) { };
7
+ gems = pkgs.bundlerEnv {
8
+ name = "ruby4.0-gems-for-sup";
9
+ ruby = pkgs.ruby_4_0;
10
+ gemfile = ./Gemfile;
11
+ lockfile = ./Gemfile.lock;
12
+ gemset = ./gemset.nix;
13
+ gemConfig = pkgs.defaultGemConfig // {
14
+ rmail = attrs: {
15
+ dontBuild = false;
16
+ patches = [
17
+ # Frozen string literals: https://github.com/terceiro/rmail/pull/13
18
+ (pkgs.fetchpatch2 {
19
+ name = "rmail-frozen-string-literals.patch";
20
+ url = "https://github.com/terceiro/rmail/pull/13/commits/27f455af1fea0be0aa09959cc2237cbdf68de2a1.patch";
21
+ hash = "sha256-N5X9zix+WPoEugp2DBTu7dRDmesrF5pT/8Td2wraYoA=";
22
+ })
23
+ ];
24
+ };
25
+ xapian-ruby =
26
+ attrs:
27
+ pkgs.defaultGemConfig.xapian-ruby attrs
28
+ // {
29
+ env.LANG = "C.UTF-8";
30
+ };
31
+ };
32
+ };
33
+ in
34
+ pkgs.mkShell {
35
+ packages = [
36
+ gems
37
+ gems.wrappedRuby
38
+ pkgs.pandoc
39
+ ];
40
+ }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  set -e
3
3
  cd "$(dirname "$0")/../.."
4
- for rubyversion in 2.4 2.5 2.6 2.7 3.0 3.1 3.2 ; do
4
+ for rubyversion in 2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3 3.4 ; do
5
5
  nix-shell contrib/nix/ruby$rubyversion-shell.nix --run 'rake ci'
6
6
  done
data/lib/sup/account.rb CHANGED
@@ -35,6 +35,7 @@ class AccountManager
35
35
  @regexen = {}
36
36
  @default_account = nil
37
37
 
38
+ fail "default account missing in config" unless accounts[:default].kind_of? Hash
38
39
  add_account accounts[:default], true
39
40
  accounts.each { |k, v| add_account v, false unless k == :default }
40
41
  end
@@ -51,6 +52,7 @@ class AccountManager
51
52
  end
52
53
  hash[:alternates] ||= []
53
54
  fail "alternative emails are not an array: #{hash[:alternates]}" unless hash[:alternates].kind_of? Array
55
+ raise ArgumentError, "no sendmail command specified for account" unless hash[:sendmail]
54
56
 
55
57
  [:name, :signature].each { |x| hash[x] ? hash[x].fix_encoding! : nil }
56
58
 
data/lib/sup/buffer.rb CHANGED
@@ -330,6 +330,7 @@ EOS
330
330
  w = Ncurses.stdscr
331
331
  b = Buffer.new w, mode, width, height, :title => realtitle, :force_to_top => opts[:force_to_top], :system => opts[:system]
332
332
  mode.buffer = b
333
+ mode.spawned
333
334
  @name_map[realtitle] = b
334
335
 
335
336
  @buffers.unshift b
data/lib/sup/contact.rb CHANGED
@@ -20,6 +20,7 @@ class ContactManager
20
20
  IO.foreach(fn) do |l|
21
21
  l =~ /^([^:]*): (.*)$/ or raise "can't parse #{fn} line #{l.inspect}"
22
22
  aalias, addr = $1, $2
23
+ aalias = nil if aalias.empty?
23
24
  update_alias Person.from_address(addr), aalias
24
25
  end
25
26
  end
@@ -37,10 +38,8 @@ class ContactManager
37
38
  end
38
39
  ## Update with new data
39
40
  @p2a[person] = aalias
40
- unless aalias.nil? || aalias.empty?
41
- @a2p[aalias] = person
42
- @e2p[person.email] = person
43
- end
41
+ @a2p[aalias] = person unless aalias.nil?
42
+ @e2p[person.email] = person
44
43
  end
45
44
 
46
45
  ## this may not actually be called anywhere, since we still keep contacts
data/lib/sup/crypto.rb CHANGED
@@ -177,6 +177,8 @@ EOS
177
177
  end
178
178
  gpg_opts = HookManager.run("gpg-options",
179
179
  {:operation => "encrypt", :options => gpg_opts}) || gpg_opts
180
+ ## On the sup side we use :signer for backwards compatibility, but GPGME wants :signers.
181
+ gpg_opts[:signers] = gpg_opts[:signer]
180
182
  recipients = to + [from]
181
183
  recipients = HookManager.run("gpg-expand-keys", { :recipients => recipients }) || recipients
182
184
  begin
@@ -198,17 +200,17 @@ EOS
198
200
  end
199
201
 
200
202
  encrypted_payload = RMail::Message.new
201
- encrypted_payload.header["Content-Type"] = "application/octet-stream"
202
- encrypted_payload.header["Content-Disposition"] = 'inline; filename="msg.asc"'
203
+ encrypted_payload.header["Content-Type"] = +"application/octet-stream"
204
+ encrypted_payload.header["Content-Disposition"] = +'inline; filename="msg.asc"'
203
205
  encrypted_payload.body = cipher
204
206
 
205
207
  control = RMail::Message.new
206
- control.header["Content-Type"] = "application/pgp-encrypted"
207
- control.header["Content-Disposition"] = "attachment"
208
+ control.header["Content-Type"] = +"application/pgp-encrypted"
209
+ control.header["Content-Disposition"] = +"attachment"
208
210
  control.body = "Version: 1\n"
209
211
 
210
212
  envelope = RMail::Message.new
211
- envelope.header["Content-Type"] = 'multipart/encrypted; protocol=application/pgp-encrypted'
213
+ envelope.header["Content-Type"] = +"multipart/encrypted; protocol=application/pgp-encrypted"
212
214
 
213
215
  envelope.add_part control
214
216
  envelope.add_part encrypted_payload
data/lib/sup/draft.rb CHANGED
@@ -11,19 +11,19 @@ class DraftManager
11
11
 
12
12
  def self.source_name; "sup://drafts"; end
13
13
  def self.source_id; 9999; end
14
- def new_source; @source = DraftLoader.new; end
14
+ def new_source; @source = DraftLoader.new @dir; end
15
15
 
16
16
  def write_draft
17
17
  offset = @source.gen_offset
18
18
  fn = @source.fn_for_offset offset
19
- File.open(fn, "w:UTF-8") { |f| yield f }
19
+ File.open(fn, "w", :encoding => $encoding) { |f| yield f }
20
20
  PollManager.poll_from @source
21
21
  end
22
22
 
23
23
  def discard m
24
24
  raise ArgumentError, "not a draft: source id #{m.source.id.inspect}, should be #{DraftManager.source_id.inspect} for #{m.id.inspect}" unless m.source.id.to_i == DraftManager.source_id
25
25
  Index.delete m.id
26
- File.delete @source.fn_for_offset(m.source_info) rescue Errono::ENOENT
26
+ File.delete @source.fn_for_offset(m.source_info) rescue Errno::ENOENT
27
27
  UpdateManager.relay self, :single_message_deleted, m
28
28
  end
29
29
  end
@@ -32,7 +32,7 @@ class DraftLoader < Source
32
32
  attr_accessor :dir
33
33
  yaml_properties
34
34
 
35
- def initialize dir=Redwood::DRAFT_DIR
35
+ def initialize dir
36
36
  Dir.mkdir dir unless File.exist? dir
37
37
  super DraftManager.source_name, true, false
38
38
  @dir = dir
@@ -76,16 +76,20 @@ class DraftLoader < Source
76
76
 
77
77
  def load_message offset
78
78
  raise SourceError, "Draft not found" unless File.exist? fn_for_offset(offset)
79
- File.open fn_for_offset(offset) do |f|
80
- RMail::Mailbox::MBoxReader.new(f).each_message do |input|
81
- return RMail::Parser.read(input)
82
- end
79
+ File.open(fn_for_offset(offset)) do |f|
80
+ message = RMail::Parser.read f
81
+ message.header.set "Content-Type", "text/plain; charset=#{$encoding}"
82
+ message
83
83
  end
84
84
  end
85
85
 
86
+ def fallback_date_for_message offset
87
+ File.mtime fn_for_offset(offset)
88
+ end
89
+
86
90
  def raw_header offset
87
91
  ret = ""
88
- File.open(fn_for_offset(offset), "r:UTF-8") do |f|
92
+ File.open(fn_for_offset(offset), "r") do |f|
89
93
  until f.eof? || (l = f.gets) =~ /^$/
90
94
  ret += l
91
95
  end
@@ -94,13 +98,13 @@ class DraftLoader < Source
94
98
  end
95
99
 
96
100
  def each_raw_message_line offset
97
- File.open(fn_for_offset(offset), "r:UTF-8") do |f|
101
+ File.open(fn_for_offset(offset), "r") do |f|
98
102
  yield f.gets until f.eof?
99
103
  end
100
104
  end
101
105
 
102
106
  def raw_message offset
103
- IO.read(fn_for_offset(offset), :encoding => "UTF-8")
107
+ IO.read fn_for_offset(offset)
104
108
  end
105
109
 
106
110
  def start_offset; 0; end