henry-container 0.1.27 → 0.1.28
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/henry/container/version.rb +1 -1
- data/lib/henry/email_client.rb +41 -0
- data.tar.gz.asc +7 -7
- metadata +2 -2
- metadata.gz.asc +7 -7
data/lib/henry/email_client.rb
CHANGED
@@ -5,6 +5,7 @@ module Henry
|
|
5
5
|
# Email client to send reports by email
|
6
6
|
class EmailClient
|
7
7
|
|
8
|
+
# Settign up the email SMTP
|
8
9
|
Mail.defaults do
|
9
10
|
delivery_method :smtp,
|
10
11
|
address: 'smtp.gmail.com',
|
@@ -15,7 +16,27 @@ module Henry
|
|
15
16
|
enable_starttls_auto: true
|
16
17
|
end
|
17
18
|
|
19
|
+
# Sends a file by email (fails silentl).
|
20
|
+
#
|
21
|
+
# @param [String] file_path the path of he target file.
|
22
|
+
# @param [<String>] recipients the list of recipients.
|
23
|
+
# @param [String] sebject the email subject (optional).
|
24
|
+
# @return [True,False] whenever the task ends successfully or not.
|
18
25
|
def self.send_file(file_path, recipients, subject='')
|
26
|
+
begin
|
27
|
+
self.send_file!(file_path, recipients, subject)
|
28
|
+
return true
|
29
|
+
rescue Net::SMTPUnknownError
|
30
|
+
return false
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
# Sends a file by email (rise exeption on error).
|
35
|
+
#
|
36
|
+
# @param [String] file_path the path of he target file.
|
37
|
+
# @param [<String>] recipients the list of recipients.
|
38
|
+
# @param [String] sebject the email subject (optional).
|
39
|
+
def self.send_file!(file_path, recipients, subject='')
|
19
40
|
Mail.deliver do
|
20
41
|
from 'Henry Reports <henry.despegar.reports@gmail.com>'
|
21
42
|
bcc recipients.join(',')
|
@@ -24,7 +45,27 @@ module Henry
|
|
24
45
|
end
|
25
46
|
end
|
26
47
|
|
48
|
+
# Sends a message by email (fails silently).
|
49
|
+
#
|
50
|
+
# @param [String] message the message to be sent.
|
51
|
+
# @param [<String>] recipients the list of recipients.
|
52
|
+
# @param [String] sebject the email subject (optional).
|
53
|
+
# @return [True,False] whenever the task ends successfully or not.
|
27
54
|
def self.send_message(message, recipients, subject='')
|
55
|
+
begin
|
56
|
+
self.send_message!(message, recipients, subject)
|
57
|
+
return true
|
58
|
+
rescue Net::SMTPUnknownError
|
59
|
+
return false
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Sends a message by email (rise exception on error).
|
64
|
+
#
|
65
|
+
# @param [String] message the message to be sent.
|
66
|
+
# @param [<String>] recipients the list of recipients.
|
67
|
+
# @param [String] sebject the email subject (optional).
|
68
|
+
def send_message!(message, recipients, subject='')
|
28
69
|
Mail.deliver do
|
29
70
|
from 'Henry Reports <henry.despegar.reports@gmail.com>'
|
30
71
|
bcc recipients.join(',')
|
data.tar.gz.asc
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
-----BEGIN PGP SIGNATURE-----
|
2
2
|
Version: GnuPG v1.4.11 (GNU/Linux)
|
3
3
|
|
4
|
-
|
5
|
-
/
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
=
|
4
|
+
iQEcBAABAgAGBQJRXC0KAAoJEHEygQkPTV7SC6cH/iHfZrI+G5FJWDmJPK1DRbGS
|
5
|
+
AKwxBeWwu3FxwAJWQZCt3phvqaXg3ZGsN5sWQccTn63D/qF9MLOusYrF7uTHOT62
|
6
|
+
x6c2Fexl9QjKG5hXyLKlJZYpITkxQ4EmD955RLqZKxWrmm1OQsnc10tQ+sqr2bl2
|
7
|
+
j7OBe8tVLg/dG6dP33Trx6OT598ROpr4TZ8i2pJdxyGC5Dnue8xN1o/hgAcfe+sj
|
8
|
+
t2cHvc5afBRTrNStFeYwUx12F760bObr4/pB+WkYm+zkpYhCICBl+GJc57oL/DfJ
|
9
|
+
xhPTm9II316gVukyS1GzI6Bj/wyB3f8tzIMntiuJNreMHLUtXdNwcF4t6/Hc1jM=
|
10
|
+
=u5wN
|
11
11
|
-----END PGP SIGNATURE-----
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: henry-container
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.28
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03
|
12
|
+
date: 2013-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
metadata.gz.asc
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
-----BEGIN PGP SIGNATURE-----
|
2
2
|
Version: GnuPG v1.4.11 (GNU/Linux)
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
+
|
9
|
-
|
10
|
-
=
|
4
|
+
iQEcBAABAgAGBQJRXC0SAAoJEHEygQkPTV7SsiwIAIlYyTZi7aiRSz53PS++r6Xe
|
5
|
+
vtk8pnXiKKUPZpdCGR5LFON/8/HC7sXO9u3LW581Hpo8YoR47uM8YZ6y87nbefkX
|
6
|
+
l9iEHPvbl93ntQ67qzHWLG9HO50w/G1Rzst87ix1COaqRacWg1r4OlDrYhb3i+c9
|
7
|
+
+Ubdekc43EJIQX/JxHwP4xaT8HVJn2PuVptu+1hUZFx9fJfQo1jZ7zR4Wb/fB8lr
|
8
|
+
xR7PS5FyPfUuDeYrmmZ7Jdb48fGcjdGQYgtq9lprrTOy2XHGvez/DIJqlj+ZxUkI
|
9
|
+
xcIpENC3s3fzLVWHlGfQSZ5G9T5CaoiwsEjG3X65iQ7OH5sofNdxhZnfqq1nUXs=
|
10
|
+
=CjO2
|
11
11
|
-----END PGP SIGNATURE-----
|