Module: Depcheck::SimpleOutput

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

Class Method Summary collapse

Class Method Details

.post(objs, verbose) ⇒ Object



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

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

  objs.each_with_index do |obj, index|
    print "#{index + 1}. #{obj.name} - #{obj.dependencies.size}"
    print " - [#{obj.dependencies.join(', ')}]" if verbose
    print "\n"
  end
end

.post_usage(objs) ⇒ Object



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

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