lib/buildmaster/cotta/physical_system.rb in BuildMaster-0.9.0 vs lib/buildmaster/cotta/physical_system.rb in BuildMaster-0.9.1
- old
+ new
@@ -8,13 +8,19 @@
class PhysicalSystem
def initialize
end
def shell(command)
+ puts "$> #{command}"
raise CommandError.new, command, caller unless system(command)
end
+ def shell_output(command)
+ puts "$> #{command}"
+ `#{command}`
+ end
+
def environment!(variable)
value = ENV[variable]
raise "#{variable} environment variable not found" unless value
return value
end
@@ -51,14 +57,22 @@
def delete_dir(dir_path)
return Dir.delete(dir_path)
end
- def copy(source, target)
+ def copy_file(source, target)
FileUtils.copy(source, target)
end
- def move(source, target)
+ def move_file(source, target)
FileUtils.move(source, target)
+ end
+
+ def copy_dir(source, target)
+ FileUtils.copy_entry(source, target)
+ end
+
+ def move_dir(source, target)
+ FileUtils.mv(source, target)
end
end
end
\ No newline at end of file