| 
									
										
										
										
											2014-05-28 16:23:33 -05:00
										 |  |  | require "formula_versions" | 
					
						
							| 
									
										
										
										
											2010-10-27 10:03:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-18 22:41:47 -05:00
										 |  |  | module Homebrew | 
					
						
							| 
									
										
										
										
											2011-08-02 12:30:04 +01:00
										 |  |  |   def versions | 
					
						
							| 
									
										
										
										
											2012-05-07 20:32:04 -05:00
										 |  |  |     raise "Please `brew install git` first" unless which "git" | 
					
						
							| 
									
										
										
										
											2014-05-28 16:23:33 -05:00
										 |  |  |     raise "Please `brew update` first" unless (HOMEBREW_REPOSITORY/".git").directory? | 
					
						
							| 
									
										
										
										
											2012-02-04 00:01:29 -06:00
										 |  |  |     raise FormulaUnspecifiedError if ARGV.named.empty? | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-12 17:32:05 +00:00
										 |  |  |     opoo <<-EOS.undent
 | 
					
						
							|  |  |  |       brew-versions is unsupported and may be removed soon. | 
					
						
							|  |  |  |       Please use the homebrew-versions tap instead: | 
					
						
							|  |  |  |         https://github.com/Homebrew/homebrew-versions | 
					
						
							|  |  |  |     EOS | 
					
						
							| 
									
										
										
										
											2014-06-19 19:14:06 -05:00
										 |  |  |     ARGV.formulae.each do |f| | 
					
						
							| 
									
										
										
										
											2014-05-28 16:23:33 -05:00
										 |  |  |       versions = FormulaVersions.new(f) | 
					
						
							|  |  |  |       path = versions.repository_path | 
					
						
							|  |  |  |       versions.each do |version, rev| | 
					
						
							|  |  |  |         print "#{Tty.white}#{version.to_s.ljust(8)}#{Tty.reset} " | 
					
						
							|  |  |  |         puts "git checkout #{rev} #{path}" | 
					
						
							| 
									
										
										
										
											2010-10-27 10:03:30 +02:00
										 |  |  |       end | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2011-08-02 12:30:04 +01:00
										 |  |  |   end | 
					
						
							|  |  |  | end |