Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

this is a wip... a ultra simple dsl for writing githooks without comandline parsing and manpage hassle... at least thats the plan

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Readme.markdown
Readme.markdown

w00t?

A simple DSL for writing githooks

wtf?!

yes, allmost nothing here yet. checkout the basic branch and see my first trys to get something to work. feel free to critique ;)

why?

Because parsing comandline stuff and diving to manpages should not be neccassary for something that simple as hooks, at least not for the basic and most common features nearly every hook uses.

how?

This might be a update hook for example in the first step we'll need to do that booring Hook.new() do thingy. Later this will be full of awesomeness and such...

require 'lib/hooker'

Hooker::Hook.new(:update, nil) do
  branch :master do                           # this scopes to a branch / ref
    cant_get_deleted
    commit_messages.must_match /some pattern/ # use the commit_messages macro to apply rules to every commit message
    commits { puts message }                  # access every commit that matches this scope
  end

  commits do                                  # this is the same as above but for every commit, not only the scope
    puts message                              # you can access every commit object
    message.must_match /some other pattern/   # you can use some macros (this might add 'warnings' or 'errors')
                                              # or just decline the commit
    email_to("some_email@googlegael.com")     # another macro to email every successfull commit
  end
end
Something went wrong with that request. Please try again.