backup 3.0.10 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -49,7 +49,7 @@ module Backup
49
49
  def perform!
50
50
  mkdir(archive_path)
51
51
  Logger.message("#{ self.class } started packaging and archiving #{ paths.map { |path| "\"#{path}\""}.join(", ") }.")
52
- run("#{ utility(:tar) } -c #{ paths_to_exclude } #{ paths_to_package } 1> '#{ File.join(archive_path, "#{name}.tar") }' 2> /dev/null")
52
+ run("#{ utility(:tar) } -c -f '#{ File.join(archive_path, "#{name}.tar") }' #{ paths_to_exclude } #{ paths_to_package } 2> /dev/null")
53
53
  end
54
54
 
55
55
  private
@@ -34,14 +34,13 @@ module Backup
34
34
 
35
35
  instance_eval(&block) if block_given?
36
36
 
37
- @path = path.sub(/^\//, '')
38
37
  @time = TIME
39
38
  end
40
39
 
41
40
  ##
42
41
  # This is the remote path to where the backup files will be stored
43
42
  def remote_path
44
- File.join(path, TRIGGER, '/')
43
+ File.join(path, TRIGGER).sub(/^\//, '')
45
44
  end
46
45
 
47
46
  ##
@@ -13,7 +13,7 @@ module Backup
13
13
  # Defines the minor version
14
14
  # PATCH:
15
15
  # Defines the patch version
16
- MAJOR, MINOR, PATCH = 3, 0, 10
16
+ MAJOR, MINOR, PATCH = 3, 0, 11
17
17
 
18
18
  ##
19
19
  # Returns the major version ( big release based off of multiple minor releases )
@@ -64,7 +64,7 @@ describe Backup::Archive do
64
64
  context 'when both paths were added and paths that should be excluded were added' do
65
65
  it 'should render both the syntax for the paths that be included as well as excluded' do
66
66
  archive.expects(:mkdir).with(File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive'))
67
- archive.expects(:run).with("tar -c --exclude={'/home/rspecuser/excludefile','/home/rspecuser/excludedir/'} '/home/rspecuser/somefile' '/home/rspecuser/logs/' '/home/rspecuser/dotfiles/' 1> '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' 2> /dev/null")
67
+ archive.expects(:run).with("tar -c -f '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' --exclude={'/home/rspecuser/excludefile','/home/rspecuser/excludedir/'} '/home/rspecuser/somefile' '/home/rspecuser/logs/' '/home/rspecuser/dotfiles/' 2> /dev/null")
68
68
  archive.expects(:utility).with(:tar).returns(:tar)
69
69
  archive.perform!
70
70
  end
@@ -77,7 +77,7 @@ describe Backup::Archive do
77
77
  end
78
78
 
79
79
  archive.stubs(:utility).returns(:tar)
80
- archive.expects(:run).with("tar -c '/path/to/archive' 1> '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' 2> /dev/null")
80
+ archive.expects(:run).with("tar -c -f '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' '/path/to/archive' 2> /dev/null")
81
81
  archive.perform!
82
82
  end
83
83
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: backup
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 3.0.10
5
+ version: 3.0.11
6
6
  platform: ruby
7
7
  authors:
8
8
  - Michael van Rooijen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-20 00:00:00 +01:00
13
+ date: 2011-03-28 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency