Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Removed 2> /dev/null for the tar utility since we're using the PO…
…pen4 library now. STDOUT is already being silenced from the Backup::Logger thanks to POpen4. `2> /dev/null` caused the STDERR to be silenced when an exception occurred, so users had a hard time figuring out what the problem was. This has now been fixed.
  • Loading branch information
Michael van Rooijen committed Oct 27, 2011
1 parent 57cc6b3 commit e0de11f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/backup/archive.rb
Expand Up @@ -50,7 +50,7 @@ def perform!
mkdir(archive_path)

Logger.message("#{ self.class } started packaging and archiving #{ paths.map { |path| "\"#{path}\""}.join(", ") }.")
run("#{ utility(:tar) } -c -f '#{ File.join(archive_path, "#{name}.tar") }' #{ paths_to_exclude } #{ paths_to_package } 2> /dev/null")
run("#{ utility(:tar) } -c -f '#{ File.join(archive_path, "#{name}.tar") }' #{ paths_to_exclude } #{ paths_to_package }")
end

private
Expand Down
4 changes: 2 additions & 2 deletions spec/archive_spec.rb
Expand Up @@ -63,7 +63,7 @@
context 'when both paths were added and paths that should be excluded were added' do
it 'should render both the syntax for the paths that be included as well as excluded' do
archive.expects(:mkdir).with(File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive'))
archive.expects(:run).with("tar -c -f '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' --exclude='/home/rspecuser/badfile' --exclude='/home/rspecuser/wrongdir' '/home/rspecuser/somefile' '/home/rspecuser/logs' '/home/rspecuser/dotfiles' 2> /dev/null")
archive.expects(:run).with("tar -c -f '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' --exclude='/home/rspecuser/badfile' --exclude='/home/rspecuser/wrongdir' '/home/rspecuser/somefile' '/home/rspecuser/logs' '/home/rspecuser/dotfiles'")
archive.expects(:utility).with(:tar).returns(:tar)
archive.perform!
end
Expand All @@ -76,7 +76,7 @@
end

archive.stubs(:utility).returns(:tar)
archive.expects(:run).with("tar -c -f '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' '/path/to/archive' 2> /dev/null")
archive.expects(:run).with("tar -c -f '#{File.join(Backup::TMP_PATH, Backup::TRIGGER, 'archive', "#{:dummy_archive}.tar")}' '/path/to/archive'")
archive.perform!
end
end
Expand Down

0 comments on commit e0de11f

Please sign in to comment.