Class: AppDetectionAnalysis
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- AppDetectionAnalysis
- Defined in:
- app/models/app_detection_analysis.rb
Overview
typed: false
Instance Method Summary collapse
Instance Method Details
#compute_confidence ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/models/app_detection_analysis.rb', line 8 def compute_confidence path = EziiOsPath.new(self.jester_os_global_path) self.confidence = 0 if File.directory?(path.to_s) && Dir.entries(path.to_s).include?('app') && (Set.new(Dir.entries(File.join(path.to_s, 'app'))) & Set.new(['controllers', 'models'])).count == 2 self.confidence += 0.91 end rescue Errno::EACCES self.confidence = 0 end |