class AliasManager::Alias
Public Class Methods
all()
click to toggle source
# File lib/alias_manager/alias.rb, line 4 def self.all @all ||= `echo "source #{ENV['HOME']}/.zshrc; alias -L" | /bin/zsh`.split("\n").select do |alias_line| alias_line[/alias\s+[^=]*=/] end.map do |string| new(string) end end
Public Instance Methods
abbreviation()
click to toggle source
# File lib/alias_manager/alias.rb, line 12 def abbreviation string.match(/alias\s+([^=]*)=/)[1] end
command()
click to toggle source
# File lib/alias_manager/alias.rb, line 16 def command string.match(/='?"?([^'"]*)'?"?/)[1] end