sup 1.5 → 1.6
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.
- checksums.yaml +4 -4
- data/History.txt +11 -0
- data/Manifest.txt +1 -0
- data/bin/sup-add +1 -1
- data/contrib/nix/Gemfile.lock +1 -1
- data/contrib/nix/gemset.nix +2 -2
- data/contrib/nix/ruby2.4-Gemfile.lock +1 -1
- data/contrib/nix/ruby2.4-gemset.nix +2 -2
- data/contrib/nix/ruby2.5-Gemfile.lock +1 -1
- data/contrib/nix/ruby2.5-gemset.nix +2 -2
- data/contrib/nix/ruby2.6-Gemfile.lock +1 -1
- data/contrib/nix/ruby2.6-gemset.nix +2 -2
- data/contrib/nix/ruby2.7-Gemfile.lock +1 -1
- data/contrib/nix/ruby2.7-gemset.nix +2 -2
- data/contrib/nix/ruby3.0-Gemfile.lock +1 -1
- data/contrib/nix/ruby3.0-gemset.nix +2 -2
- data/contrib/nix/ruby3.1-Gemfile.lock +1 -1
- data/contrib/nix/ruby3.1-gemset.nix +2 -2
- data/contrib/nix/ruby3.2-Gemfile.lock +1 -1
- data/contrib/nix/ruby3.2-gemset.nix +2 -2
- data/lib/sup/index.rb +1 -1
- data/lib/sup/modes/edit_message_mode.rb +5 -8
- data/lib/sup/modes/thread_view_mode.rb +2 -2
- data/lib/sup/util.rb +1 -1
- data/lib/sup/version.rb +1 -1
- data/test/dummy_source.rb +8 -0
- data/test/unit/test_edit_message_mode.rb +62 -1
- data/test/unit/test_thread_view_mode.rb +86 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6d301bef771e79616052aa7c2494b2b8953ade7dc697ad46f4dee50577bf3fd0
|
|
4
|
+
data.tar.gz: 59700e2285bed8ff264a0f96d11bb68eca17b9989075ccdb68e335c938fdad7a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d064ec50649cc7605f7f39b5657194b031f1e0d372d3e406aea768f075c997f612b1027c046fbfccd9e1ba2b1ad7215d6fa30ca185e6bfe7f359106bdcbb6fa1
|
|
7
|
+
data.tar.gz: f1dfc1891395f3f61f0576ba1d3cf22dee6beafa1fb4ccf3724de33f7dfeefdeb0b4a86eda4a2950d99bbfcce73fd840d022e9a435092365fbc34f30ee729f5f
|
data/History.txt
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
== 1.6 / 2026-11-24
|
|
2
|
+
|
|
3
|
+
* #629: Fixed incorrect top-level MIME type on outgoing messages with
|
|
4
|
+
attachments (regression in release 1.5).
|
|
5
|
+
* Sup now passes through attachments with 8bit transfer encoding unmodified in
|
|
6
|
+
outgoing messages. Previously such attachments would be forcibly re-encoded
|
|
7
|
+
to the user's encoding, potentially causing corruption.
|
|
8
|
+
* Sup now replaces / with _ in attachment filenames when you save an attachment
|
|
9
|
+
to disk and give Sup a directory. This matches the attachment filename
|
|
10
|
+
escaping behaviour already used in other cases.
|
|
11
|
+
|
|
1
12
|
== 1.5 / 2026-11-19
|
|
2
13
|
|
|
3
14
|
* #628: Added a workaround for a spurious DatabaseCorruptError raised by Xapian
|
data/Manifest.txt
CHANGED
|
@@ -195,6 +195,7 @@ test/unit/test_locale_fiddler.rb
|
|
|
195
195
|
test/unit/test_maildir.rb
|
|
196
196
|
test/unit/test_person.rb
|
|
197
197
|
test/unit/test_rmail_message.rb
|
|
198
|
+
test/unit/test_thread_view_mode.rb
|
|
198
199
|
test/unit/util/test_query.rb
|
|
199
200
|
test/unit/util/test_string.rb
|
|
200
201
|
test/unit/util/test_uri.rb
|
data/bin/sup-add
CHANGED
|
@@ -100,7 +100,7 @@ begin
|
|
|
100
100
|
Redwood::Maildir.new uri, !$opts[:unusual], $opts[:archive], $opts[:sync_back], nil, labels
|
|
101
101
|
when /^mbox:/
|
|
102
102
|
Redwood::MBox.new uri, !$opts[:unusual], $opts[:archive], nil, labels
|
|
103
|
-
|
|
103
|
+
else
|
|
104
104
|
Optimist::die "Sources must be specified with a maildir:// or mbox:// URI"
|
|
105
105
|
end
|
|
106
106
|
@cli.say "Adding #{source}..."
|
data/contrib/nix/Gemfile.lock
CHANGED
data/contrib/nix/gemset.nix
CHANGED
|
@@ -198,10 +198,10 @@
|
|
|
198
198
|
platforms = [];
|
|
199
199
|
source = {
|
|
200
200
|
remotes = ["https://rubygems.org"];
|
|
201
|
-
sha256 = "
|
|
201
|
+
sha256 = "06y14chi5ywrwx4gsh7zh3j472y924rzrsy0s7i6bbkhxsc3ffy0";
|
|
202
202
|
type = "gem";
|
|
203
203
|
};
|
|
204
|
-
version = "1.4.
|
|
204
|
+
version = "1.4.15";
|
|
205
205
|
};
|
|
206
206
|
optimist = {
|
|
207
207
|
groups = ["default"];
|
|
@@ -146,10 +146,10 @@
|
|
|
146
146
|
platforms = [];
|
|
147
147
|
source = {
|
|
148
148
|
remotes = ["https://rubygems.org"];
|
|
149
|
-
sha256 = "
|
|
149
|
+
sha256 = "06y14chi5ywrwx4gsh7zh3j472y924rzrsy0s7i6bbkhxsc3ffy0";
|
|
150
150
|
type = "gem";
|
|
151
151
|
};
|
|
152
|
-
version = "1.4.
|
|
152
|
+
version = "1.4.15";
|
|
153
153
|
};
|
|
154
154
|
optimist = {
|
|
155
155
|
groups = ["default"];
|
|
@@ -146,10 +146,10 @@
|
|
|
146
146
|
platforms = [];
|
|
147
147
|
source = {
|
|
148
148
|
remotes = ["https://rubygems.org"];
|
|
149
|
-
sha256 = "
|
|
149
|
+
sha256 = "06y14chi5ywrwx4gsh7zh3j472y924rzrsy0s7i6bbkhxsc3ffy0";
|
|
150
150
|
type = "gem";
|
|
151
151
|
};
|
|
152
|
-
version = "1.4.
|
|
152
|
+
version = "1.4.15";
|
|
153
153
|
};
|
|
154
154
|
optimist = {
|
|
155
155
|
groups = ["default"];
|
|
@@ -156,10 +156,10 @@
|
|
|
156
156
|
platforms = [];
|
|
157
157
|
source = {
|
|
158
158
|
remotes = ["https://rubygems.org"];
|
|
159
|
-
sha256 = "
|
|
159
|
+
sha256 = "06y14chi5ywrwx4gsh7zh3j472y924rzrsy0s7i6bbkhxsc3ffy0";
|
|
160
160
|
type = "gem";
|
|
161
161
|
};
|
|
162
|
-
version = "1.4.
|
|
162
|
+
version = "1.4.15";
|
|
163
163
|
};
|
|
164
164
|
optimist = {
|
|
165
165
|
groups = ["default"];
|
|
@@ -166,10 +166,10 @@
|
|
|
166
166
|
platforms = [];
|
|
167
167
|
source = {
|
|
168
168
|
remotes = ["https://rubygems.org"];
|
|
169
|
-
sha256 = "
|
|
169
|
+
sha256 = "06y14chi5ywrwx4gsh7zh3j472y924rzrsy0s7i6bbkhxsc3ffy0";
|
|
170
170
|
type = "gem";
|
|
171
171
|
};
|
|
172
|
-
version = "1.4.
|
|
172
|
+
version = "1.4.15";
|
|
173
173
|
};
|
|
174
174
|
optimist = {
|
|
175
175
|
groups = ["default"];
|
|
@@ -166,10 +166,10 @@
|
|
|
166
166
|
platforms = [];
|
|
167
167
|
source = {
|
|
168
168
|
remotes = ["https://rubygems.org"];
|
|
169
|
-
sha256 = "
|
|
169
|
+
sha256 = "06y14chi5ywrwx4gsh7zh3j472y924rzrsy0s7i6bbkhxsc3ffy0";
|
|
170
170
|
type = "gem";
|
|
171
171
|
};
|
|
172
|
-
version = "1.4.
|
|
172
|
+
version = "1.4.15";
|
|
173
173
|
};
|
|
174
174
|
optimist = {
|
|
175
175
|
groups = ["default"];
|
|
@@ -187,10 +187,10 @@
|
|
|
187
187
|
platforms = [];
|
|
188
188
|
source = {
|
|
189
189
|
remotes = ["https://rubygems.org"];
|
|
190
|
-
sha256 = "
|
|
190
|
+
sha256 = "06y14chi5ywrwx4gsh7zh3j472y924rzrsy0s7i6bbkhxsc3ffy0";
|
|
191
191
|
type = "gem";
|
|
192
192
|
};
|
|
193
|
-
version = "1.4.
|
|
193
|
+
version = "1.4.15";
|
|
194
194
|
};
|
|
195
195
|
optimist = {
|
|
196
196
|
groups = ["default"];
|
|
@@ -187,10 +187,10 @@
|
|
|
187
187
|
platforms = [];
|
|
188
188
|
source = {
|
|
189
189
|
remotes = ["https://rubygems.org"];
|
|
190
|
-
sha256 = "
|
|
190
|
+
sha256 = "06y14chi5ywrwx4gsh7zh3j472y924rzrsy0s7i6bbkhxsc3ffy0";
|
|
191
191
|
type = "gem";
|
|
192
192
|
};
|
|
193
|
-
version = "1.4.
|
|
193
|
+
version = "1.4.15";
|
|
194
194
|
};
|
|
195
195
|
optimist = {
|
|
196
196
|
groups = ["default"];
|
data/lib/sup/index.rb
CHANGED
|
@@ -577,7 +577,7 @@ protected
|
|
|
577
577
|
return false
|
|
578
578
|
end
|
|
579
579
|
else
|
|
580
|
-
IO.popen(acct.sendmail, "
|
|
580
|
+
IO.popen(acct.sendmail, "wb") { |p| p.puts m }
|
|
581
581
|
raise SendmailCommandFailed, "Couldn't execute #{acct.sendmail}" unless $? == 0
|
|
582
582
|
end
|
|
583
583
|
|
|
@@ -601,11 +601,13 @@ protected
|
|
|
601
601
|
|
|
602
602
|
def build_message date
|
|
603
603
|
m = RMail::Message.new
|
|
604
|
+
m.header["Content-Type"] = "text/plain; charset=#{$encoding}"
|
|
605
|
+
m.header["Content-Transfer-Encoding"] ||= +"8bit"
|
|
604
606
|
m.body = @body.join("\n")
|
|
605
607
|
m.body += "\n" + sig_lines.join("\n") unless @sig_edited
|
|
606
608
|
## body must end in a newline or GPG signatures will be WRONG!
|
|
607
609
|
m.body += "\n" unless m.body =~ /\n\Z/
|
|
608
|
-
m.body
|
|
610
|
+
m.body.force_encoding("ASCII-8BIT")
|
|
609
611
|
|
|
610
612
|
## there are attachments, so wrap body in an attachment of its own
|
|
611
613
|
unless @attachments.empty?
|
|
@@ -614,10 +616,7 @@ protected
|
|
|
614
616
|
m = RMail::Message.new
|
|
615
617
|
|
|
616
618
|
m.add_part body_m
|
|
617
|
-
@attachments.each
|
|
618
|
-
a.body = a.body.fix_encoding! if a.body.kind_of? String
|
|
619
|
-
m.add_part a
|
|
620
|
-
end
|
|
619
|
+
@attachments.each { |a| m.add_part a }
|
|
621
620
|
end
|
|
622
621
|
|
|
623
622
|
## do whatever crypto transformation is necessary
|
|
@@ -648,8 +647,6 @@ protected
|
|
|
648
647
|
m.header["Date"] = date.rfc2822
|
|
649
648
|
m.header["Message-Id"] = @message_id
|
|
650
649
|
m.header["User-Agent"] = "Sup/#{Redwood::VERSION}"
|
|
651
|
-
m.header["Content-Type"] = "text/plain; charset=#{$encoding}"
|
|
652
|
-
m.header["Content-Transfer-Encoding"] ||= +"8bit"
|
|
653
650
|
m.header["MIME-Version"] = +"1.0"
|
|
654
651
|
m
|
|
655
652
|
end
|
|
@@ -397,7 +397,7 @@ EOS
|
|
|
397
397
|
|
|
398
398
|
# if user selects directory use file name from message
|
|
399
399
|
if fn and File.directory? fn
|
|
400
|
-
fn = File.join(fn, chunk.
|
|
400
|
+
fn = File.join(fn, chunk.filesafe_filename)
|
|
401
401
|
end
|
|
402
402
|
|
|
403
403
|
save_to_file(fn) { |f| f.print chunk.raw_content } if fn
|
|
@@ -1027,7 +1027,7 @@ private
|
|
|
1027
1027
|
BufferManager.erase_flash
|
|
1028
1028
|
BufferManager.completely_redraw_screen
|
|
1029
1029
|
unless success
|
|
1030
|
-
BufferManager.spawn "Attachment: #{chunk.filename}", TextMode.new(chunk.to_s.ascii, chunk.
|
|
1030
|
+
BufferManager.spawn "Attachment: #{chunk.filename}", TextMode.new(chunk.to_s.ascii, chunk.filesafe_filename)
|
|
1031
1031
|
BufferManager.flash "Couldn't execute view command, viewing as text."
|
|
1032
1032
|
end
|
|
1033
1033
|
end
|
data/lib/sup/util.rb
CHANGED
|
@@ -80,7 +80,7 @@ module RMail
|
|
|
80
80
|
def self.make_file_attachment fn
|
|
81
81
|
bfn = File.basename fn
|
|
82
82
|
t = MIME::Types.type_for(bfn).first || MIME::Types.type_for("exe").first
|
|
83
|
-
payload = IO.
|
|
83
|
+
payload = IO.binread fn
|
|
84
84
|
## Need to encode as base64 or quoted-printable if any lines are longer than 998 chars.
|
|
85
85
|
encoding = if t.encoding != t.default_encoding and payload.each_line.any? { |l| l.length > 998 }
|
|
86
86
|
t.default_encoding
|
data/lib/sup/version.rb
CHANGED
data/test/dummy_source.rb
CHANGED
|
@@ -61,6 +61,14 @@ class DummySource < Source
|
|
|
61
61
|
def fallback_date_for_message id
|
|
62
62
|
@fallback_date
|
|
63
63
|
end
|
|
64
|
+
|
|
65
|
+
def poll
|
|
66
|
+
indexed = Index.instance.enum_for(:each_source_info, self.id).map(&:to_i)
|
|
67
|
+
@messages.each_with_index do |m, i|
|
|
68
|
+
next if indexed.include? i
|
|
69
|
+
yield :add, :info => i, :labels => [], :progress => i / @messages.length
|
|
70
|
+
end
|
|
71
|
+
end
|
|
64
72
|
end
|
|
65
73
|
|
|
66
74
|
end
|
|
@@ -41,6 +41,27 @@ class TestEditMessageMode < Minitest::Test
|
|
|
41
41
|
$config = nil
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
+
def test_basic_message
|
|
45
|
+
opts = {
|
|
46
|
+
:header => {
|
|
47
|
+
"From" => +"sender@example.invalid",
|
|
48
|
+
"To" => +"recip@example.invalid",
|
|
49
|
+
},
|
|
50
|
+
:body => ["hello friends"],
|
|
51
|
+
}
|
|
52
|
+
mode = Redwood::EditMessageMode.new opts
|
|
53
|
+
|
|
54
|
+
msg = mode.send :build_message, Time.now
|
|
55
|
+
refute msg.multipart?
|
|
56
|
+
assert_equal "hello friends\n", msg.body
|
|
57
|
+
assert_equal "text/plain; charset=UTF-8", msg.header["Content-Type"]
|
|
58
|
+
assert_equal "8bit", msg.header["Content-Transfer-Encoding"]
|
|
59
|
+
assert_equal "1.0", msg.header["MIME-Version"]
|
|
60
|
+
assert_match(/^Sup\//, msg.header["User-Agent"])
|
|
61
|
+
refute_nil msg.header["Date"]
|
|
62
|
+
refute_nil msg.header["Message-Id"]
|
|
63
|
+
end
|
|
64
|
+
|
|
44
65
|
def test_attachment_content_transfer_encoding
|
|
45
66
|
## RMail::Message#make_attachment will choose
|
|
46
67
|
## Content-Transfer-Encoding: 8bit for a CSV file.
|
|
@@ -64,7 +85,7 @@ class TestEditMessageMode < Minitest::Test
|
|
|
64
85
|
|
|
65
86
|
msg = mode.send :build_message, Time.now
|
|
66
87
|
attachment = msg.part(1)
|
|
67
|
-
assert_equal attachment_content, attachment.body
|
|
88
|
+
assert_equal attachment_content.b, attachment.body
|
|
68
89
|
assert_equal "8bit", attachment.header["Content-Transfer-Encoding"]
|
|
69
90
|
end
|
|
70
91
|
|
|
@@ -96,4 +117,44 @@ class TestEditMessageMode < Minitest::Test
|
|
|
96
117
|
## This was: https://github.com/sup-heliotrope/sup/issues/502
|
|
97
118
|
assert_equal ["quoted-printable"], attachment.header.fetch_all("Content-Transfer-Encoding")
|
|
98
119
|
end
|
|
120
|
+
|
|
121
|
+
## https://github.com/sup-heliotrope/sup/issues/135
|
|
122
|
+
def test_attachment_8bit_non_utf8
|
|
123
|
+
body_content = "löl noñ-ÀSCII bodý"
|
|
124
|
+
## CP1251 is not UTF-8 compatible.
|
|
125
|
+
## This is a CSV only due to a quirk of mime-types, which wants to use 8bit for text/csv
|
|
126
|
+
## (whereas text/plain is quoted-printable).
|
|
127
|
+
attachment_content = "С днем рождения!\n".encode("cp1251")
|
|
128
|
+
attachment_filename = File.join @path, "cp1251.csv"
|
|
129
|
+
File.write attachment_filename, attachment_content
|
|
130
|
+
|
|
131
|
+
opts = {
|
|
132
|
+
:header => {
|
|
133
|
+
"From" => +"sender@example.invalid",
|
|
134
|
+
"To" => +"recip@example.invalid",
|
|
135
|
+
},
|
|
136
|
+
:attachments => {
|
|
137
|
+
"cp1251.csv" => RMail::Message.make_file_attachment(attachment_filename),
|
|
138
|
+
},
|
|
139
|
+
:body => [body_content],
|
|
140
|
+
}
|
|
141
|
+
mode = Redwood::EditMessageMode.new opts
|
|
142
|
+
|
|
143
|
+
msg = mode.send :build_message, Time.now
|
|
144
|
+
inline = msg.part(0)
|
|
145
|
+
assert_equal body_content.b + "\n", inline.body
|
|
146
|
+
assert_equal "text/plain; charset=UTF-8", inline.header["Content-Type"]
|
|
147
|
+
assert_equal "inline", inline.header["Content-Disposition"]
|
|
148
|
+
assert_equal "8bit", inline.header["Content-Transfer-Encoding"]
|
|
149
|
+
attachment = msg.part(1)
|
|
150
|
+
assert_equal attachment_content.b, attachment.body
|
|
151
|
+
assert_equal 'text/csv; name="cp1251.csv"', attachment.header["Content-Type"]
|
|
152
|
+
assert_equal 'attachment; filename="cp1251.csv"', attachment.header["Content-Disposition"]
|
|
153
|
+
assert_equal "8bit", attachment.header["Content-Transfer-Encoding"]
|
|
154
|
+
|
|
155
|
+
## Also check the serialized message, which is what the send_message method uses.
|
|
156
|
+
assert msg.to_s.lines.include? body_content.b + "\n"
|
|
157
|
+
assert msg.to_s.lines.include? "Content-Type: text/csv; name=\"cp1251.csv\"\n"
|
|
158
|
+
assert msg.to_s.lines.include? attachment_content.b
|
|
159
|
+
end
|
|
99
160
|
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
require "dummy_buffer"
|
|
2
|
+
require "dummy_source"
|
|
3
|
+
require "test_helper"
|
|
4
|
+
|
|
5
|
+
require "sup"
|
|
6
|
+
|
|
7
|
+
module Redwood
|
|
8
|
+
|
|
9
|
+
class TestThreadViewMode < Minitest::Test
|
|
10
|
+
def setup
|
|
11
|
+
$config = {
|
|
12
|
+
:indent_spaces => 2,
|
|
13
|
+
:thread_by_subject => false,
|
|
14
|
+
}
|
|
15
|
+
@path = Dir.mktmpdir
|
|
16
|
+
@out = File.open File::NULL, "w"
|
|
17
|
+
@inp = File.open File::NULL, "r"
|
|
18
|
+
@screen = Ncurses.newterm "dumb", @out, @inp
|
|
19
|
+
BufferManager.init
|
|
20
|
+
Redwood::start
|
|
21
|
+
Logger.remove_sink $stderr
|
|
22
|
+
Index.init File.join(@path, "xapian")
|
|
23
|
+
Index.load
|
|
24
|
+
@source = DummySource.new("sup-test://test_thread_view_mode")
|
|
25
|
+
SourceManager.instance.instance_eval '@sources = {}'
|
|
26
|
+
SourceManager.instance.add_source @source
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def teardown
|
|
30
|
+
ObjectSpace.each_object(Class).select {|a| a < Singleton}.each do |klass|
|
|
31
|
+
klass.deinstantiate! unless klass == Logger
|
|
32
|
+
end
|
|
33
|
+
FileUtils.rm_r @path
|
|
34
|
+
Ncurses.delscreen @screen
|
|
35
|
+
@inp.close
|
|
36
|
+
@out.close
|
|
37
|
+
$config = nil
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def populate_threadset
|
|
41
|
+
PollManager.poll_from @source
|
|
42
|
+
Index.save_index
|
|
43
|
+
ts = ThreadSet.new Index.instance
|
|
44
|
+
Index.instance.each_message { |m| ts.load_thread_for_message m }
|
|
45
|
+
ts
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def make_mode thread
|
|
49
|
+
mode = ThreadViewMode.new thread
|
|
50
|
+
mode.buffer = DummyBuffer.new 100, 24
|
|
51
|
+
mode.send :regen_text
|
|
52
|
+
mode
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def test_attachment_filenames_escaping
|
|
56
|
+
@source.messages = [ fixture_path("malicious-attachment-names.eml") ]
|
|
57
|
+
ts = populate_threadset
|
|
58
|
+
t = ts.threads.first
|
|
59
|
+
mode = make_mode t
|
|
60
|
+
mode.jump_to_message t.first
|
|
61
|
+
|
|
62
|
+
## Test saving all attachments to disk.
|
|
63
|
+
destdir = File.join(@path, "saved")
|
|
64
|
+
Dir.mkdir destdir
|
|
65
|
+
stub(BufferManager.instance).ask(:filename, "Save all attachments to folder: ", "") { destdir }
|
|
66
|
+
stub(BufferManager.instance).flash("Wrote 1 attachment to #{destdir}.")
|
|
67
|
+
mode.save_all_to_disk
|
|
68
|
+
expected_path = File.join destdir, "sup_.travis.yml"
|
|
69
|
+
assert File.exist? expected_path
|
|
70
|
+
assert_equal 260, File.size(expected_path)
|
|
71
|
+
|
|
72
|
+
## Scroll to the attachment and save it to a directory.
|
|
73
|
+
destdir = File.join(@path, "saved2")
|
|
74
|
+
Dir.mkdir destdir
|
|
75
|
+
stub(BufferManager.instance).ask(:filename, "Save attachment to file or directory: ", "#{ENV["HOME"]}/sup_.travis.yml") { destdir }
|
|
76
|
+
stub(BufferManager.instance).flash("Successfully wrote #{destdir}/sup_.travis.yml.")
|
|
77
|
+
assert_equal "x Attachment: sup/.travis.yml (text/x-yaml; 260B)", mode[10][0][1]
|
|
78
|
+
mode.send :set_cursor_pos, 10
|
|
79
|
+
mode.save_to_disk
|
|
80
|
+
expected_path = File.join destdir, "sup_.travis.yml"
|
|
81
|
+
assert File.exist? expected_path
|
|
82
|
+
assert_equal 260, File.size(expected_path)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
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: '1.
|
|
4
|
+
version: '1.6'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- William Morgan
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
- Matthieu Rakotojaona
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2026-11-
|
|
13
|
+
date: 2026-11-24 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: ncursesw
|
|
@@ -528,6 +528,7 @@ files:
|
|
|
528
528
|
- test/unit/test_maildir.rb
|
|
529
529
|
- test/unit/test_person.rb
|
|
530
530
|
- test/unit/test_rmail_message.rb
|
|
531
|
+
- test/unit/test_thread_view_mode.rb
|
|
531
532
|
- test/unit/util/test_query.rb
|
|
532
533
|
- test/unit/util/test_string.rb
|
|
533
534
|
- test/unit/util/test_uri.rb
|
|
@@ -619,6 +620,7 @@ test_files:
|
|
|
619
620
|
- test/unit/test_maildir.rb
|
|
620
621
|
- test/unit/test_person.rb
|
|
621
622
|
- test/unit/test_rmail_message.rb
|
|
623
|
+
- test/unit/test_thread_view_mode.rb
|
|
622
624
|
- test/unit/util/test_query.rb
|
|
623
625
|
- test/unit/util/test_string.rb
|
|
624
626
|
- test/unit/util/test_uri.rb
|