Skip to content

Commit

Permalink
Release#heuristic_name
Browse files Browse the repository at this point in the history
  • Loading branch information
knoopx committed Jul 10, 2011
1 parent c14b3cd commit 5620fd8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/scene_toolkit/release.rb
Expand Up @@ -29,5 +29,10 @@ def initialize(path)
def files
Dir.glob(File.join(@path, "*"))
end

def heuristic_name
candidates = files.map { |f| File.basename(f, ".*") }.grep(/^00-/)
candidates.group_by { |name| name }.max { |name, occurences| occurences.size }.first.gsub(/^00-/, "")
end
end
end

0 comments on commit 5620fd8

Please sign in to comment.