| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  | module Hbc | 
					
						
							|  |  |  |   module Cache | 
					
						
							|  |  |  |     module_function | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |     def ensure_cache_exists | 
					
						
							|  |  |  |       return if Hbc.cache.exist? | 
					
						
							| 
									
										
										
										
											2016-09-20 15:11:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |       odebug "Creating Cache at #{Hbc.cache}" | 
					
						
							|  |  |  |       Hbc.cache.mkpath | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-23 09:49:25 +01:00
										 |  |  |     def delete_legacy_cache | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |       return unless Hbc.legacy_cache.exist? | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-23 09:49:25 +01:00
										 |  |  |       ohai "Deleting legacy cache at #{Hbc.legacy_cache}..." | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |       FileUtils.remove_entry_secure(Hbc.legacy_cache) | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |