From 5c6b2416059a92228976cb8588adfa9821c299a2 Mon Sep 17 00:00:00 2001 From: Yan Pritzker Date: Sun, 4 Aug 2013 16:50:18 -0500 Subject: [PATCH] Remove unused run_tags. Use :Rtags instead --- bin/run_tags.rb | 47 ----------------------------------------------- zsh/aliases.zsh | 4 ---- 2 files changed, 51 deletions(-) delete mode 100755 bin/run_tags.rb diff --git a/bin/run_tags.rb b/bin/run_tags.rb deleted file mode 100755 index 5c9a651..0000000 --- a/bin/run_tags.rb +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/ruby -#-*-ruby-*- -# A script to run ctags on all .rb files in a project. Can be run on -# the current dir, called from a git callback, or install itself as a -# git post-merge and post-commit callback. -# More info here: http://vimeo.com/3989493 -# -# This fork will work with homebrew installed ctags on OS X ("brew install ctags") -# Source: https://gist.github.com/1564787 - -CTAGS = '/usr/local/bin/ctags' -HOOKS = %w{ post-merge post-commit post-checkout } -HOOKS_DIR = '.git/hooks' - -def install - if !File.writable?(HOOKS_DIR) - $stderr.print "The install option [-i] can only be used within a git repo; exiting.\n" - exit 1 - end - - HOOKS.each { |hook| install_hook("#{HOOKS_DIR}/#{hook}") } -end - -def run_tags(dir) - if File.executable?(CTAGS) and File.writable?(dir) - %x{find #{dir} -name \\*.rb | #{CTAGS} -f #{dir}/TAGS -L - 2>>/dev/null} - else - $stderr.print "FAILED to write TAGS file to #{dir}\n" - end -end - -def install_hook(hook) - if File.exists?(hook) - $stderr.print "A file already exists at #{hook}, and will NOT be replaced.\n" - return - end - - print "Linking #{__FILE__} to #{hook}\n" - %x{ln -s #{__FILE__} #{hook}} -end - -if ARGV.first == '-i' - install -else - # if GIT_DIR is set, we are being called from git - run_tags( ENV['GIT_DIR'] ? "#{ENV['GIT_DIR']}/.." : Dir.pwd ) -end diff --git a/zsh/aliases.zsh b/zsh/aliases.zsh index f00d33e..114e1ea 100644 --- a/zsh/aliases.zsh +++ b/zsh/aliases.zsh @@ -121,10 +121,6 @@ alias ms='mongrel_rails start' alias tfdl='tail -f log/development.log' alias tftl='tail -f log/test.log' -# Vim/ctags "mctags = make ctags", using the ruby specific version -# to save some time -alias mctags=~/.bin/run_tags.rb #'/opt/local/bin/ctags -Rf ./tags *' - alias ka9='killall -9' alias k9='kill -9'