JasonKing-inline_attachment 0.3.6 → 0.3.7
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.
- data/lib/inline_attachment.rb +3 -14
- metadata +1 -2
- data/lib/tmail_content_id.rb +0 -40
data/lib/inline_attachment.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
TMail::HeaderField::FNAME_TO_CLASS.delete('content-id')
|
2
|
+
|
1
3
|
module ActionMailer
|
2
4
|
module PartContainer
|
3
5
|
# Add an inline attachment to a multipart message.
|
@@ -73,7 +75,7 @@ module ActionView
|
|
73
75
|
|
74
76
|
if @part_container.is_a?(ActionMailer::Base) or @part_container.is_a?(ActionMailer::Part)
|
75
77
|
file_path = "#{RAILS_ROOT}/public#{image_path(source).split('?').first}"
|
76
|
-
basename = File.basename(file_path
|
78
|
+
basename = File.basename(file_path)
|
77
79
|
ext = basename.split('.').last
|
78
80
|
cid = Time.now.to_f.to_s + "#{basename}@inline_attachment"
|
79
81
|
file = File.open(file_path, 'rb')
|
@@ -102,16 +104,3 @@ module ActionView
|
|
102
104
|
end
|
103
105
|
end
|
104
106
|
|
105
|
-
class DummyClass
|
106
|
-
def relative_url_root
|
107
|
-
""
|
108
|
-
end
|
109
|
-
end
|
110
|
-
|
111
|
-
module ActionMailer #:nodoc:
|
112
|
-
class Base
|
113
|
-
def request
|
114
|
-
DummyClass.new
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: JasonKing-inline_attachment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason King
|
@@ -33,7 +33,6 @@ extra_rdoc_files: []
|
|
33
33
|
files:
|
34
34
|
- README
|
35
35
|
- lib/inline_attachment.rb
|
36
|
-
- lib/tmail_content_id.rb
|
37
36
|
has_rdoc: true
|
38
37
|
homepage: http://github.com/JasonKing/inline_attachment
|
39
38
|
post_install_message:
|
data/lib/tmail_content_id.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
module TMail
|
2
|
-
|
3
|
-
class HeaderField # redefine
|
4
|
-
|
5
|
-
FNAME_TO_CLASS = {
|
6
|
-
'date' => DateTimeHeader,
|
7
|
-
'resent-date' => DateTimeHeader,
|
8
|
-
'to' => AddressHeader,
|
9
|
-
'cc' => AddressHeader,
|
10
|
-
'bcc' => AddressHeader,
|
11
|
-
'from' => AddressHeader,
|
12
|
-
'reply-to' => AddressHeader,
|
13
|
-
'resent-to' => AddressHeader,
|
14
|
-
'resent-cc' => AddressHeader,
|
15
|
-
'resent-bcc' => AddressHeader,
|
16
|
-
'resent-from' => AddressHeader,
|
17
|
-
'resent-reply-to' => AddressHeader,
|
18
|
-
'sender' => SingleAddressHeader,
|
19
|
-
'resent-sender' => SingleAddressHeader,
|
20
|
-
'return-path' => ReturnPathHeader,
|
21
|
-
'message-id' => MessageIdHeader,
|
22
|
-
'resent-message-id' => MessageIdHeader,
|
23
|
-
'in-reply-to' => ReferencesHeader,
|
24
|
-
'received' => ReceivedHeader,
|
25
|
-
'references' => ReferencesHeader,
|
26
|
-
'keywords' => KeywordsHeader,
|
27
|
-
'encrypted' => EncryptedHeader,
|
28
|
-
'mime-version' => MimeVersionHeader,
|
29
|
-
'content-type' => ContentTypeHeader,
|
30
|
-
'content-transfer-encoding' => ContentTransferEncodingHeader,
|
31
|
-
'content-disposition' => ContentDispositionHeader,
|
32
|
-
# 'content-id' => MessageIdHeader,
|
33
|
-
'subject' => UnstructuredHeader,
|
34
|
-
'comments' => UnstructuredHeader,
|
35
|
-
'content-description' => UnstructuredHeader
|
36
|
-
}
|
37
|
-
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|