postmortem 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +1 -1
- data/layout/layout.js +2 -1
- data/lib/postmortem/adapters/action_mailer.rb +1 -2
- data/lib/postmortem/adapters/base.rb +1 -1
- data/lib/postmortem/adapters/mail.rb +1 -2
- data/lib/postmortem/delivery.rb +1 -1
- data/lib/postmortem/identity.rb +1 -1
- data/lib/postmortem/index.rb +1 -1
- data/lib/postmortem/layout.rb +11 -1
- data/lib/postmortem/version.rb +1 -1
- data/postmortem.gemspec +9 -8
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 780f61b6eb5f86e5bfdb462a7956b5153621a65b2d52df46391cca4c7717136f
|
4
|
+
data.tar.gz: 1e455516c635c912c2effbce4781529abdd036196092f9d16eaea4ec1a17e5f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d023d75793d8d8da14f24e2dfa8b1748087c719e2f92df80de5568babb8f3efe89c21d0456e556d2830df50bbe46ab30dadaaabfe1760420a32f1c45b2d14835
|
7
|
+
data.tar.gz: 07bab3669ab537e92532f58d7cfa6b66465e0c3b39af5f73e544cc8099165960e2e7a214ff00d15ad8df05c311fbf4efc76c05ad3205756cf8df8e16397c1cd5
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.9
|
data/README.md
CHANGED
data/layout/layout.js
CHANGED
@@ -375,8 +375,9 @@
|
|
375
375
|
const modifiedHtml = [html.substring(0, start), html.substring(end + 1, html.length)].join('');
|
376
376
|
const blob = new Blob([modifiedHtml], { type: 'application/octet-stream' });
|
377
377
|
const uri = window.URL.createObjectURL(blob);
|
378
|
+
const subject = mail.subject || '(No subject)'
|
378
379
|
$("#download-link").attr('href', uri);
|
379
|
-
$("#download-link").attr('download',
|
380
|
+
$("#download-link").attr('download', subject.replace(/[^0-9a-zA-Z_ -]/gi, '') + '.html');
|
380
381
|
};
|
381
382
|
|
382
383
|
const loadUploadLink = (email) => {
|
@@ -8,8 +8,7 @@ module Postmortem
|
|
8
8
|
|
9
9
|
def adapted
|
10
10
|
%i[from reply_to to cc subject message_id]
|
11
|
-
.
|
12
|
-
.to_h
|
11
|
+
.to_h { |field| [field, mail.public_send(field)] }
|
13
12
|
.merge({ text_body: text_part, html_body: html_part, bcc: normalized_bcc })
|
14
13
|
end
|
15
14
|
|
@@ -8,8 +8,7 @@ module Postmortem
|
|
8
8
|
|
9
9
|
def adapted
|
10
10
|
%i[from reply_to to cc bcc subject message_id]
|
11
|
-
.
|
12
|
-
.to_h
|
11
|
+
.to_h { |field| [field, mail.public_send(field)] }
|
13
12
|
.merge({ text_body: text_part, html_body: html_part })
|
14
13
|
end
|
15
14
|
|
data/lib/postmortem/delivery.rb
CHANGED
data/lib/postmortem/identity.rb
CHANGED
@@ -4,7 +4,7 @@ module Postmortem
|
|
4
4
|
# Provides an HTML document that announces a unique ID to a parent page via JS message events.
|
5
5
|
class Identity
|
6
6
|
def content
|
7
|
-
ERB.new(File.read(path),
|
7
|
+
ERB.new(File.read(path), trim_mode: '-').result(binding)
|
8
8
|
end
|
9
9
|
|
10
10
|
private
|
data/lib/postmortem/index.rb
CHANGED
data/lib/postmortem/layout.rb
CHANGED
@@ -54,7 +54,7 @@ module Postmortem
|
|
54
54
|
def with_inlined_images(body)
|
55
55
|
parsed = Nokogiri::HTML.parse(body)
|
56
56
|
parsed.css('img').each do |img|
|
57
|
-
uri =
|
57
|
+
uri = extract_image_uri(img)
|
58
58
|
next unless local_file?(uri)
|
59
59
|
|
60
60
|
path = located_image(uri)
|
@@ -63,6 +63,16 @@ module Postmortem
|
|
63
63
|
parsed.to_s
|
64
64
|
end
|
65
65
|
|
66
|
+
def extract_image_uri(img)
|
67
|
+
src_uri = try_uri(img['src'])
|
68
|
+
return src_uri if src_uri&.path.present?
|
69
|
+
|
70
|
+
original_src_uri = try_uri(img['data-originalsrc'])
|
71
|
+
return original_src_uri if original_src_uri&.path.present?
|
72
|
+
|
73
|
+
nil
|
74
|
+
end
|
75
|
+
|
66
76
|
def local_file?(uri)
|
67
77
|
return false if uri.nil?
|
68
78
|
return true if uri.host.nil?
|
data/lib/postmortem/version.rb
CHANGED
data/postmortem.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = 'Preview HTML emails in your browser during development'
|
13
13
|
spec.homepage = 'https://github.com/bobf/postmortem'
|
14
14
|
spec.license = 'MIT'
|
15
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
|
16
16
|
|
17
17
|
spec.metadata['homepage_uri'] = spec.homepage
|
18
18
|
spec.metadata['source_code_uri'] = spec.homepage
|
@@ -27,14 +27,15 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.add_runtime_dependency 'mail', '~> 2.7'
|
29
29
|
|
30
|
-
spec.add_development_dependency 'actionmailer', '~> 6.
|
31
|
-
spec.add_development_dependency 'devpack', '~> 0.
|
32
|
-
spec.add_development_dependency 'faker', '~> 2.
|
30
|
+
spec.add_development_dependency 'actionmailer', '~> 6.1'
|
31
|
+
spec.add_development_dependency 'devpack', '~> 0.4.0'
|
32
|
+
spec.add_development_dependency 'faker', '~> 2.21'
|
33
33
|
spec.add_development_dependency 'pony', '~> 1.13'
|
34
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
34
|
+
spec.add_development_dependency 'rspec', '~> 3.11'
|
35
35
|
spec.add_development_dependency 'rspec-its', '~> 1.3'
|
36
|
-
spec.add_development_dependency 'rubocop', '~> 1.
|
37
|
-
spec.add_development_dependency 'rubocop-rspec', '~> 2.
|
36
|
+
spec.add_development_dependency 'rubocop', '~> 1.30'
|
37
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.11'
|
38
38
|
spec.add_development_dependency 'strong_versions', '~> 0.4.5'
|
39
|
-
spec.add_development_dependency 'timecop', '~> 0.9.
|
39
|
+
spec.add_development_dependency 'timecop', '~> 0.9.5'
|
40
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
40
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmortem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Farrell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|
@@ -30,42 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '6.
|
33
|
+
version: '6.1'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '6.
|
40
|
+
version: '6.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: devpack
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.4.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.4.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: faker
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '2.
|
61
|
+
version: '2.21'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '2.
|
68
|
+
version: '2.21'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: pony
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '3.
|
89
|
+
version: '3.11'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '3.
|
96
|
+
version: '3.11'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rspec-its
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,28 +114,28 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '1.
|
117
|
+
version: '1.30'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '1.
|
124
|
+
version: '1.30'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rubocop-rspec
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '2.
|
131
|
+
version: '2.11'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '2.
|
138
|
+
version: '2.11'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: strong_versions
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.9.
|
159
|
+
version: 0.9.5
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.9.
|
166
|
+
version: 0.9.5
|
167
167
|
description: Preview HTML emails in your browser during development
|
168
168
|
email:
|
169
169
|
- git@bob.frl
|
@@ -214,6 +214,7 @@ metadata:
|
|
214
214
|
homepage_uri: https://github.com/bobf/postmortem
|
215
215
|
source_code_uri: https://github.com/bobf/postmortem
|
216
216
|
changelog_uri: https://github.com/bobf/postmortem/blob/master/README.md
|
217
|
+
rubygems_mfa_required: 'true'
|
217
218
|
post_install_message:
|
218
219
|
rdoc_options: []
|
219
220
|
require_paths:
|
@@ -222,15 +223,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
222
223
|
requirements:
|
223
224
|
- - ">="
|
224
225
|
- !ruby/object:Gem::Version
|
225
|
-
version: 2.
|
226
|
+
version: 2.6.0
|
226
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
227
228
|
requirements:
|
228
229
|
- - ">="
|
229
230
|
- !ruby/object:Gem::Version
|
230
231
|
version: '0'
|
231
232
|
requirements: []
|
232
|
-
|
233
|
-
rubygems_version: 2.7.6.2
|
233
|
+
rubygems_version: 3.2.3
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: Development HTML Email Inspection Tool
|