| 
									
										
										
										
											2022-10-11 00:52:32 +01:00
										 |  |  | # typed: true | 
					
						
							| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-23 20:59:21 +02:00
										 |  |  | module UnpackStrategy | 
					
						
							| 
									
										
										
										
											2020-08-09 06:09:05 +02:00
										 |  |  |   # Strategy for unpacking uncompressed files. | 
					
						
							| 
									
										
										
										
											2018-07-23 20:59:21 +02:00
										 |  |  |   class Uncompressed | 
					
						
							| 
									
										
										
										
											2020-10-20 12:03:48 +02:00
										 |  |  |     extend T::Sig | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-23 20:59:21 +02:00
										 |  |  |     include UnpackStrategy | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-03 10:32:29 +01:00
										 |  |  |     def extract_nestedly(prioritise_extension: false, **options) | 
					
						
							| 
									
										
										
										
											2018-07-30 22:23:26 +02:00
										 |  |  |       extract(**options) | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2018-07-23 20:59:21 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     private | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-20 12:03:48 +02:00
										 |  |  |     sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).returns(T.untyped) } | 
					
						
							| 
									
										
										
										
											2018-07-23 20:59:21 +02:00
										 |  |  |     def extract_to_dir(unpack_dir, basename:, verbose:) | 
					
						
							|  |  |  |       FileUtils.cp path, unpack_dir/basename, preserve: true, verbose: verbose | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |