backup 4.3.0 → 4.4.1

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
- SHA1:
3
- metadata.gz: c7e4e7ea9006f973c8df272ad4520265fb5a25e1
4
- data.tar.gz: ce45e91cc9d2b80f721cbcda2f4012fce936fb7f
2
+ SHA256:
3
+ metadata.gz: 27f2f7a25217955273c6b721509dacde87c0ba06715004ee3cf732262a4e3fed
4
+ data.tar.gz: ee514abc68b3d0ecb52f6965b14dac5d6ac8d17386a5ae8ef46029cf6aa332a3
5
5
  SHA512:
6
- metadata.gz: 866350af1103a7eeb171bd80d01c73d4a728f31eda444823b4250d3788d09402f6cbca600a6dfc0d48e05c0c74a2746fd68dee230b847acff3ba7d92a2a8bb07
7
- data.tar.gz: b0585f85c576423c12291990521ad7d33a82fc6d1cadf97b009e332bbc8e0a42840b3debb9cd382291115e2282bbaa1f5b18088fa0dd6fde98e8edacc7f90e2b
6
+ metadata.gz: 0015adf0f7e1b5e226866a11cdd658c129853508df5301c9df641fd377e55e9c73271577aca41d4d57178ba67238f9cd39d2fbce82fe6f89052f1977292138c3
7
+ data.tar.gz: d338cf0df9fc344c283aa14cc31e17ebe912e51f49e210ab873941986548c56af72a3acccb0dc259131c12727c5d6957eb535bbad52a11667a399799a5bd2d24
@@ -92,7 +92,7 @@ module Backup
92
92
  end
93
93
 
94
94
  def sudo_option
95
- "#{ utility(:sudo) } -n -u #{ sudo_user } " if sudo_user
95
+ "#{ utility(:sudo) } -n -H -u #{ sudo_user } " if sudo_user
96
96
  end
97
97
 
98
98
  def username_option
@@ -23,6 +23,7 @@ module Backup
23
23
  #
24
24
  # %l - Model label
25
25
  # %t - Model trigger
26
+ # %d - Backup duration (HH:MM:SS)
26
27
  # %s - Status (success/failure/warning)
27
28
  # %v - Status verb (succeeded/failed/succeeded with warnings)
28
29
  #
@@ -73,6 +74,8 @@ module Backup
73
74
  model.label
74
75
  when "t"
75
76
  model.trigger.to_s
77
+ when "d"
78
+ model.duration
76
79
  when "v"
77
80
  status_verb(status)
78
81
  when "s"
@@ -18,6 +18,10 @@ module Backup
18
18
  # Who the notification should appear from
19
19
  attr_accessor :from
20
20
 
21
+ ##
22
+ # Custom server URL
23
+ attr_accessor :server_url
24
+
21
25
  ##
22
26
  # The rooms that should be notified
23
27
  attr_accessor :rooms_notified
@@ -79,7 +83,9 @@ module Backup
79
83
  end
80
84
 
81
85
  def client_options
82
- { api_version: @api_version }
86
+ { api_version: @api_version }.tap do |h|
87
+ h[:server_url] = server_url if server_url
88
+ end
83
89
  end
84
90
 
85
91
  # Hipchat::Client will raise an error if unsuccessful.
@@ -188,9 +188,9 @@ module Backup
188
188
  options =
189
189
  case method
190
190
  when 'smtp'
191
- { :address => @address,
191
+ opts = {
192
+ :address => @address,
192
193
  :port => @port,
193
- :domain => @domain,
194
194
  :user_name => @user_name,
195
195
  :password => @password,
196
196
  :authentication => @authentication,
@@ -199,6 +199,11 @@ module Backup
199
199
  :ssl => @encryption == :ssl,
200
200
  :tls => @encryption == :tls
201
201
  }
202
+
203
+ # Don't override default domain setting if domain not applicable.
204
+ # ref https://github.com/mikel/mail/blob/2.6.3/lib/mail/network/delivery_methods/smtp.rb#L82
205
+ opts[:domain] = @domain if @domain
206
+ opts
202
207
  when 'sendmail'
203
208
  opts = {}
204
209
  opts.merge!(:location => utility(:sendmail))
@@ -21,6 +21,18 @@ module Backup
21
21
  # Receiver Email Address
22
22
  attr_accessor :to
23
23
 
24
+ ##
25
+ # CC receiver Email Address
26
+ attr_accessor :cc
27
+
28
+ ##
29
+ # BCC receiver Email Address
30
+ attr_accessor :bcc
31
+
32
+ ##
33
+ # Set reply to email address
34
+ attr_accessor :reply_to
35
+
24
36
  def initialize(model, &block)
25
37
  super
26
38
  instance_eval(&block) if block_given?
@@ -66,8 +78,13 @@ module Backup
66
78
  # : backup log, if `on_failure` is `true`.
67
79
  #
68
80
  def notify!(status)
69
- email = ::Mail.new(:to => to, :from => from)
70
- email.subject = message.call(model, :status => status_data_for(status))
81
+ email = ::Mail.new
82
+ email.to = to
83
+ email.from = from
84
+ email.cc = cc
85
+ email.bcc = bcc
86
+ email.reply_to = reply_to
87
+ email.subject = message.call(model, :status => status_data_for(status))
71
88
 
72
89
  send_log = send_log_on.include?(status)
73
90
  template = Backup::Template.new({ :model => model, :send_log => send_log })
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Backup
4
- VERSION = '4.3.0'
4
+ VERSION = '4.4.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael van Rooijen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-03 00:00:00.000000000 Z
11
+ date: 2018-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: CFPropertyList
@@ -613,19 +613,19 @@ dependencies:
613
613
  - !ruby/object:Gem::Version
614
614
  version: 2.4.3
615
615
  - !ruby/object:Gem::Dependency
616
- name: mini_portile
616
+ name: mini_portile2
617
617
  requirement: !ruby/object:Gem::Requirement
618
618
  requirements:
619
619
  - - '='
620
620
  - !ruby/object:Gem::Version
621
- version: 0.6.2
621
+ version: 2.3.0
622
622
  type: :runtime
623
623
  prerelease: false
624
624
  version_requirements: !ruby/object:Gem::Requirement
625
625
  requirements:
626
626
  - - '='
627
627
  - !ruby/object:Gem::Version
628
- version: 0.6.2
628
+ version: 2.3.0
629
629
  - !ruby/object:Gem::Dependency
630
630
  name: multi_json
631
631
  requirement: !ruby/object:Gem::Requirement
@@ -730,14 +730,14 @@ dependencies:
730
730
  requirements:
731
731
  - - '='
732
732
  - !ruby/object:Gem::Version
733
- version: 1.6.6.2
733
+ version: 1.8.2
734
734
  type: :runtime
735
735
  prerelease: false
736
736
  version_requirements: !ruby/object:Gem::Requirement
737
737
  requirements:
738
738
  - - '='
739
739
  - !ruby/object:Gem::Version
740
- version: 1.6.6.2
740
+ version: 1.8.2
741
741
  - !ruby/object:Gem::Dependency
742
742
  name: open4
743
743
  requirement: !ruby/object:Gem::Requirement
@@ -1069,9 +1069,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1069
1069
  version: '0'
1070
1070
  requirements: []
1071
1071
  rubyforge_project:
1072
- rubygems_version: 2.5.1
1072
+ rubygems_version: 2.7.6
1073
1073
  signing_key:
1074
1074
  specification_version: 4
1075
1075
  summary: Provides an elegant DSL in Ruby for performing backups on UNIX-like systems.
1076
1076
  test_files: []
1077
- has_rdoc: