rsyncbackup 2.0.1 → 2.0.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6005b2502d88e96b50eeaf78ca1a44b16faf4bf8
|
4
|
+
data.tar.gz: 543789938c94f4650acdb096623a7308169ca082
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2edb9f263195660fee96ee25ce51738f37a6f4e12cee39fb241ec04c9b0d23a25ddeecc645aecc2ccfb2743108afb36801ee0880e832433b48694b1e97fc1a86
|
7
|
+
data.tar.gz: 0c063e820b653a58d64c32bbce898439cb876a3ce01cb9c0cd7d17bd8a1a4abd1e6970a613a9143ea717af5a83f85b88379019909d6faea6f6418b7b002a0713
|
@@ -89,7 +89,12 @@ class Rsyncbackup
|
|
89
89
|
# *s*:: string to strip
|
90
90
|
def strip_trailing_separator_if_any(s,keep_if_symlink=false)
|
91
91
|
s = s.to_s
|
92
|
-
|
92
|
+
s_s = s.sub(%r{#{File::SEPARATOR}+$},'')
|
93
|
+
unless keep_if_symlink
|
94
|
+
s_s
|
95
|
+
else
|
96
|
+
File.symlink?(s_s) ? s : s_s
|
97
|
+
end
|
93
98
|
end
|
94
99
|
|
95
100
|
end
|
data/lib/rsyncbackup/version.rb
CHANGED
@@ -26,7 +26,7 @@ describe Rsyncbackup do
|
|
26
26
|
end
|
27
27
|
|
28
28
|
context "utilities" do
|
29
|
-
let(:syncer) { Rsyncbackup.new(source, target, :dry_run => true
|
29
|
+
let(:syncer) { Rsyncbackup.new(source, target, :dry_run => true) }
|
30
30
|
|
31
31
|
context "#build_command" do
|
32
32
|
|
@@ -92,11 +92,34 @@ describe Rsyncbackup do
|
|
92
92
|
syncer.strip_trailing_separator_if_any('source/',true).should == 'source'
|
93
93
|
end
|
94
94
|
|
95
|
-
|
96
|
-
source_link
|
97
|
-
|
95
|
+
context "when a symlink" do
|
96
|
+
let(:source_link) do
|
97
|
+
tmpfile = Tempfile.new("sourcelink")
|
98
|
+
path = tmpfile.path
|
99
|
+
tmpfile.close
|
100
|
+
tmpfile.unlink
|
101
|
+
path
|
102
|
+
end
|
103
|
+
|
104
|
+
let(:source_link_slash) {source_link + File::SEPARATOR}
|
105
|
+
|
106
|
+
|
107
|
+
before do
|
108
|
+
File.symlink(source,source_link)
|
109
|
+
end
|
110
|
+
|
111
|
+
after do
|
112
|
+
File.unlink(source_link)
|
113
|
+
end
|
114
|
+
|
115
|
+
it "should not remove trailing slash from source if source is a symlink" do
|
116
|
+
syncer.strip_trailing_separator_if_any(source_link_slash,true).should == source_link_slash
|
117
|
+
end
|
118
|
+
|
119
|
+
|
98
120
|
end
|
99
121
|
|
122
|
+
|
100
123
|
it "should remove trailing slash from target" do
|
101
124
|
syncer.strip_trailing_separator_if_any('target/').should == 'target'
|
102
125
|
end
|
data/spec/rsyncbackup_spec.rb
CHANGED
@@ -32,7 +32,7 @@ describe Rsyncbackup do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
context "Options Validity" do
|
35
|
-
let(:syncer) { Rsyncbackup.new(source, target, :dry_run => true
|
35
|
+
let(:syncer) { Rsyncbackup.new(source, target, :dry_run => true) }
|
36
36
|
|
37
37
|
it "has a command" do
|
38
38
|
syncer.options[:rsync_cmd].should =~ /rsync/
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsyncbackup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tamara Temple
|
@@ -156,9 +156,9 @@ files:
|
|
156
156
|
- lib/rsyncbackup/utilities.rb
|
157
157
|
- lib/rsyncbackup/version.rb
|
158
158
|
- rsyncbackup.gemspec
|
159
|
+
- spec/rsyncbackup/utilities_spec.rb
|
159
160
|
- spec/rsyncbackup_spec.rb
|
160
161
|
- spec/spec_helper.rb
|
161
|
-
- spec/utilities_spec.rb
|
162
162
|
homepage: http://github.com/tamouse/rsyncbackup-rb
|
163
163
|
licenses: []
|
164
164
|
metadata: {}
|
@@ -196,6 +196,6 @@ test_files:
|
|
196
196
|
- features/test_files/source/three
|
197
197
|
- features/test_files/source/two
|
198
198
|
- features/test_files/target/.gitignore
|
199
|
+
- spec/rsyncbackup/utilities_spec.rb
|
199
200
|
- spec/rsyncbackup_spec.rb
|
200
201
|
- spec/spec_helper.rb
|
201
|
-
- spec/utilities_spec.rb
|