Module: Chitin::Builtins::Aliases

Included in:
Chitin::Builtins
Defined in:
lib/chitin/commands/builtins.rb

Overview

I’m putting these in their own module so that you can compress them easily using code folding. Sinatra-style, baby.

Instance Method Summary collapse

Instance Method Details

#allObject



132
# File 'lib/chitin/commands/builtins.rb', line 132

def all; D('.'); end

#cObject



129
# File 'lib/chitin/commands/builtins.rb', line 129

def c; clear; end

#cd(path = ) ⇒ Object

Basic helper commands for shell usability



119
# File 'lib/chitin/commands/builtins.rb', line 119

def cd(path=ENV['HOME']); Dir.chdir path; pwd; end

#exeuntObject



127
# File 'lib/chitin/commands/builtins.rb', line 127

def exeunt; puts 'Fare thee well...'; exit 0; end

#gem(*a) ⇒ Object



131
# File 'lib/chitin/commands/builtins.rb', line 131

def gem(*a); raw_exec("gem", *a); end

#la(*a) ⇒ Object



126
# File 'lib/chitin/commands/builtins.rb', line 126

def la(*a); ls '-haGl', *a; end

#ll(*a) ⇒ Object



125
# File 'lib/chitin/commands/builtins.rb', line 125

def ll(*a); ls '-hGl', *a; end

#pwdObject



120
# File 'lib/chitin/commands/builtins.rb', line 120

def pwd; Dir.pwd; end

#short_pwdObject



121
122
123
124
# File 'lib/chitin/commands/builtins.rb', line 121

def short_pwd
  home = ENV['HOME']
  pwd.start_with?(home) ? pwd.sub(home, '~') : pwd
end

#xObject



128
# File 'lib/chitin/commands/builtins.rb', line 128

def x; exeunt; end