module Hookers::Git
Public Instance Methods
root_path()
click to toggle source
# File lib/hookers/git/setup.rb, line 8 def root_path path = Dir.pwd while (path != "/") and ! Dir.entries(path).include?(".git") do path = File.expand_path("..", path) end path end
setup()
click to toggle source
# File lib/hookers/git/setup.rb, line 17 def setup from_path = "#{Hookers.root}/scripts/git/post-commit" to_path = "#{root_path}/.git/hooks/post-commit" FileUtils.cp(from_path, to_path) FileUtils.chmod 0755, to_path "setup successfully" end