Hookify
Git hooks for Ruby
Installation
sudo gem install hookify
Local Installation
git clone git@github.com:viatropos/hookify.git
cd hookify
rake install
Usage
cd my-app
hookify pre-release
Add to Gemfile
for Rails 3
group :development do
gem 'hookify'
gem 'compressible' # as an example that uses it
end
... or to environments/development.rb
for Rails 2
config.gem 'hookify'
Ruby Scripts
Because Rake tasks are much slower than plain Ruby scripts, hookify by default runs a Ruby script when a git hook executes.
The scripts are located in config/hooks/hook_command_name.rb
.
Rake Tasks (deprecated, adding later)
Hookify will execute a Rake task for each of the different commands available. Currently the list is:
hookify pre-release
orhookify pre_release
: setup hook that runs just beforegit push
So you must just create a Rake task like this:
namespace :hookify do
desc "cache assets before push"
task :pre_release do
Compressible.compress("config/static_assets.yml")
end
end
Notes
There are client side hooks, and server side hooks. Server side include pre-release
and post-release
.