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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6732c30468e86071392cbc1545ade2132f75f10fc10a5c5ef603309c1c8778a0
4
- data.tar.gz: 6277da7cf00f5ce107dca80ac6a703f94890be3aa0d4c1eb920cd3bb59826b88
3
+ metadata.gz: 5a62ccacd902e965abc1f8ca3e2e3cd62c19f7d409a8ce518bb189e12200b026
4
+ data.tar.gz: 954a6ce0b31a61ff158e06fe6433c31eba02104f256e17f7cbd76e792475f071
5
5
  SHA512:
6
- metadata.gz: 37f1f3d7417ad9b7603eee7dcedbacd51efa4d9e5c9cf5df795cbedb9638421a9ed3fd02a658bc0e69bbcbcefd0e4ea9ec98b8f6f75e5a8f54be3729da5e8c4d
7
- data.tar.gz: 132024ca21163d430a93f864fee2b97411041446955ef1834f2d79b7eaffdc848cc3ec1efa376a053a402f7401082f9d247bb6785b5a24f0385465fa8d8e9df3
6
+ metadata.gz: d321d489e3ecd95d652c8e82dc33f691189af99b6ad797aa1f292822a6a1bbf97aa73b9eae2d1bf1260a7cb4b8ddf8eb9065a0d2b533a72e93e44bb8599b97f5
7
+ data.tar.gz: 8b05b87aab8fabedefc6b60a37edc235ab78c6f59aca215d7caae1bd650c9cbcc0efb45deefb5c89a137327a04af793f0f90c832b12cb6965623bb8e91703a87
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- backupper (0.4.2)
4
+ backupper (0.5.0)
5
5
  mail (~> 2.7)
6
6
  sshkit (~> 1.15)
7
7
 
data/bin/backupper CHANGED
@@ -21,7 +21,7 @@ begin
21
21
  parser.parse!
22
22
  raise OptionParser::InvalidOption if ARGV.size != 1
23
23
  rescue OptionParser::InvalidOption
24
- puts parser.banner
24
+ puts parser.help
25
25
  exit 1
26
26
  end
27
27
 
@@ -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'], report: @report)
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
@@ -1,17 +1,16 @@
1
1
  require 'mail'
2
2
 
3
3
  class Mailer
4
- def self.send(from:, to:, password:, report:)
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, options
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
@@ -1,3 +1,3 @@
1
1
  class Backupper
2
- VERSION = '0.4.2'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
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.2
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-06-28 00:00:00.000000000 Z
11
+ date: 2022-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail