Class: Aliasing::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/aliasing/cli.rb

Instance Method Summary collapse

Instance Method Details

#make_alias(name, command, location = "~/.bash_profile") ⇒ Object



16
17
18
# File 'lib/aliasing/cli.rb', line 16

def make_alias(name, command, location = "~/.bash_profile")
  Aliasing.make_alias name, command, location
end

#most_frequent(history_file, num = 10) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/aliasing/cli.rb', line 7

def most_frequent(history_file, num = 10)
  f = File.new(history_file)
  history = f.read.split "\n"
  History.new(history).most_frequent(num.to_i).each{ |k, v|
    puts "'#{k}' - #{v}"
  }
end