| 
									
										
										
										
											2019-05-24 21:36:48 -03:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SoftwareSpec | 
					
						
							| 
									
										
										
										
											2019-05-26 00:17:40 -03:00
										 |  |  |   undef uses_from_macos | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-28 14:17:54 +01:00
										 |  |  |   def uses_from_macos(deps, bounds = {}) | 
					
						
							| 
									
										
										
										
											2019-09-17 18:10:02 -04:00
										 |  |  |     @uses_from_macos_elements ||= [] | 
					
						
							| 
									
										
										
										
											2020-04-28 14:17:54 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     if deps.is_a?(Hash) | 
					
						
							|  |  |  |       bounds = deps.dup | 
					
						
							|  |  |  |       deps = Hash[*bounds.shift] | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-04 17:16:39 +01:00
										 |  |  |     bounds = bounds.transform_values { |v| MacOS::Version.from_symbol(v) } | 
					
						
							| 
									
										
										
										
											2020-04-28 14:17:54 +01:00
										 |  |  |     if MacOS.version >= bounds[:since] | 
					
						
							|  |  |  |       @uses_from_macos_elements << deps | 
					
						
							|  |  |  |     else | 
					
						
							|  |  |  |       depends_on deps | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2019-05-24 21:36:48 -03:00
										 |  |  |   end | 
					
						
							|  |  |  | end |