12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/escoffier/smepable.rb', line 12
def prep_mise(input_entry, output_directory = Dir.mktmpdir, &block)
FileUtils.mkdir_p(output_directory) unless File.exist?(output_directory)
$LOG.info "Copying #{input_entry} to #{output_directory}"
verbose = $LOG.level <= Logger::DEBUG
source = input_entry
FileUtils.cp_r(source, output_directory, :verbose => verbose)
$LOG.info "Unzipping #{output_directory}"
unzip(output_directory, :recursive => true)
if block
begin
yield output_directory
ensure
File.delete(output_directory)
end
else
return output_directory
end
end
|