Skip to content

Instantly share code, notes, and snippets.

@zentooo
Created Aug 30, 2010
Embed
What would you like to do?
def dir(name, dir = nil)
dir ||= name
task name do
sh "tmux new-window -n #{name}";
sh "tmux send-keys -t:#{name} 'cd #{dir}; clear' C-m";
end
end
def perl(name, dir = nil)
dir ||= name
task name do
sh "tmux new-window -n #{name}";
sh "tmux send-keys -t:#{name} 'cd #{dir}; clear' C-m";
sh "tmux new-window -n #{name}_t";
sh "tmux send-keys -t:#{name}_t 'cd #{dir}/t; clear' C-m";
sh "tmux new-window -n #{name}_lib";
sh "tmux send-keys -t:#{name}_lib 'cd #{dir}/lib; clear' C-m";
end
end
def ssh(server, user = nil)
user ||= ENV['USER']
task server do
sh "tmux new-window -n #{server}";
sh "tmux send-keys -t:#{server} 'ssh #{user}@#{server}' C-m";
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment