foreman_maintain 0.5.4 → 0.5.5

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: a02a8286e3a97afd09de77b81a1260acb7edc663286246a4c76accbdf757b68a
4
- data.tar.gz: 9183a00e78f5162c1ec95630a22cb63a15efeeeb1fb9cf85952bee132e4c5429
3
+ metadata.gz: 88713e93aedca954a3162bfcb296a4e34702d3d5ffa4378b6f913081a5377e2c
4
+ data.tar.gz: 561a9cf651b6a8676efe9471eb2cde54e30cec37cf37f311f59ee7a886f44642
5
5
  SHA512:
6
- metadata.gz: f90ebbd29ab01bf012bdbdd9fc9dee52fcc2812f20853909d8dea0ba5a30ee8b655a67d2b43b8055272447aedfbcbdc82b52d6464334c22ac5f5d17392c50e5d
7
- data.tar.gz: 1f9147fc144ba7b261bcee85475134d07f1ef5f3d1de9bc5c287d5044499d043fe139c700163122311f36dfd461b73d6b28dec26b7f31281a4bfa992cb4ee795
6
+ metadata.gz: 0d0d4a7cbdad45bcfd35be8029fa7be9b458b72df62a9e83a72ffdd1e3b049fcff2ba72b2368531f2a40a40ac6578381fe57a91ef8abbcd7edd63908b9759071
7
+ data.tar.gz: 4635df0f060dd06372cb9ff77cbc6f0ac8756dbd4b7814f47e27444e4e1d480b648b5175391f4c337e1dd3934a5b077d5db4caa22b74b4c085ac66c9ba81dba9
@@ -8,6 +8,7 @@ module Procedures::Backup
8
8
  param :incremental_dir, 'Changes since specified backup only'
9
9
  end
10
10
 
11
+ # rubocop:disable Metrics/MethodLength
11
12
  def run
12
13
  puts "Creating backup folder #{@backup_dir}"
13
14
 
@@ -22,8 +23,14 @@ module Procedures::Backup
22
23
 
23
24
  FileUtils.rm(Dir.glob(File.join(@backup_dir, '.*.snar'))) if @preserve_dir
24
25
  if @incremental_dir
25
- FileUtils.cp(Dir.glob(File.join(@incremental_dir, '.*.snar')), @backup_dir)
26
+ if (snar_files = Dir.glob(File.join(@incremental_dir, '.*.snar'))).empty?
27
+ raise "#{@incremental_dir}/*.snar files unavailable. "\
28
+ 'Provide a valid previous backup directory'
29
+ else
30
+ FileUtils.cp(snar_files, @backup_dir)
31
+ end
26
32
  end
27
33
  end
34
+ # rubocop:enable Metrics/MethodLength
28
35
  end
29
36
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '0.5.4'.freeze
2
+ VERSION = '0.5.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_maintain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-14 00:00:00.000000000 Z
11
+ date: 2020-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -378,7 +378,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
378
378
  - !ruby/object:Gem::Version
379
379
  version: '0'
380
380
  requirements: []
381
- rubygems_version: 3.0.8
381
+ rubygems_version: 3.0.3
382
382
  signing_key:
383
383
  specification_version: 4
384
384
  summary: Foreman maintenance tool belt