letter_thief 0.3.0 → 0.3.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6499e5cbb2af8bad84fb9863a315ce4ad653c1c8890fee9ca2747698bd5c62b
|
4
|
+
data.tar.gz: 3b29cad5552eb3146ee54318d449bd308415e96103e77f2fab2cd0aa470605f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b21b55c15b62da8651c3a635cbe738e8d96c09624ebca55e1f8d8ccc5a7395db4893e82477799cd5b03da0f41f1a32e461d3e81883abb7eade09241f3568378b
|
7
|
+
data.tar.gz: 2d0ce2431449dc9562730cf1a619bad0297386fe62976dc592b9fffe3ee22a1473989fd1b0b201720cb69792ed7b3907994e37afd119741bbe486c505cf44eb0
|
@@ -2,9 +2,11 @@ module LetterThief
|
|
2
2
|
module ApplicationHelper
|
3
3
|
def parsed_body_html(email)
|
4
4
|
rendered = email.body_html
|
5
|
-
email.attachments
|
6
|
-
|
7
|
-
|
5
|
+
if email.respond_to?(:attachments)
|
6
|
+
email.attachments.each do |attachment|
|
7
|
+
puts attachment.blob.metadata["cid"]
|
8
|
+
rendered.gsub!("cid:#{attachment.blob.metadata["cid"]}", main_app.rails_blob_path(attachment))
|
9
|
+
end
|
8
10
|
end
|
9
11
|
# autolinking can be implemented for text bodies
|
10
12
|
# rendered.gsub!(URI::Parser.new.make_regexp(%W[https http])) do |link|
|
@@ -16,7 +16,7 @@ module LetterThief
|
|
16
16
|
intercepted_at: Time.current
|
17
17
|
)
|
18
18
|
|
19
|
-
if
|
19
|
+
if email.respond_to?(:attachments)
|
20
20
|
Array(mail.attachments).each do |attachment|
|
21
21
|
ar_attachment = email.attachments.attach(
|
22
22
|
io: StringIO.new(attachment.body.decoded),
|
data/lib/letter_thief/version.rb
CHANGED
data/lib/letter_thief.rb
CHANGED
@@ -13,7 +13,6 @@ module LetterThief
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.activestorage_available?
|
16
|
-
defined?(ActiveStorage) &&
|
17
|
-
ActiveRecord::Base.connection.table_exists?("active_storage_attachments")
|
16
|
+
defined?(ActiveStorage) && ActiveRecord::Base.connection.table_exists?("active_storage_attachments")
|
18
17
|
end
|
19
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: letter_thief
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Rodi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|