| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | require "hbc/container/base" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  | module Hbc | 
					
						
							|  |  |  |   class Container | 
					
						
							|  |  |  |     class Naked < Base | 
					
						
							|  |  |  |       # Either inherit from this class and override with self.me?(criteria), | 
					
						
							|  |  |  |       # or use this class directly as "container type: :naked", | 
					
						
							|  |  |  |       # in which case self.me? is not called. | 
					
						
							|  |  |  |       def self.me?(*) | 
					
						
							|  |  |  |         false | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |       def extract | 
					
						
							|  |  |  |         @command.run!("/usr/bin/ditto", args: ["--", @path, @cask.staged_path.join(target_file)]) | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |       def target_file | 
					
						
							|  |  |  |         return @path.basename if @nested | 
					
						
							| 
									
										
										
										
											2017-09-24 20:12:58 +01:00
										 |  |  |         CGI.unescape(File.basename(@cask.url.path)) | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |   end | 
					
						
							|  |  |  | end |