sup 0.19.0 → 0.22.1

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 (83) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.gitmodules +3 -0
  4. data/.travis.yml +3 -2
  5. data/CONTRIBUTORS +19 -13
  6. data/Gemfile +4 -0
  7. data/History.txt +41 -0
  8. data/Rakefile +41 -1
  9. data/ReleaseNotes +17 -0
  10. data/bin/sup +5 -18
  11. data/bin/sup-add +1 -2
  12. data/bin/sup-config +0 -1
  13. data/bin/sup-dump +0 -1
  14. data/bin/sup-import-dump +1 -2
  15. data/bin/sup-sync +0 -1
  16. data/bin/sup-sync-back-maildir +1 -2
  17. data/bin/sup-tweak-labels +1 -2
  18. data/contrib/colorpicker.rb +0 -2
  19. data/contrib/completion/_sup.bash +102 -0
  20. data/devel/profile.rb +0 -1
  21. data/ext/mkrf_conf_xapian.rb +47 -0
  22. data/lib/sup.rb +9 -8
  23. data/lib/sup/buffer.rb +12 -0
  24. data/lib/sup/colormap.rb +5 -2
  25. data/lib/sup/contact.rb +4 -2
  26. data/lib/sup/crypto.rb +41 -8
  27. data/lib/sup/draft.rb +8 -8
  28. data/lib/sup/hook.rb +1 -1
  29. data/lib/sup/index.rb +2 -2
  30. data/lib/sup/label.rb +1 -1
  31. data/lib/sup/maildir.rb +16 -5
  32. data/lib/sup/mbox.rb +13 -5
  33. data/lib/sup/message.rb +17 -3
  34. data/lib/sup/message_chunks.rb +10 -2
  35. data/lib/sup/mode.rb +33 -28
  36. data/lib/sup/modes/edit_message_mode.rb +3 -2
  37. data/lib/sup/modes/forward_mode.rb +22 -3
  38. data/lib/sup/modes/line_cursor_mode.rb +1 -1
  39. data/lib/sup/modes/text_mode.rb +6 -1
  40. data/lib/sup/modes/thread_index_mode.rb +11 -1
  41. data/lib/sup/modes/thread_view_mode.rb +103 -9
  42. data/lib/sup/person.rb +68 -61
  43. data/lib/sup/search.rb +1 -1
  44. data/lib/sup/sent.rb +1 -1
  45. data/lib/sup/util.rb +1 -75
  46. data/lib/sup/util/locale_fiddler.rb +24 -0
  47. data/lib/sup/version.rb +1 -1
  48. data/sup.gemspec +22 -5
  49. data/test/{messages → fixtures}/bad-content-transfer-encoding-1.eml +0 -0
  50. data/test/{messages → fixtures}/binary-content-transfer-encoding-2.eml +0 -0
  51. data/test/fixtures/blank-header-fields.eml +71 -0
  52. data/test/fixtures/contacts.txt +1 -0
  53. data/test/fixtures/malicious-attachment-names.eml +55 -0
  54. data/test/fixtures/missing-from-to.eml +18 -0
  55. data/test/{messages → fixtures}/missing-line.eml +0 -0
  56. data/test/fixtures/multi-part-2.eml +72 -0
  57. data/test/fixtures/multi-part.eml +61 -0
  58. data/test/fixtures/no-body.eml +18 -0
  59. data/test/fixtures/simple-message.eml +29 -0
  60. data/test/gnupg_test_home/gpg.conf +2 -1
  61. data/test/gnupg_test_home/key1.gen +15 -0
  62. data/test/gnupg_test_home/key2.gen +15 -0
  63. data/test/gnupg_test_home/key_ecc.gen +13 -0
  64. data/test/gnupg_test_home/pubring.gpg +0 -0
  65. data/test/gnupg_test_home/receiver_pubring.gpg +0 -0
  66. data/test/gnupg_test_home/receiver_secring.gpg +0 -0
  67. data/test/gnupg_test_home/regen_keys.sh +38 -0
  68. data/test/gnupg_test_home/secring.gpg +0 -0
  69. data/test/gnupg_test_home/sup-test-2@foo.bar.asc +22 -17
  70. data/test/integration/test_maildir.rb +75 -0
  71. data/test/integration/test_mbox.rb +69 -0
  72. data/test/test_crypto.rb +12 -2
  73. data/test/test_header_parsing.rb +1 -1
  74. data/test/test_helper.rb +6 -3
  75. data/test/test_message.rb +42 -342
  76. data/test/test_messages_dir.rb +4 -28
  77. data/test/test_yaml_regressions.rb +1 -1
  78. data/test/unit/test_contact.rb +33 -0
  79. data/test/unit/test_locale_fiddler.rb +15 -0
  80. data/test/unit/test_person.rb +37 -0
  81. metadata +108 -38
  82. data/test/gnupg_test_home/receiver_trustdb.gpg +0 -0
  83. data/test/gnupg_test_home/trustdb.gpg +0 -0
@@ -6,27 +6,9 @@ require 'stringio'
6
6
 
7
7
  require 'dummy_source'
8
8
 
9
- # override File.exists? to make it work with StringIO for testing.
10
- # FIXME: do aliasing to avoid breaking this when sup moves from
11
- # File.exists? to File.exist?
12
-
13
- class File
14
-
15
- def File.exists? file
16
- # puts "fake File::exists?"
17
-
18
- if file.is_a?(StringIO)
19
- return false
20
- end
21
- # use the different function
22
- File.exist?(file)
23
- end
24
-
25
- end
26
-
27
9
  module Redwood
28
10
 
29
- class TestMessagesDir < ::Minitest::Unit::TestCase
11
+ class TestMessagesDir < ::Minitest::Test
30
12
 
31
13
  def setup
32
14
  @path = Dir.mktmpdir
@@ -40,9 +22,7 @@ class TestMessagesDir < ::Minitest::Unit::TestCase
40
22
 
41
23
  def test_binary_content_transfer_encoding
42
24
  message = ''
43
- File.open 'test/messages/binary-content-transfer-encoding-2.eml' do |f|
44
- message = f.read
45
- end
25
+ File.open('test/fixtures/binary-content-transfer-encoding-2.eml') { |f| message = f.read }
46
26
 
47
27
  source = DummySource.new("sup-test://test_messages")
48
28
  source.messages = [ message ]
@@ -74,9 +54,7 @@ class TestMessagesDir < ::Minitest::Unit::TestCase
74
54
 
75
55
  def test_bad_content_transfer_encoding
76
56
  message = ''
77
- File.open 'test/messages/bad-content-transfer-encoding-1.eml' do |f|
78
- message = f.read
79
- end
57
+ File.open('test/fixtures/bad-content-transfer-encoding-1.eml') { |f| message = f.read }
80
58
 
81
59
  source = DummySource.new("sup-test://test_messages")
82
60
  source.messages = [ message ]
@@ -108,9 +86,7 @@ class TestMessagesDir < ::Minitest::Unit::TestCase
108
86
 
109
87
  def test_missing_line
110
88
  message = ''
111
- File.open 'test/messages/missing-line.eml' do |f|
112
- message = f.read
113
- end
89
+ File.open('test/fixtures/missing-line.eml') { |f| message = f.read }
114
90
 
115
91
  source = DummySource.new("sup-test://test_messages")
116
92
  source.messages = [ message ]
@@ -6,7 +6,7 @@ require 'yaml'
6
6
  require 'sup'
7
7
 
8
8
  module Redwood
9
- class TestYamlRegressions < ::Minitest::Unit::TestCase
9
+ class TestYamlRegressions < ::Minitest::Test
10
10
  def test_yamling_hash
11
11
  hsh = {:foo => 42}
12
12
  reloaded = YAML.load(hsh.to_yaml)
@@ -0,0 +1,33 @@
1
+ require 'test_helper'
2
+ require 'sup/contact'
3
+
4
+ module Redwood
5
+
6
+ class TestContact < Minitest::Test
7
+ def setup
8
+ @contact = ContactManager.init(File.expand_path("../../fixtures/contacts.txt", __FILE__))
9
+ @person = Person.new "Terrible Name", "terrible@name.com"
10
+ end
11
+
12
+ def teardown
13
+ runner = Redwood.const_get "ContactManager".to_sym
14
+ runner.deinstantiate!
15
+ end
16
+
17
+ def test_contact_manager
18
+ assert @contact
19
+ ## 1 contact is imported from the fixture file.
20
+ assert_equal 1, @contact.contacts.count
21
+ assert_equal @contact.contact_for("RC").name, "Random Contact"
22
+
23
+ assert_nil @contact.contact_for "TN"
24
+ @contact.update_alias @person, "TN"
25
+
26
+ assert @contact.is_aliased_contact?(@person)
27
+ assert_equal @person, @contact.contact_for("TN")
28
+
29
+ assert_equal "TN", @contact.alias_for(@person)
30
+ end
31
+ end
32
+
33
+ end
@@ -0,0 +1,15 @@
1
+ require 'test_helper'
2
+ require 'sup/util/locale_fiddler'
3
+
4
+ class TestFiddle < ::Minitest::Unit::TestCase
5
+ # TODO this is a silly test
6
+ def test_fiddle_set_locale
7
+ before = LocaleDummy.setlocale(6, nil).to_s
8
+ after = LocaleDummy.setlocale(6, "").to_s
9
+ assert(before != after, "Expected locale to be fiddled with")
10
+ end
11
+ end
12
+
13
+ class LocaleDummy
14
+ extend LocaleFiddler
15
+ end
@@ -0,0 +1,37 @@
1
+ require 'test_helper'
2
+ require 'sup'
3
+
4
+ module Redwood
5
+
6
+ class TestPerson < Minitest::Test
7
+ def setup
8
+ @person = Person.new("Thomassen, Bob", "bob@thomassen.com")
9
+ @no_name = Person.new(nil, "alice@alice.com")
10
+ end
11
+
12
+ def test_email_must_be_supplied
13
+ assert_raises (ArgumentError) { Person.new("Alice", nil) }
14
+ end
15
+
16
+ def test_to_string
17
+ assert_equal "Thomassen, Bob <bob@thomassen.com>", "#{@person}"
18
+ assert_equal "alice@alice.com", "#{@no_name}"
19
+ end
20
+
21
+ def test_shortname
22
+ assert_equal "Bob", @person.shortname
23
+ assert_equal "alice@alice.com", @no_name.shortname
24
+ end
25
+
26
+ def test_mediumname
27
+ assert_equal "Thomassen, Bob", @person.mediumname
28
+ assert_equal "alice@alice.com", @no_name.mediumname
29
+ end
30
+
31
+ def test_fullname
32
+ assert_equal "\"Thomassen, Bob\" <bob@thomassen.com>", @person.full_address
33
+ assert_equal "alice@alice.com", @no_name.full_address
34
+ end
35
+ end
36
+
37
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Morgan
@@ -11,22 +11,8 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-07-05 00:00:00.000000000 Z
14
+ date: 2015-06-18 00:00:00.000000000 Z
15
15
  dependencies:
16
- - !ruby/object:Gem::Dependency
17
- name: xapian-ruby
18
- requirement: !ruby/object:Gem::Requirement
19
- requirements:
20
- - - "~>"
21
- - !ruby/object:Gem::Version
22
- version: 1.2.15
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: 1.2.15
30
16
  - !ruby/object:Gem::Dependency
31
17
  name: ncursesw
32
18
  requirement: !ruby/object:Gem::Requirement
@@ -101,16 +87,16 @@ dependencies:
101
87
  name: mime-types
102
88
  requirement: !ruby/object:Gem::Requirement
103
89
  requirements:
104
- - - "~>"
90
+ - - ">"
105
91
  - !ruby/object:Gem::Version
106
- version: '1.0'
92
+ version: '2.0'
107
93
  type: :runtime
108
94
  prerelease: false
109
95
  version_requirements: !ruby/object:Gem::Requirement
110
96
  requirements:
111
- - - "~>"
97
+ - - ">"
112
98
  - !ruby/object:Gem::Version
113
- version: '1.0'
99
+ version: '2.0'
114
100
  - !ruby/object:Gem::Dependency
115
101
  name: locale
116
102
  requirement: !ruby/object:Gem::Requirement
@@ -187,28 +173,28 @@ dependencies:
187
173
  requirements:
188
174
  - - "~>"
189
175
  - !ruby/object:Gem::Version
190
- version: '4.7'
176
+ version: 5.5.1
191
177
  type: :development
192
178
  prerelease: false
193
179
  version_requirements: !ruby/object:Gem::Requirement
194
180
  requirements:
195
181
  - - "~>"
196
182
  - !ruby/object:Gem::Version
197
- version: '4.7'
183
+ version: 5.5.1
198
184
  - !ruby/object:Gem::Dependency
199
185
  name: rr
200
186
  requirement: !ruby/object:Gem::Requirement
201
187
  requirements:
202
188
  - - "~>"
203
189
  - !ruby/object:Gem::Version
204
- version: 1.0.5
190
+ version: '1.1'
205
191
  type: :development
206
192
  prerelease: false
207
193
  version_requirements: !ruby/object:Gem::Requirement
208
194
  requirements:
209
195
  - - "~>"
210
196
  - !ruby/object:Gem::Version
211
- version: 1.0.5
197
+ version: '1.1'
212
198
  - !ruby/object:Gem::Dependency
213
199
  name: gpgme
214
200
  requirement: !ruby/object:Gem::Requirement
@@ -223,6 +209,20 @@ dependencies:
223
209
  - - ">="
224
210
  - !ruby/object:Gem::Version
225
211
  version: 2.0.2
212
+ - !ruby/object:Gem::Dependency
213
+ name: pry
214
+ requirement: !ruby/object:Gem::Requirement
215
+ requirements:
216
+ - - ">="
217
+ - !ruby/object:Gem::Version
218
+ version: '0'
219
+ type: :development
220
+ prerelease: false
221
+ version_requirements: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: '0'
226
226
  description: |2
227
227
  Sup is a console-based email client for people with a lot of email.
228
228
 
@@ -244,10 +244,22 @@ executables:
244
244
  - sup-sync
245
245
  - sup-sync-back-maildir
246
246
  - sup-tweak-labels
247
- extensions: []
248
- extra_rdoc_files: []
247
+ extensions:
248
+ - ext/mkrf_conf_xapian.rb
249
+ extra_rdoc_files:
250
+ - man/sup-tweak-labels.1
251
+ - man/sup-sync.1
252
+ - man/sup-psych-ify-config-files.1
253
+ - man/sup-config.1
254
+ - man/sup-import-dump.1
255
+ - man/sup-dump.1
256
+ - man/sup-sync-back-maildir.1
257
+ - man/sup-add.1
258
+ - man/sup-recover-sources.1
259
+ - man/sup.1
249
260
  files:
250
261
  - ".gitignore"
262
+ - ".gitmodules"
251
263
  - ".travis.yml"
252
264
  - CONTRIBUTORS
253
265
  - Gemfile
@@ -268,6 +280,7 @@ files:
268
280
  - bin/sup-sync-back-maildir
269
281
  - bin/sup-tweak-labels
270
282
  - contrib/colorpicker.rb
283
+ - contrib/completion/_sup.bash
271
284
  - contrib/completion/_sup.zsh
272
285
  - devel/console.sh
273
286
  - devel/count-loc.sh
@@ -277,6 +290,7 @@ files:
277
290
  - doc/FAQ.txt
278
291
  - doc/Hooks.txt
279
292
  - doc/Philosophy.txt
293
+ - ext/mkrf_conf_xapian.rb
280
294
  - lib/sup.rb
281
295
  - lib/sup/account.rb
282
296
  - lib/sup/buffer.rb
@@ -337,25 +351,53 @@ files:
337
351
  - lib/sup/undo.rb
338
352
  - lib/sup/update.rb
339
353
  - lib/sup/util.rb
354
+ - lib/sup/util/locale_fiddler.rb
340
355
  - lib/sup/util/ncurses.rb
341
356
  - lib/sup/util/path.rb
342
357
  - lib/sup/util/query.rb
343
358
  - lib/sup/util/uri.rb
344
359
  - lib/sup/version.rb
360
+ - man/sup-add.1
361
+ - man/sup-config.1
362
+ - man/sup-dump.1
363
+ - man/sup-import-dump.1
364
+ - man/sup-psych-ify-config-files.1
365
+ - man/sup-recover-sources.1
366
+ - man/sup-sync-back-maildir.1
367
+ - man/sup-sync.1
368
+ - man/sup-tweak-labels.1
369
+ - man/sup.1
345
370
  - sup.gemspec
346
371
  - test/dummy_source.rb
372
+ - test/fixtures/bad-content-transfer-encoding-1.eml
373
+ - test/fixtures/binary-content-transfer-encoding-2.eml
374
+ - test/fixtures/blank-header-fields.eml
375
+ - test/fixtures/contacts.txt
376
+ - test/fixtures/malicious-attachment-names.eml
377
+ - test/fixtures/missing-from-to.eml
378
+ - test/fixtures/missing-line.eml
379
+ - test/fixtures/multi-part-2.eml
380
+ - test/fixtures/multi-part.eml
381
+ - test/fixtures/no-body.eml
382
+ - test/fixtures/simple-message.eml
383
+ - test/gnupg_test_home/.gpg-v21-migrated
347
384
  - test/gnupg_test_home/gpg.conf
385
+ - test/gnupg_test_home/key1.gen
386
+ - test/gnupg_test_home/key2.gen
387
+ - test/gnupg_test_home/key_ecc.gen
388
+ - test/gnupg_test_home/private-keys-v1.d/719C7455A7169C6EE8819C6E91002E4F9DD00A65.key
389
+ - test/gnupg_test_home/private-keys-v1.d/8A130806A754AA29D59487D76BD355040D9F26C0.key
390
+ - test/gnupg_test_home/private-keys-v1.d/B7AA46B22BD8A6AD1B4F266C19A3B124A32DDD71.key
391
+ - test/gnupg_test_home/private-keys-v1.d/FA64ACD7CC871371BDF57285A6CDF0E618827783.key
348
392
  - test/gnupg_test_home/pubring.gpg
349
393
  - test/gnupg_test_home/receiver_pubring.gpg
350
394
  - test/gnupg_test_home/receiver_secring.gpg
351
- - test/gnupg_test_home/receiver_trustdb.gpg
395
+ - test/gnupg_test_home/regen_keys.sh
352
396
  - test/gnupg_test_home/secring.gpg
353
397
  - test/gnupg_test_home/sup-test-2@foo.bar.asc
354
- - test/gnupg_test_home/trustdb.gpg
355
398
  - test/integration/test_label_service.rb
356
- - test/messages/bad-content-transfer-encoding-1.eml
357
- - test/messages/binary-content-transfer-encoding-2.eml
358
- - test/messages/missing-line.eml
399
+ - test/integration/test_maildir.rb
400
+ - test/integration/test_mbox.rb
359
401
  - test/test_crypto.rb
360
402
  - test/test_header_parsing.rb
361
403
  - test/test_helper.rb
@@ -364,7 +406,10 @@ files:
364
406
  - test/test_yaml_migration.rb
365
407
  - test/test_yaml_regressions.rb
366
408
  - test/unit/service/test_label_service.rb
409
+ - test/unit/test_contact.rb
367
410
  - test/unit/test_horizontal_selector.rb
411
+ - test/unit/test_locale_fiddler.rb
412
+ - test/unit/test_person.rb
368
413
  - test/unit/util/test_query.rb
369
414
  - test/unit/util/test_string.rb
370
415
  - test/unit/util/test_uri.rb
@@ -376,6 +421,11 @@ post_install_message: |
376
421
  SUP: please note that our old mailing lists have been shut down,
377
422
  re-subscribe to supmua@googlegroups.com to discuss and follow
378
423
  updates on sup (send email to: supmua+subscribe@googlegroups.com).
424
+
425
+ OpenBSD users:
426
+ If your operating system is OpenBSD you have some
427
+ additional, manual steps to do before Sup will work, see:
428
+ https://github.com/sup-heliotrope/sup/wiki/Installation%3A-OpenBSD.
379
429
  rdoc_options: []
380
430
  require_paths:
381
431
  - lib
@@ -383,7 +433,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
383
433
  requirements:
384
434
  - - ">="
385
435
  - !ruby/object:Gem::Version
386
- version: 1.9.3
436
+ version: 2.0.0
387
437
  required_rubygems_version: !ruby/object:Gem::Requirement
388
438
  requirements:
389
439
  - - ">="
@@ -391,24 +441,41 @@ required_rubygems_version: !ruby/object:Gem::Requirement
391
441
  version: '0'
392
442
  requirements: []
393
443
  rubyforge_project:
394
- rubygems_version: 2.2.2
444
+ rubygems_version: 2.4.6
395
445
  signing_key:
396
446
  specification_version: 4
397
447
  summary: A console-based email client with the best features of GMail, mutt and Emacs
398
448
  test_files:
399
449
  - test/dummy_source.rb
450
+ - test/fixtures/bad-content-transfer-encoding-1.eml
451
+ - test/fixtures/binary-content-transfer-encoding-2.eml
452
+ - test/fixtures/blank-header-fields.eml
453
+ - test/fixtures/contacts.txt
454
+ - test/fixtures/malicious-attachment-names.eml
455
+ - test/fixtures/missing-from-to.eml
456
+ - test/fixtures/missing-line.eml
457
+ - test/fixtures/multi-part-2.eml
458
+ - test/fixtures/multi-part.eml
459
+ - test/fixtures/no-body.eml
460
+ - test/fixtures/simple-message.eml
461
+ - test/gnupg_test_home/.gpg-v21-migrated
400
462
  - test/gnupg_test_home/gpg.conf
463
+ - test/gnupg_test_home/key1.gen
464
+ - test/gnupg_test_home/key2.gen
465
+ - test/gnupg_test_home/key_ecc.gen
466
+ - test/gnupg_test_home/private-keys-v1.d/719C7455A7169C6EE8819C6E91002E4F9DD00A65.key
467
+ - test/gnupg_test_home/private-keys-v1.d/8A130806A754AA29D59487D76BD355040D9F26C0.key
468
+ - test/gnupg_test_home/private-keys-v1.d/B7AA46B22BD8A6AD1B4F266C19A3B124A32DDD71.key
469
+ - test/gnupg_test_home/private-keys-v1.d/FA64ACD7CC871371BDF57285A6CDF0E618827783.key
401
470
  - test/gnupg_test_home/pubring.gpg
402
471
  - test/gnupg_test_home/receiver_pubring.gpg
403
472
  - test/gnupg_test_home/receiver_secring.gpg
404
- - test/gnupg_test_home/receiver_trustdb.gpg
473
+ - test/gnupg_test_home/regen_keys.sh
405
474
  - test/gnupg_test_home/secring.gpg
406
475
  - test/gnupg_test_home/sup-test-2@foo.bar.asc
407
- - test/gnupg_test_home/trustdb.gpg
408
476
  - test/integration/test_label_service.rb
409
- - test/messages/bad-content-transfer-encoding-1.eml
410
- - test/messages/binary-content-transfer-encoding-2.eml
411
- - test/messages/missing-line.eml
477
+ - test/integration/test_maildir.rb
478
+ - test/integration/test_mbox.rb
412
479
  - test/test_crypto.rb
413
480
  - test/test_header_parsing.rb
414
481
  - test/test_helper.rb
@@ -417,7 +484,10 @@ test_files:
417
484
  - test/test_yaml_migration.rb
418
485
  - test/test_yaml_regressions.rb
419
486
  - test/unit/service/test_label_service.rb
487
+ - test/unit/test_contact.rb
420
488
  - test/unit/test_horizontal_selector.rb
489
+ - test/unit/test_locale_fiddler.rb
490
+ - test/unit/test_person.rb
421
491
  - test/unit/util/test_query.rb
422
492
  - test/unit/util/test_string.rb
423
493
  - test/unit/util/test_uri.rb