Skip to content

Instantly share code, notes, and snippets.

@terlar
Created January 23, 2015 09:09
Show Gist options
  • Save terlar/ea6fd641c97bf9f4eb3d to your computer and use it in GitHub Desktop.
Save terlar/ea6fd641c97bf9f4eb3d to your computer and use it in GitHub Desktop.
Parse ruby object output
#!/usr/bin/env bash
sed -e 's/^ "request" => "//g' \
-e 's/\\"/"/g' \
-e 's/<\([A-Za-z:]*\) /\1.new(/g' \
-e 's/ \([A-Za-z]*\):/\1: /g' \
-e 's/[A-Z_]* (\([0-9]\))/\1/g' \
-e 's/>/)/g' \
-e 's/"$//g' \
"$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment