| 
									
										
										
										
											2018-01-18 09:47:33 +00:00
										 |  |  | require "formula_support" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class KegOnlyReason | 
					
						
							| 
									
										
										
										
											2018-01-18 20:54:21 +00:00
										 |  |  |   module Compat | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |     def valid? | 
					
						
							| 
									
										
										
										
											2018-01-18 20:54:21 +00:00
										 |  |  |       case @reason | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |       when :provided_pre_mountain_lion | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_pre_mountain_lion" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |         MacOS.version < :mountain_lion | 
					
						
							|  |  |  |       when :provided_pre_mavericks | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_pre_mavericks" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |         MacOS.version < :mavericks | 
					
						
							|  |  |  |       when :provided_pre_el_capitan | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_pre_el_capitan" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |         MacOS.version < :el_capitan | 
					
						
							|  |  |  |       when :provided_pre_high_sierra | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_pre_high_sierra" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |         MacOS.version < :high_sierra | 
					
						
							|  |  |  |       when :provided_until_xcode43 | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_until_xcode43" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |         MacOS::Xcode.version < "4.3" | 
					
						
							|  |  |  |       when :provided_until_xcode5 | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_until_xcode5" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |         MacOS::Xcode.version < "5.0" | 
					
						
							|  |  |  |       else | 
					
						
							|  |  |  |         super | 
					
						
							| 
									
										
										
										
											2018-01-18 20:54:21 +00:00
										 |  |  |       end | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def to_s | 
					
						
							|  |  |  |       case @reason | 
					
						
							|  |  |  |       when :provided_pre_mountain_lion | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_pre_mountain_lion" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         <<~EOS | 
					
						
							|  |  |  |           macOS already provides this software in versions before Mountain Lion | 
					
						
							|  |  |  |         EOS | 
					
						
							|  |  |  |       when :provided_pre_mavericks | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_pre_mavericks" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         <<~EOS | 
					
						
							|  |  |  |           macOS already provides this software in versions before Mavericks | 
					
						
							|  |  |  |         EOS | 
					
						
							|  |  |  |       when :provided_pre_el_capitan | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_pre_el_capitan" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         <<~EOS | 
					
						
							|  |  |  |           macOS already provides this software in versions before El Capitan | 
					
						
							|  |  |  |         EOS | 
					
						
							|  |  |  |       when :provided_pre_high_sierra | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_pre_high_sierra" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         <<~EOS | 
					
						
							|  |  |  |           macOS already provides this software in versions before High Sierra | 
					
						
							|  |  |  |         EOS | 
					
						
							|  |  |  |       when :provided_until_xcode43 | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_until_xcode43" | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         <<~EOS | 
					
						
							|  |  |  |           Xcode provides this software prior to version 4.3
 | 
					
						
							|  |  |  |         EOS | 
					
						
							|  |  |  |       when :provided_until_xcode5 | 
					
						
							| 
									
										
										
										
											2018-07-09 15:29:40 +01:00
										 |  |  |         odisabled "keg_only :provided_until_xcode5" | 
					
						
							| 
									
										
										
										
											2018-01-18 09:47:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-16 22:17:48 +01:00
										 |  |  |         <<~EOS | 
					
						
							|  |  |  |           Xcode provides this software prior to version 5
 | 
					
						
							|  |  |  |         EOS | 
					
						
							|  |  |  |       else | 
					
						
							|  |  |  |         super | 
					
						
							|  |  |  |       end.to_s.strip | 
					
						
							| 
									
										
										
										
											2018-01-18 09:47:33 +00:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							| 
									
										
										
										
											2018-01-18 20:54:21 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   prepend Compat | 
					
						
							| 
									
										
										
										
											2018-01-18 09:47:33 +00:00
										 |  |  | end |