| 
									
										
										
										
											2025-08-21 22:33:29 +08:00
										 |  |  | # typed: strict | 
					
						
							| 
									
										
										
										
											2025-03-18 17:38:37 +00:00
										 |  |  | # frozen_string_literal: true | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-24 21:55:47 +08:00
										 |  |  | require "bundle/brewfile" | 
					
						
							|  |  |  | require "bundle/installer" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-18 17:38:37 +00:00
										 |  |  | module Homebrew | 
					
						
							|  |  |  |   module Bundle | 
					
						
							|  |  |  |     module Commands | 
					
						
							|  |  |  |       module Install | 
					
						
							| 
									
										
										
										
											2025-08-21 22:33:29 +08:00
										 |  |  |         sig { | 
					
						
							|  |  |  |           params( | 
					
						
							|  |  |  |             global:     T::Boolean, | 
					
						
							|  |  |  |             file:       T.nilable(String), | 
					
						
							|  |  |  |             no_lock:    T::Boolean, | 
					
						
							|  |  |  |             no_upgrade: T::Boolean, | 
					
						
							|  |  |  |             verbose:    T::Boolean, | 
					
						
							|  |  |  |             force:      T::Boolean, | 
					
						
							|  |  |  |             quiet:      T::Boolean, | 
					
						
							|  |  |  |           ).void | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-03-21 04:24:55 +00:00
										 |  |  |         def self.run(global: false, file: nil, no_lock: false, no_upgrade: false, verbose: false, force: false, | 
					
						
							|  |  |  |                      quiet: false) | 
					
						
							| 
									
										
										
										
											2025-03-18 17:38:37 +00:00
										 |  |  |           @dsl = Brewfile.read(global:, file:) | 
					
						
							| 
									
										
										
										
											2025-07-14 14:48:08 +01:00
										 |  |  |           Homebrew::Bundle::Installer.install!( | 
					
						
							| 
									
										
										
										
											2025-03-18 17:38:37 +00:00
										 |  |  |             @dsl.entries, | 
					
						
							|  |  |  |             global:, file:, no_lock:, no_upgrade:, verbose:, force:, quiet:, | 
					
						
							|  |  |  |           ) || exit(1) | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-21 22:33:29 +08:00
										 |  |  |         sig { returns(T.nilable(Dsl)) } | 
					
						
							| 
									
										
										
										
											2025-03-21 04:24:55 +00:00
										 |  |  |         def self.dsl | 
					
						
							| 
									
										
										
										
											2025-08-21 22:33:29 +08:00
										 |  |  |           @dsl ||= T.let(nil, T.nilable(Dsl)) | 
					
						
							| 
									
										
										
										
											2025-03-18 17:38:37 +00:00
										 |  |  |           @dsl | 
					
						
							|  |  |  |         end | 
					
						
							|  |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |