class AliasManager::LogLine

Public Class Methods

all() click to toggle source
# File lib/alias_manager/log_line.rb, line 3
def self.all
  logs = File.readlines("#{ENV['HOME']}/.zsh_history")

  logs.map do |log_line|
    log_line.force_encoding("iso-8859-1").split(";").last.chomp.split(" ").first
  end
end
counts() click to toggle source
# File lib/alias_manager/log_line.rb, line 11
def self.counts
  all.group_by { |command| command }.map do |command, commands|
    [command, commands.count]
  end.to_h
end