Method: AliasManager.run

Defined in:
lib/alias_manager.rb

.runObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/alias_manager.rb', line 6

def self.run
  commands_by_counts = LogLine.counts

  unused_aliases = Alias.all.select do |aliaz|
    commands_by_counts[aliaz.abbreviation] == nil
  end

  puts "You have never used these aliases in the past #{LogLine.all.count} commands:"
  puts unused_aliases.map(&:string)

  puts "You should remove them from your zshrc."

  used_once_aliases = Alias.all.select do |aliaz|
    commands_by_counts[aliaz.abbreviation] == 1
  end

  3.times { puts '' }
  puts "You have used these aliases only once in the past #{LogLine.all.count} commands:"
  puts used_once_aliases.map(&:string)
  puts "You should use them more, or consider removing them from your zshrc."
end