| 
									
										
										
										
											2024-07-14 16:18:26 -04:00
										 |  |  | # Documentation defined in Library/Homebrew/cmd/setup-ruby.rb | 
					
						
							| 
									
										
										
										
											2023-10-27 09:27:56 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-02 10:33:42 +01:00
										 |  |  | # HOMEBREW_LIBRARY is set by brew.sh | 
					
						
							| 
									
										
										
										
											2023-10-27 09:27:56 +01:00
										 |  |  | # HOMEBREW_BREW_FILE is set by extend/ENV/super.rb | 
					
						
							|  |  |  | # shellcheck disable=SC2154 | 
					
						
							|  |  |  | homebrew-setup-ruby() { | 
					
						
							| 
									
										
										
										
											2024-06-14 02:26:16 +01:00
										 |  |  |   source "${HOMEBREW_LIBRARY}/Homebrew/utils/helpers.sh" | 
					
						
							| 
									
										
										
										
											2023-10-27 09:27:56 +01:00
										 |  |  |   source "${HOMEBREW_LIBRARY}/Homebrew/utils/ruby.sh" | 
					
						
							|  |  |  |   setup-ruby-path | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-30 12:06:16 +01:00
										 |  |  |   if [[ -z "${HOMEBREW_DEVELOPER}" ]] | 
					
						
							| 
									
										
										
										
											2023-10-27 09:27:56 +01:00
										 |  |  |   then | 
					
						
							|  |  |  |     return | 
					
						
							|  |  |  |   fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-30 12:06:16 +01:00
										 |  |  |   # Avoid running Bundler if the command doesn't need it. | 
					
						
							|  |  |  |   local command="$1" | 
					
						
							|  |  |  |   if [[ -n "${command}" ]] | 
					
						
							|  |  |  |   then | 
					
						
							|  |  |  |     source "${HOMEBREW_LIBRARY}/Homebrew/command_path.sh" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     command_path="$(homebrew-command-path "${command}")" | 
					
						
							| 
									
										
										
										
											2024-06-03 13:35:37 +01:00
										 |  |  |     if [[ -n "${command_path}" ]] | 
					
						
							| 
									
										
										
										
											2024-04-30 12:06:16 +01:00
										 |  |  |     then | 
					
						
							| 
									
										
										
										
											2024-06-03 13:35:37 +01:00
										 |  |  |       if [[ "${command_path}" != *"/dev-cmd/"* ]] | 
					
						
							|  |  |  |       then | 
					
						
							|  |  |  |         return | 
					
						
							|  |  |  |       elif ! grep -q "Homebrew.install_bundler_gems\!" "${command_path}" | 
					
						
							|  |  |  |       then | 
					
						
							|  |  |  |         return | 
					
						
							|  |  |  |       fi | 
					
						
							| 
									
										
										
										
											2024-04-30 12:06:16 +01:00
										 |  |  |     fi | 
					
						
							|  |  |  |   fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-02 10:33:42 +01:00
										 |  |  |   setup-gem-home-bundle-gemfile | 
					
						
							| 
									
										
										
										
											2023-10-27 09:27:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |   if ! bundle check &>/dev/null | 
					
						
							|  |  |  |   then | 
					
						
							|  |  |  |     "${HOMEBREW_BREW_FILE}" install-bundler-gems | 
					
						
							|  |  |  |   fi | 
					
						
							|  |  |  | } |