raz 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/bin/raz +2 -1
- data/lib/raz/restorer.rb +6 -3
- data/lib/raz/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9441986fd2b7ac386917326d6d7fe60d4e7700d0
|
4
|
+
data.tar.gz: 5fe9b1c609e412ff3165ed6e61fc376d3100ab35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1c1be3c9745d8d1279e16bb58dee1394fd5a0f004dacf01fd5d9491a3479218fa86994ad027ee3d853be2b531d8b486125f005336bacae72cb55d579a7145e6
|
7
|
+
data.tar.gz: abf4337d6a92a599ccb5d43d6ea6cc13d277d86b393a7d953ad3dd639376b92100bce9be7c4df7f177aaee887426a063333d007b1e1d1bddde727d20ce6c60d0
|
data/bin/raz
CHANGED
@@ -9,11 +9,12 @@ require 'gli'
|
|
9
9
|
include GLI::App
|
10
10
|
|
11
11
|
program_desc 'Tool to backup and restore files.'
|
12
|
+
version Raz::VERSION
|
12
13
|
|
13
14
|
|
14
15
|
on_error do |e|
|
15
16
|
$stderr.puts "#{e.message}".red
|
16
|
-
$stderr.puts "#{e.
|
17
|
+
$stderr.puts " from #{e.backtrace.join("\n from ")}".red unless e.is_a?(OptionParser::ParseError)
|
17
18
|
end
|
18
19
|
|
19
20
|
|
data/lib/raz/restorer.rb
CHANGED
@@ -39,11 +39,12 @@ module Raz
|
|
39
39
|
|
40
40
|
if File.directory?(dest)
|
41
41
|
FileOperations.dir_entries(src).each do |item|
|
42
|
-
puts "Restoring file to #{File.join(
|
43
|
-
FileOperations.copy_item(File.join(src, item),
|
42
|
+
puts "Restoring file to #{File.join(dest, item)}".green
|
43
|
+
FileOperations.copy_item(File.join(src, item), dest)
|
44
44
|
end
|
45
45
|
else
|
46
46
|
FileUtils.rmtree(dest) if File.exist?(dest)
|
47
|
+
FileUtils.mkdir_p(File.dirname(dest))
|
47
48
|
|
48
49
|
puts "Restoring item to #{dest}".green
|
49
50
|
FileOperations.copy_item(src, dest)
|
@@ -51,7 +52,9 @@ module Raz
|
|
51
52
|
end
|
52
53
|
|
53
54
|
# restore config file to previous location
|
54
|
-
|
55
|
+
orig_config_path = destination_path_from_original(@info[:orig_config_path])
|
56
|
+
FileUtils.mkdir_p(File.dirname(orig_config_path))
|
57
|
+
FileOperations.copy_item(config.path, orig_config_path)
|
55
58
|
|
56
59
|
# run after procs
|
57
60
|
(config.procs[:after_restore] || []).each do |proc|
|
data/lib/raz/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Kříž
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|