Module: Depcheck::SimpleOutput

Defined in:
lib/depcheck/output/simple_output.rb

Class Method Summary collapse

Class Method Details

.post(objs) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/depcheck/output/simple_output.rb', line 4

def self.post(objs)
  objs = objs.sort_by { |obj| obj.dependencies.size }.reverse

  objs.each_with_index do |obj, index|
    puts "#{index + 1}. #{obj.name} - #{obj.dependencies.size} \n"
  end
end

.post_usage(objs) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/depcheck/output/simple_output.rb', line 12

def self.post_usage(objs)
  objs = objs.sort_by(&:usage).reverse

  objs.each_with_index do |obj, index|
    puts "#{index + 1}. #{obj.name} - #{obj.usage} \n"
  end
end