keepitsafe 0.2.1 → 0.2.2

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -0,0 +1,50 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
5
+ <title>Error</title>
6
+
7
+ </head>
8
+ <body style="font-family: Arial; color: #aaa; font-size: 16px;">
9
+
10
+
11
+ <center>
12
+ <table cellpadding="0" cellspacing="0" style="width: 600px; margin: 0px 0px; border: solid 1px #eee; text-align: left;" width=600>
13
+ <tr>
14
+ <td>
15
+ <div class="header" style="background: #7db725; color: white;">
16
+ <h1 style="padding: 15px; margin: 0px;">Keepitsafe <span style="color: red;">ERROR!<span></h1>
17
+ </div>
18
+
19
+ <table cellpadding="0" cellspacing="0" style="width: 560px; color: black; margin: 20px;">
20
+ <tr>
21
+ <td colspan="4" style="background: #7db725; font-size: 20px; color: white; padding: 10px 0px 10px 10px; border: solid 1px white;">
22
+ <%= backup.domain %>
23
+ </td>
24
+ </tr>
25
+ <tr>
26
+ <td colspan="4" style="background: #A2AC50; color: white; padding: 10px 0px 10px 10px; border: solid 1px white; border-top: solid 4px white; border-bottom: solid 0px white;">
27
+ <h1 style="font-size: 13px; margin: 0px;">Output log</h1>
28
+ </td>
29
+ </tr>
30
+ <tr>
31
+ <td colspan="4" style="background: #eee; color: black; padding: 10px 0px 10px 10px; border: solid 1px white; border-top: 0px;">
32
+ <pre style="font-size: 10px; overflow: scroll; width: 500px; padding: 20px;"><%= backup.log_buffer.string %></pre>
33
+ </td>
34
+ </tr>
35
+ </table>
36
+
37
+ <div class="footer" style="background: #5b5f37; color: white; padding: 15px; padding-bottom: 50px; margin-top: 50px;">
38
+ <p style="margin: 0px; font-size: 13px;">
39
+ Backup done using <a style="color: white;" href="https://github.com/bjornblomqvist/keepitsafe">Keepitsafe</a>.
40
+ Contribute by forking and sending a pull request or opening an issue on github. A nicer email design is also welcomed!
41
+ </p>
42
+ </div>
43
+ </td>
44
+ <tr>
45
+ </table>
46
+ </center>
47
+
48
+ </body>
49
+ </html>
50
+
data/keepitsafe.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "keepitsafe"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Darwin"]
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "README.rdoc",
26
26
  "Rakefile",
27
27
  "VERSION",
28
+ "email/error/error.html.erb",
28
29
  "email/report/report.html.erb",
29
30
  "example/localhost.rb",
30
31
  "example/server.com.rb",
data/lib/backup_report.rb CHANGED
@@ -22,11 +22,11 @@ class BackupReport
22
22
  mail = MailBuilder.new("#{File.dirname(__FILE__)}/../email/report").build({:backups => backups, :start_time => start_time, :end_time => end_time})
23
23
  mail.to to
24
24
  mail.from from
25
- mail.subject "Backup report"
25
+ mail.subject "Backup report: #{backups.select {|b| b.error != nil}.count} Error"
26
26
  mail.delivery_method.settings = mail.delivery_method.settings.merge(mail_options)
27
27
  mail.deliver!
28
28
 
29
- puts "Sent backup report to: #{to}"
29
+ puts "\nSent backup report to: #{to}"
30
30
 
31
31
  end
32
32
 
data/lib/error_mail.rb CHANGED
@@ -7,22 +7,14 @@ class ErrorMail
7
7
 
8
8
  Keepitsafe.on_error do |backup,options|
9
9
 
10
- mail = Mail.new
10
+ mail = MailBuilder.new("#{File.dirname(__FILE__)}/../email/error").build({:backup => backup})
11
11
  mail.from from
12
12
  mail.to to
13
- mail.subject 'Backup error!'
14
- mail.body %@
15
-
16
- Backup problems when backing up: #{backup.domain}
17
- We are runnig on: #{Socket.gethostname}
18
-
19
- #{options[:error].inspect}
20
- #{options[:error].backtrace}@
21
-
13
+ mail.subject "[#{backup.domain}] Backup ERROR!"
22
14
  mail.delivery_method.settings = mail.delivery_method.settings.merge(mail_options)
23
15
  mail.deliver!
24
16
 
25
- puts "Error has been mailed to #{mail.to}!"
17
+ puts "\nError has been mailed to #{mail.to}!"
26
18
  end
27
19
 
28
20
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: keepitsafe
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.1
5
+ version: 0.2.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Darwin
@@ -151,6 +151,7 @@ files:
151
151
  - README.rdoc
152
152
  - Rakefile
153
153
  - VERSION
154
+ - email/error/error.html.erb
154
155
  - email/report/report.html.erb
155
156
  - example/localhost.rb
156
157
  - example/server.com.rb
@@ -187,7 +188,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
188
  requirements:
188
189
  - - ">="
189
190
  - !ruby/object:Gem::Version
190
- hash: 3712794076049775786
191
+ hash: -2221830935383907228
191
192
  segments:
192
193
  - 0
193
194
  version: "0"