rdiff-simple 0.1.1 → 0.1.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c825887d493c7851822dffc3b6bfa3a43a154de
|
4
|
+
data.tar.gz: 70a97690e5c7269f0ecd545c7f79cf83e1488208
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3fec5ba89ca40b6feb9410b3115f880e0fc2d7674c27dfbe8593aa122fb4e12d241dd31bb4d4fce5319f16b2976688e422deb33409385dc9d2a400edebd3b9a
|
7
|
+
data.tar.gz: 6696fcfa338d681185b0abbac97e252137c8375bfd94453ccf4c8c7af7eb6bb2cb5eec9507271abc36d9267207c854574c0f707d49708c79e0e114ba7b9c0d63
|
@@ -1,11 +1,10 @@
|
|
1
1
|
module RdiffSimple
|
2
2
|
class RdiffBackup
|
3
|
-
attr_accessor :logger
|
3
|
+
attr_accessor :logger
|
4
4
|
|
5
5
|
def initialize
|
6
6
|
yield self if block_given?
|
7
7
|
|
8
|
-
@open3 ||= Open3
|
9
8
|
@logger ||= Logger.new(STDOUT)
|
10
9
|
end
|
11
10
|
|
@@ -24,7 +23,7 @@ module RdiffSimple
|
|
24
23
|
|
25
24
|
private
|
26
25
|
def execute(command)
|
27
|
-
output, error, result =
|
26
|
+
output, error, result = Open3.capture3 "rdiff-backup #{command}"
|
28
27
|
|
29
28
|
logger.info output unless output.empty?
|
30
29
|
logger.error error unless error.empty?
|
data/lib/rdiff_simple/version.rb
CHANGED
@@ -4,17 +4,15 @@ describe RdiffSimple::RdiffBackup do
|
|
4
4
|
let(:source) { '~/Documents' }
|
5
5
|
let(:destination) { '~/Test' }
|
6
6
|
let(:status) { double('status', exitstatus: Random.rand(100)) }
|
7
|
-
let(:open3) { double('open3') }
|
8
7
|
let(:file) { StringIO.new }
|
9
8
|
let(:rdiff) do
|
10
9
|
RdiffSimple::RdiffBackup.new do |r|
|
11
10
|
r.logger = Logger.new file
|
12
|
-
r.open3 = open3
|
13
11
|
end
|
14
12
|
end
|
15
13
|
|
16
14
|
before do
|
17
|
-
|
15
|
+
Open3.stub(:capture3).with(args) { ['output', 'error', status] }
|
18
16
|
end
|
19
17
|
|
20
18
|
shared_examples "a command" do
|