Will Jessop's Writings

Sailing, Food, Programming, Technology, and other things

Do you have a Ruby on Rails application you'd like to be faster, more scalable, or just upgraded safely? I'm currently open to new contracts doing Ruby on Rails and Postgres scaling and performance work, and Rails upgrades. Contact me at will@willj.net to get started.
| tags:github Ruby programming tech

Testing Github commit hook one liners

A couple of ruby one-liners for dumping out the content of a github commit hook payload:

For hooks that use type application/json:

$ ruby -rpp -rjson -rsinatra -e 'set :port, 8000; post "/*" do; pp JSON(request.body.read); end'

For hooks that use type application/x-www-form-urlencoded:

$ ruby -rpp -rjson -rsinatra -e 'set :port, 8000; post "/*" do; pp JSON(params[:payload]); end'