| 
									
										
										
										
											2010-09-11 20:22:54 +01:00
										 |  |  | module Homebrew extend self | 
					
						
							|  |  |  |   def log | 
					
						
							|  |  |  |     if ARGV.named.empty? | 
					
						
							| 
									
										
										
										
											2012-08-05 10:34:44 -04:00
										 |  |  |       cd HOMEBREW_REPOSITORY | 
					
						
							| 
									
										
										
										
											2010-09-11 20:22:54 +01:00
										 |  |  |       exec "git", "log", *ARGV.options_only | 
					
						
							|  |  |  |     else | 
					
						
							| 
									
										
										
										
											2013-05-23 09:21:33 -07:00
										 |  |  |       begin | 
					
						
							|  |  |  |         path = ARGV.formulae.first.path.realpath | 
					
						
							|  |  |  |       rescue FormulaUnavailableError | 
					
						
							|  |  |  |         # Maybe the formula was deleted | 
					
						
							|  |  |  |         path = HOMEBREW_REPOSITORY/"Library/Formula/#{ARGV.named.first}.rb" | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2012-08-05 10:34:44 -04:00
										 |  |  |       cd path.dirname # supports taps | 
					
						
							| 
									
										
										
										
											2013-05-23 09:21:33 -07:00
										 |  |  |       exec "git", "log", *ARGV.options_only + ["--", path] | 
					
						
							| 
									
										
										
										
											2010-09-11 20:22:54 +01:00
										 |  |  |     end | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |