| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | require "tmpdir" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | require "hbc/container/base" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Hbc::Container::Gzip < Hbc::Container::Base | 
					
						
							|  |  |  |   def self.me?(criteria) | 
					
						
							|  |  |  |     criteria.magic_number(%r{^\037\213}n) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def extract | 
					
						
							|  |  |  |     Dir.mktmpdir do |unpack_dir| | 
					
						
							|  |  |  |       @command.run!("/usr/bin/ditto",  args: ["--", @path, unpack_dir]) | 
					
						
							| 
									
										
										
										
											2016-08-23 02:36:21 +02:00
										 |  |  |       @command.run!("/usr/bin/gunzip", args: ["--quiet", "--name", "--", Pathname.new(unpack_dir).join(@path.basename)]) | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  |       extract_nested_inside(unpack_dir) | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |