Skip to content

Instantly share code, notes, and snippets.

@defunkt
Created August 17, 2009 07:16
Show Gist options
  • Save defunkt/168964 to your computer and use it in GitHub Desktop.
Save defunkt/168964 to your computer and use it in GitHub Desktop.
module Rip
module Commands
# Runs ~/.rip/active/hooks/after-use after `rip use`
alias_method :rip_use, :use
def use(*args)
rip_use(*args)
if File.directory? hooks = File.join(Rip::Env.active_dir, 'rip-hooks')
after_use_hook = File.join(hooks, 'after-use')
if File.exists?(after_use_hook) && File.executable?(after_use_hook)
exec after_use_hook
else
puts "ripenv: hook found but not executable: #{after_use_hook}"
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment