Include FileUtils in AbstractDownloadStrategy

This commit is contained in:
Jack Nagel 2014-12-09 15:55:28 -05:00
parent ddf6f51776
commit e9c368b92e

View File

@ -1,6 +1,8 @@
require 'utils/json' require 'utils/json'
class AbstractDownloadStrategy class AbstractDownloadStrategy
include FileUtils
attr_reader :name, :resource attr_reader :name, :resource
def initialize name, resource def initialize name, resource
@ -204,7 +206,7 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
when :p7zip when :p7zip
safe_system '7zr', 'x', tarball_path safe_system '7zr', 'x', tarball_path
else else
FileUtils.cp tarball_path, basename_without_params cp tarball_path, basename_without_params
end end
end end
@ -301,7 +303,7 @@ end
# Useful for installing jars. # Useful for installing jars.
class NoUnzipCurlDownloadStrategy < CurlDownloadStrategy class NoUnzipCurlDownloadStrategy < CurlDownloadStrategy
def stage def stage
FileUtils.cp tarball_path, basename_without_params cp tarball_path, basename_without_params
end end
end end
@ -599,7 +601,7 @@ end
class CVSDownloadStrategy < VCSDownloadStrategy class CVSDownloadStrategy < VCSDownloadStrategy
def stage def stage
FileUtils.cp_r Dir[cached_location+"{.}"], Dir.pwd cp_r Dir[cached_location+"{.}"], Dir.pwd
end end
private private
@ -692,8 +694,8 @@ class BazaarDownloadStrategy < VCSDownloadStrategy
def stage def stage
# The export command doesn't work on checkouts # The export command doesn't work on checkouts
# See https://bugs.launchpad.net/bzr/+bug/897511 # See https://bugs.launchpad.net/bzr/+bug/897511
FileUtils.cp_r Dir[cached_location+"{.}"], Dir.pwd cp_r Dir[cached_location+"{.}"], Dir.pwd
FileUtils.rm_r ".bzr" rm_r ".bzr"
end end
private private