diff --git a/bin/bugspots b/bin/bugspots index 58a5b97..7709e57 100755 --- a/bin/bugspots +++ b/bin/bugspots @@ -5,6 +5,7 @@ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib) require 'bugspots' require 'optparse' +require 'rainbow' require 'rainbow/ext/string' ARGV << '--help' if ARGV.empty? diff --git a/lib/bugspots/scanner.rb b/lib/bugspots/scanner.rb index 5c65113..ce94650 100644 --- a/lib/bugspots/scanner.rb +++ b/lib/bugspots/scanner.rb @@ -1,4 +1,3 @@ -require 'rainbow' require 'grit' module Bugspots @@ -19,7 +18,7 @@ def self.scan(repo, branch = "master", depth = 500, regex = nil) commit_list = repo.git.rev_list({:max_count => false, :no_merges => true, :pretty => "raw", :timeout => false}, branch) Grit::Commit.list_from_string(repo, commit_list).each do |commit| if commit.message =~ regex - files = commit.stats.files.map {|s| s.first}.select{ |s| tree/s } + files = commit.stats.files.map {|s| s.first}.select{ |s| tree/s } fixes << Fix.new(commit.short_message, commit.date, files) end end