Class: Fantassh::BashHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/fantassh/bash_history.rb

Instance Method Summary collapse

Instance Method Details

#entriesObject



3
4
5
6
7
8
9
# File 'lib/fantassh/bash_history.rb', line 3

def entries
  File.readlines(File.join(Dir.home, '.bash_history')).
    grep(/^\s*ssh\s/).
    map(&:strip).
    uniq.
    map { |x| x.gsub(/^ssh\s+/, '') }
end