Class: Opsk::Analyze

Inherits:
Thor::Group
  • Object
show all
Includes:
Thorable, Thor::Actions
Defined in:
lib/opskeleton/analyze.rb

Instance Method Summary collapse

Methods included from Thorable

#artifact, #artifact_path, #check_root, included, #machines, #meta, #name, #type_of

Instance Method Details

#reportObject



9
10
11
12
13
14
15
16
# File 'lib/opskeleton/analyze.rb', line 9

def report
	threshold = options['threshold'] || '0.01'
	rs = File.readlines(file).find_all{|line| line.include?('Evaluated')}
	top = rs.collect {|r| r.split(' ').values_at(3 , 7)}.find_all{|r| r[1].to_f > threshold.to_f}
	top.sort_by{|r| r[1].to_f}.reverse.each {|r|
    say("#{r[0]} #{r[1]}")
	}
end