backupper 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/backupper/mailer.rb +3 -8
- data/lib/backupper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 573331f34a1bce133cd5b9d021e888fec59d07d2aedbc206a2ed3966effb030e
|
4
|
+
data.tar.gz: bdce765523c2b93efeb1b95cf3c5f9ef39a0e4adc634ac720fb765c0d416d1ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b662880a0de3b61521ebec6bf58323ca392a0561679b9ff57cabbf2bb7475670cc64975844fa6abd3b4c76d1cc62bacf88dfe828ff9062e723e257daf23c62f
|
7
|
+
data.tar.gz: 253addc17de4fb4381a3d1c1912a922efd721b9c3409374aaa7a0c3630736e7ccf67e49be7f77a986c65d71796a068d8815107f581906b65f0beb67f73f38867
|
data/Gemfile.lock
CHANGED
data/lib/backupper/mailer.rb
CHANGED
@@ -13,18 +13,13 @@ class Mailer
|
|
13
13
|
Mail.defaults do
|
14
14
|
delivery_method :smtp, options
|
15
15
|
end
|
16
|
-
Mail.deliver
|
17
|
-
to to
|
18
|
-
from from
|
19
|
-
subject self.subject(report)
|
20
|
-
body self.body(report)
|
21
|
-
end
|
16
|
+
Mail.deliver(to: to, from: from, subject: generate_subject(report), body: generate_body(report))
|
22
17
|
end
|
23
18
|
|
24
19
|
class << self
|
25
20
|
private
|
26
21
|
|
27
|
-
def
|
22
|
+
def generate_body(report)
|
28
23
|
b = []
|
29
24
|
report.each do |k, data|
|
30
25
|
s = ''
|
@@ -51,7 +46,7 @@ class Mailer
|
|
51
46
|
return "Report for backups (#{Time.now})\n\n#{b.join("\n\n")}"
|
52
47
|
end
|
53
48
|
|
54
|
-
def
|
49
|
+
def generate_subject(report)
|
55
50
|
errors = report.select { |_k, v| v[:error] }.size
|
56
51
|
icon = '✅'
|
57
52
|
icon = '⚠️' if errors > 0
|
data/lib/backupper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: backupper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pioz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|