Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

187 compatibility #2

Merged
merged 2 commits into from Dec 15, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/bugspots
Expand Up @@ -11,12 +11,12 @@ ARGV << '--help' if ARGV.empty?
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: bugspots /path/to/git/repo"

# Option: Set Depth
opts.on('-d', '--depth [depth]', 'depth of log crawl (integer)') do |d|
options[:depth] = d.to_i
end

# Option: Set Timestamp Display
opts.on('--display-timestamps', 'show timestamps of each identified fix commit') do |dt|
options[:display_timestamps] = true
Expand Down
8 changes: 4 additions & 4 deletions lib/bugspots/scanner.rb
Expand Up @@ -9,9 +9,9 @@ def self.scan(repo, depth = 500)
repo = Grit::Repo.new(repo)
fixes = []

repo.commits('master', depth).each do |commit|
repo.commits('master', depth).each do |commit|
if commit.message =~ /fix(es|ed)|close(s|d)/
files = commit.stats.files.map {|s| s.first}
files = commit.stats.files.map {|s| s.first}
fixes << Fix.new(commit.short_message, commit.date, files)
end
end
Expand All @@ -25,9 +25,9 @@ def self.scan(repo, depth = 500)
end

spots = hotspots.sort_by {|k,v| v}.reverse.collect do |spot|
Spot.new(spot.first, spot.last.round(4))
Spot.new(spot.first, sprintf('%.4f', spot.last))
end

return fixes, spots
end
end
end