| 
									
										
										
										
											2015-01-02 13:36:26 +00:00
										 |  |  | module Homebrew | 
					
						
							|  |  |  |   def style | 
					
						
							|  |  |  |     target = if ARGV.named.empty? | 
					
						
							|  |  |  |       [HOMEBREW_LIBRARY] | 
					
						
							| 
									
										
										
										
											2015-08-06 15:39:08 +08:00
										 |  |  |     elsif ARGV.named.any? { |file| File.exist? file } | 
					
						
							|  |  |  |       ARGV.named | 
					
						
							| 
									
										
										
										
											2015-01-02 13:36:26 +00:00
										 |  |  |     else | 
					
						
							|  |  |  |       ARGV.formulae.map(&:path) | 
					
						
							|  |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-06 15:40:19 +08:00
										 |  |  |     Homebrew.install_gem_setup_path! "rubocop", "0.33.0" | 
					
						
							| 
									
										
										
										
											2015-01-02 13:36:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-13 11:09:32 +01:00
										 |  |  |     args = [ | 
					
						
							| 
									
										
										
										
											2015-08-02 14:56:01 +01:00
										 |  |  |       "--format", "simple", "--force-exclusion", "--config", | 
					
						
							| 
									
										
										
										
											2015-03-13 11:09:32 +01:00
										 |  |  |       "#{HOMEBREW_LIBRARY}/.rubocop.yml" | 
					
						
							|  |  |  |     ] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     args << "--auto-correct" if ARGV.homebrew_developer? && ARGV.flag?("--fix") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     args += target | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     system "rubocop", *args | 
					
						
							| 
									
										
										
										
											2015-01-02 13:36:26 +00:00
										 |  |  |     Homebrew.failed = !$?.success? | 
					
						
							|  |  |  |   end | 
					
						
							|  |  |  | end |