Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created August 22, 2014 10:57
Show Gist options
  • Save rummelonp/a1a693f586f957d89191 to your computer and use it in GitHub Desktop.
Save rummelonp/a1a693f586f957d89191 to your computer and use it in GitHub Desktop.
rails generate controller で生成される controller 取り敢えず skip にして action ごとの method も合わせるやつ
#!/usr/bin/env bash
echo "$@" | xargs gsed -i "
s/describe \"\(.*\) \(.*\)\"/skip '\1 \"\2\"'/g;
s/it \"returns http success\" do/it do/g;
s/GET \"create\"/POST \"create\"/;
s/get :create/post :create/;
s/GET \"update\"/PATCH \"update\"/;
s/get :update/patch :update/;
s/GET \"destroy\"/DELETE \"destroy\"/;
s/get :destroy/delete :destroy/;
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment