markdown_gmail_sender 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16edcd6d9d8c24ffd88b041a29cdb28ea90f757c
4
- data.tar.gz: 904994b98bcec5d7d46f2b17c940deae419c384d
3
+ metadata.gz: ee78a3caba7e0faebd6d137c700ea14d38220b96
4
+ data.tar.gz: 1e6aac625121731dc3c5a58ddbe7e3aa499e3bba
5
5
  SHA512:
6
- metadata.gz: 12c24b154fc4a4ddf7cc7fa05f2417a58ee0f93c007c51b4ca3d431b92f5c0ea71a6afa9d3ec8883e6d64606cad5a5f73191eb95b2b2f64195dfd9c961595f5d
7
- data.tar.gz: 1d6e51ad9146b88d5604eef62bff26a0b1d38188f75c91f4d805a6bc399219ae2d7bda2e6d44e3b38074089d1c999cf5e6d0a2f96b7ebf4dd5d6a9c324d93673
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 = s[/from: ([\S]+)/,1]
28
- to = s[/to: ([\S]+)/,1]
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
- username, password = x[:from], @accounts[x[:from]]
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 do
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.0
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-30 00:00:00.000000000 Z
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
- ho��l��� d�׼s��J��R ��F�ѯ�z<��?Z0�9
2
- "_PZ��;�K݃p�)B �K�d2�S���vl$� &�#�{/|�R�
3
- �����n�u��1Coޣ@
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