Class: AliasManager::LogLine
- Inherits:
-
Object
- Object
- AliasManager::LogLine
- Defined in:
- lib/alias_manager/log_line.rb
Class Method Summary collapse
Class Method Details
.all ⇒ Object
3 4 5 6 7 8 9 |
# 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 ⇒ Object
11 12 13 14 15 |
# 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 |