lib/dwc-archive/expander.rb in dwc-archive-0.9.3 vs lib/dwc-archive/expander.rb in dwc-archive-0.9.4

- old
+ new

@@ -1,18 +1,20 @@ class DarwinCore class Expander def initialize(archive_path, tmp_dir) @archive_path = archive_path @tmp_dir = tmp_dir - @path = File.join(tmp_dir, 'dwc_' + rand(10000000000).to_s) + @path = File.join(tmp_dir, 'dwc_' + rand(10_000_000_000).to_s) @unpacker = get_unpacker end def unpack clean raise DarwinCore::FileNotFoundError unless File.exists?(@archive_path) success = @unpacker.call(@path, @archive_path) if @unpacker - (@unpacker && success && $?.exitstatus == 0) ? success : (clean; raise DarwinCore::UnpackingError) + (@unpacker && success && $?.exitstatus == 0) ? + success : + (clean; raise DarwinCore::UnpackingError) end def path @files_path ||= files_path end