mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	Breaking comparsion step out into separate task
This commit is contained in:
		
							
								
								
									
										21
									
								
								Rakefile
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								Rakefile
									
									
									
									
									
								
							| @@ -67,13 +67,8 @@ namespace :benchmark do | |||||||
|     git.branch("tmp_#{reference}").delete |     git.branch("tmp_#{reference}").delete | ||||||
|     git.branch("tmp_#{compare}").delete |     git.branch("tmp_#{compare}").delete | ||||||
|  |  | ||||||
|     # DO COMPARISON... |     # COMPARE AND PRINT RESULTS | ||||||
|     reference_classifications = JSON.parse(File.read("benchmark/results/#{reference}_output.json")) |     Rake::Task["benchmark:results"].execute | ||||||
|  |  | ||||||
|     compare_classifications = JSON.parse(File.read("benchmark/results/#{compare}_output.json")) |  | ||||||
|  |  | ||||||
|     puts "Changes between #{reference}...#{compare}" |  | ||||||
|     puts reference_classifications.deep_diff(compare_classifications) |  | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   desc "Build benchmark index" |   desc "Build benchmark index" | ||||||
| @@ -103,6 +98,18 @@ namespace :benchmark do | |||||||
|  |  | ||||||
|     File.open("benchmark/results/#{args[:commit]}_output.json", "w") {|f| f.write(results.to_json) } |     File.open("benchmark/results/#{args[:commit]}_output.json", "w") {|f| f.write(results.to_json) } | ||||||
|   end |   end | ||||||
|  |  | ||||||
|  |   desc "Compare results" | ||||||
|  |   task :results do | ||||||
|  |     reference, compare = ENV['compare'].split('...') | ||||||
|  |  | ||||||
|  |     # DO COMPARISON... | ||||||
|  |     reference_classifications = JSON.parse(File.read("benchmark/results/#{reference}_output.json")) | ||||||
|  |     compare_classifications = JSON.parse(File.read("benchmark/results/#{compare}_output.json")) | ||||||
|  |  | ||||||
|  |     puts "Changes between #{reference}...#{compare}" | ||||||
|  |     puts reference_classifications.deep_diff(compare_classifications) | ||||||
|  |   end | ||||||
| end | end | ||||||
|  |  | ||||||
| namespace :classifier do | namespace :classifier do | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user