diff --git a/lib/scene_toolkit/release.rb b/lib/scene_toolkit/release.rb index 546a13b..a5671eb 100644 --- a/lib/scene_toolkit/release.rb +++ b/lib/scene_toolkit/release.rb @@ -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 \ No newline at end of file