rdiff-simple 0.0.8 → 0.0.9
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.
data/.travis.yml
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
require 'open3'
|
2
2
|
|
3
3
|
module RdiffSimple
|
4
|
-
|
5
|
-
|
4
|
+
class RdiffBackup
|
5
|
+
attr_reader :output_log
|
6
|
+
|
7
|
+
def execute(*args)
|
6
8
|
raise NotInstalledError, 'rdiff-backup not installed' unless installed?
|
7
9
|
|
8
10
|
command = ['rdiff-backup', args].flatten!.compact.join(' ').strip
|
9
11
|
|
10
|
-
|
11
|
-
STDOUT.write output
|
12
|
+
@output_log, status = Open3.capture2e(command)
|
12
13
|
status == EXIT_CODE[:success]
|
13
14
|
end
|
14
15
|
|
15
|
-
|
16
|
+
private
|
17
|
+
def installed?
|
16
18
|
output, status = Open3.capture2e(COMMANDS[:installed])
|
17
19
|
status == EXIT_CODE[:success]
|
18
20
|
end
|
data/lib/rdiff_simple/version.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe RdiffSimple::RdiffBackup do
|
4
|
+
let(:backup) { RdiffSimple::RdiffBackup.new }
|
5
|
+
|
4
6
|
describe '.execute' do
|
5
7
|
context 'when rdiff-backup is installed' do
|
6
8
|
before do
|
@@ -12,7 +14,7 @@ describe RdiffSimple::RdiffBackup do
|
|
12
14
|
Open3.stub(:capture2e).with(RdiffSimple::COMMANDS[:rdiff]).and_return(['', 1])
|
13
15
|
end
|
14
16
|
|
15
|
-
subject {
|
17
|
+
subject { backup.execute('') }
|
16
18
|
|
17
19
|
it { should be_false }
|
18
20
|
end
|
@@ -22,7 +24,7 @@ describe RdiffSimple::RdiffBackup do
|
|
22
24
|
Open3.stub(:capture2e).with("#{RdiffSimple::COMMANDS[:rdiff]} --version").and_return(['', 0])
|
23
25
|
end
|
24
26
|
|
25
|
-
subject {
|
27
|
+
subject { backup.execute('--version') }
|
26
28
|
|
27
29
|
it { should be_true }
|
28
30
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: rdiff-simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.9
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ryan Hansen
|
@@ -51,7 +51,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
segments:
|
53
53
|
- 0
|
54
|
-
hash:
|
54
|
+
hash: 4306097889160700498
|
55
55
|
version: '0'
|
56
56
|
none: false
|
57
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
segments:
|
62
62
|
- 0
|
63
|
-
hash:
|
63
|
+
hash: 4306097889160700498
|
64
64
|
version: '0'
|
65
65
|
none: false
|
66
66
|
requirements: []
|