| 
									
										
										
										
											2020-10-10 14:16:11 +02:00
										 |  |  | # typed: true | 
					
						
							| 
									
										
										
										
											2019-04-19 15:38:03 +09:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-17 22:42:37 -04:00
										 |  |  | class Failball < Formula | 
					
						
							| 
									
										
										
										
											2020-07-26 07:24:14 +02:00
										 |  |  |   def initialize(name = "failball", path = Pathname.new(__FILE__).expand_path, spec = :stable, | 
					
						
							|  |  |  |                  alias_path: nil, force_bottle: false) | 
					
						
							| 
									
										
										
										
											2018-08-17 22:42:37 -04:00
										 |  |  |     super | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-24 23:52:40 +01:00
										 |  |  |   DSL_PROC = proc do | 
					
						
							|  |  |  |     url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" | 
					
						
							|  |  |  |     sha256 TESTBALL_SHA256 | 
					
						
							|  |  |  |   end.freeze | 
					
						
							|  |  |  |   private_constant :DSL_PROC | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   DSL_PROC.call | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def self.inherited(other) | 
					
						
							|  |  |  |     super | 
					
						
							|  |  |  |     other.instance_eval(&DSL_PROC) | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-17 22:42:37 -04:00
										 |  |  |   def install | 
					
						
							|  |  |  |     prefix.install "bin" | 
					
						
							|  |  |  |     prefix.install "libexec" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # This should get marshalled into a BuildError. | 
					
						
							|  |  |  |     system "/usr/bin/false" if ENV["FAILBALL_BUILD_ERROR"] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # This should get marshalled into a RuntimeError. | 
					
						
							| 
									
										
										
										
											2020-07-29 17:31:11 -04:00
										 |  |  |     raise "Something that isn't a build error happened!" | 
					
						
							| 
									
										
										
										
											2018-08-17 22:42:37 -04:00
										 |  |  |   end | 
					
						
							|  |  |  | end |