Small change on the "tar"-call (usage of the "-f" parm). #93

Merged
merged 1 commit into from Mar 28, 2011
View
2 lib/backup/model.rb
@@ -240,7 +240,7 @@ def perform!
# becomes a single (transferrable) packaged file.
def package!
Logger.message "Backup started packaging everything to a single archive file."
- run("#{ utility(:tar) } -c -C '#{ TMP_PATH }' '#{ TRIGGER }' > '#{ File.join(TMP_PATH, "#{TIME}.#{TRIGGER}.tar") }'")
+ run(%|#{ utility(:tar) } -c -f '#{ File.join(TMP_PATH, "#{TIME}.#{TRIGGER}.tar") }' -C '#{ TMP_PATH }' '#{ TRIGGER }'|)
end
##
View
2 spec/model_spec.rb
@@ -205,7 +205,7 @@ def initialize(&block); end
it 'should package the folder' do
model.expects(:utility).with(:tar).returns(:tar)
- model.expects(:run).with("tar -c -C '#{ Backup::TMP_PATH }' '#{ Backup::TRIGGER }' > '#{ File.join( Backup::TMP_PATH, "#{ Backup::TIME }.#{ Backup::TRIGGER }.tar" ) }'")
+ model.expects(:run).with(%|tar -c -f '#{ File.join( Backup::TMP_PATH, "#{ Backup::TIME }.#{ Backup::TRIGGER }.tar" ) }' -C '#{ Backup::TMP_PATH }' '#{ Backup::TRIGGER }'|)
model.send(:package!)
end