markdown_gmail_sender 0.1.0 → 0.1.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/markdown_gmail_sender.rb +6 -14
- metadata +2 -2
- metadata.gz.sig +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee78a3caba7e0faebd6d137c700ea14d38220b96
|
4
|
+
data.tar.gz: 1e6aac625121731dc3c5a58ddbe7e3aa499e3bba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d9eca1565a13f594e589f022ea71d12f93a801b1941e39d02f413ed8522c0f5d7312df101f463de29a7856c5dfc53d93212c369730e17dea94c6df3b07c7a0f
|
7
|
+
data.tar.gz: 903b05695dc968925a5fbc3079b49e4b595df9f8a3e0af59725c52ea4997c8c8b9cb25243d46692af9e288ce3e2076ca9e790da93c9ced21d215048d39a12116
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
@@ -24,16 +24,11 @@ class MarkdownGmailSender
|
|
24
24
|
|
25
25
|
s = File.read filepath
|
26
26
|
|
27
|
-
from
|
28
|
-
|
29
|
-
subject = s[/subject: ([^\n]+)/,1]
|
30
|
-
subject_line = s.lines.detect{|x| x =~ /subject: / }
|
31
|
-
body = s.lines[(s.lines.index(subject_line) + 1) .. -1].join.strip
|
27
|
+
/from: (?<from>[\S]+)/ =~ s; /to: (?<to>[\S]+)/ =~ s
|
28
|
+
/subject: (?<subject>[^\n]+)\n(?<body>.*)/m =~ s
|
32
29
|
|
33
30
|
{
|
34
|
-
filepath: filepath,
|
35
|
-
from: from, to: to,
|
36
|
-
subject: subject,
|
31
|
+
filepath: filepath, from: from, to: to, subject: subject,
|
37
32
|
body_txt: body, body_html: RDiscount.new(body).to_html
|
38
33
|
}
|
39
34
|
|
@@ -45,17 +40,14 @@ class MarkdownGmailSender
|
|
45
40
|
|
46
41
|
@messages.each.with_index do |x, i|
|
47
42
|
|
48
|
-
|
49
|
-
gmail = Gmail.new(username, password)
|
43
|
+
gmail = Gmail.new(username=x[:from], password=@accounts[x[:from]])
|
50
44
|
|
51
45
|
gmail.deliver do
|
52
46
|
|
53
47
|
to x[:to]
|
54
48
|
subject x[:subject]
|
55
49
|
|
56
|
-
text_part
|
57
|
-
body x[:body_txt]
|
58
|
-
end
|
50
|
+
text_part { body x[:body_txt] }
|
59
51
|
|
60
52
|
html_part do
|
61
53
|
content_type 'text/html; charset=UTF-8'
|
@@ -77,4 +69,4 @@ class MarkdownGmailSender
|
|
77
69
|
|
78
70
|
alias deliver deliver_all
|
79
71
|
|
80
|
-
end
|
72
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markdown_gmail_sender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
OLGmpGkaE9Sobz20K+IVp5+s3z06CrVYK7TN2gXYiGZRGAxmnd3sd0F8Aewu4uWI
|
32
32
|
HiWyElQDGz9Bjw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-05-
|
34
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: gmail
|
metadata.gz.sig
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
�ҷ;C�e�c <�x"���L��q���
|
5
|
-
T\Y�$H#��������'|3l/�0`4D�JLB�J-��hY]c��C���c��8�xʠ��8D���T��;{A,�c��n�&�djӓ��w;[Sζ� �=#" ���
|
1
|
+
Z���E��G<#o1�N��RB��U��*�E�;^PR�q�\������BK��1���݅ E�IYVr7I��JY�̡x;u9�r�|�{W�G�"q
|
2
|
+
J�
|
3
|
+
��j������=���ذ�u&�wq�%xj
|