backupper 0.4.2 → 0.5.0
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/bin/backupper +1 -1
- data/lib/backupper/backupper.rb +1 -1
- data/lib/backupper/mailer.rb +9 -10
- 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: 5a62ccacd902e965abc1f8ca3e2e3cd62c19f7d409a8ce518bb189e12200b026
|
4
|
+
data.tar.gz: 954a6ce0b31a61ff158e06fe6433c31eba02104f256e17f7cbd76e792475f071
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d321d489e3ecd95d652c8e82dc33f691189af99b6ad797aa1f292822a6a1bbf97aa73b9eae2d1bf1260a7cb4b8ddf8eb9065a0d2b533a72e93e44bb8599b97f5
|
7
|
+
data.tar.gz: 8b05b87aab8fabedefc6b60a37edc235ab78c6f59aca215d7caae1bd650c9cbcc0efb45deefb5c89a137327a04af793f0f90c832b12cb6965623bb8e91703a87
|
data/Gemfile.lock
CHANGED
data/bin/backupper
CHANGED
data/lib/backupper/backupper.rb
CHANGED
@@ -103,7 +103,7 @@ class Backupper
|
|
103
103
|
def send_report_email!
|
104
104
|
if @report.any? && @mailer['from'] && @mailer['to'] && @mailer['password']
|
105
105
|
begin
|
106
|
-
Mailer.send(from: @mailer['from'], to: @mailer['to'], password: @mailer['password'],
|
106
|
+
Mailer.send(@report, from: @mailer['from'], to: @mailer['to'], password: @mailer['password'], address: @mailer['address'] || 'smtp.gmail.com', port: @mailer['port'] || 587, authentication: @mailer['authentication'] || 'plain')
|
107
107
|
rescue Net::SMTPAuthenticationError => e
|
108
108
|
@logger.error e
|
109
109
|
end
|
data/lib/backupper/mailer.rb
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
require 'mail'
|
2
2
|
|
3
3
|
class Mailer
|
4
|
-
def self.send(from:, to:, password:,
|
5
|
-
options = {
|
6
|
-
address: 'smtp.gmail.com',
|
7
|
-
port: 587,
|
8
|
-
user_name: from,
|
9
|
-
password: password,
|
10
|
-
authentication: 'plain',
|
11
|
-
enable_starttls_auto: true
|
12
|
-
}
|
4
|
+
def self.send(report, from:, to:, password:, address:, port:, authentication:)
|
13
5
|
Mail.defaults do
|
14
|
-
delivery_method :smtp,
|
6
|
+
delivery_method :smtp, {
|
7
|
+
address: address,
|
8
|
+
port: port,
|
9
|
+
user_name: from,
|
10
|
+
password: password,
|
11
|
+
authentication: authentication,
|
12
|
+
enable_starttls_auto: true
|
13
|
+
}
|
15
14
|
end
|
16
15
|
Mail.deliver(to: to, from: from, subject: generate_subject(report), body: generate_body(report))
|
17
16
|
end
|
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
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- pioz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mail
|