From f7ed24f8a895c12710e1c1ab83733a0003de8510 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Sat, 25 Aug 2018 11:49:49 -0400 Subject: [PATCH] abstract confidence threshold --- lib/licensee/matchers/dice.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/licensee/matchers/dice.rb b/lib/licensee/matchers/dice.rb index 12e2959..4472090 100644 --- a/lib/licensee/matchers/dice.rb +++ b/lib/licensee/matchers/dice.rb @@ -43,7 +43,7 @@ module Licensee def matches @matches ||= matches_by_similarity.select do |_, similarity| - similarity >= Licensee.confidence_threshold + similarity >= minimum_confidence end end @@ -51,6 +51,12 @@ module Licensee def confidence @confidence ||= match ? file.similarity(match) : 0 end + + private + + def minimum_confidence + Licensee.confidence_threshold + end end end end