Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

meathook

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meathook

  • 0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Meathook

Meathook is a gem to help manage a living set of githooks. Inspired by Babar (http://github.com/jdabbs/babar), but intended to be more general in purpose.

.hooks

The .hooks.yaml file should be committed in the root of your repository - it's a yaml file like so:

---
path: "bin/meathook"
pre-commit:
  no_focus:
    command:   "git diff --cached spec/ | grep '^+' | grep ':focus'"
    condition: "nonempty"
    halt:      true
    message:   "You are trying to commit a focused spec!"
post-merge:
  remember_to_bundle:
    command: "git diff --name-only HEAD^..HEAD | grep Gemfile
    condition: "nonempty"
    halt:      false
    message:   "Gemfile was just updated - remember to run 'bundle install'"

Each hook type can be a toplevel key in that file, and the keys in each are arbitrary names of tasks. Each task then has the keys:

  • command: command to run - output and exit code can both be relevant
  • condition: one of [nonempty, empty, failed, successful]
  • halt: under those conditions, should we halt the procedure? (commit, merge, etc)
  • message: message to show the user if the condition is true

The 'path' key is special, and is used to supply a literal path to the meathook script, so that your githooks don't have to use bundler (which can add a half-second onto each operation). if which meathook doesn't give you a path, then you need to specify a path with this key.

meathook install

In order to run the githooks, meathook needs to install a self-call into each of the .git/hooks scripts of the form meathook execute <hookname>.

meathook uninstall

Removes the meathook call from all of the githooks.

FAQs

Package last updated on 19 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc