From 09badf754a750863834626f4d025536f10627de7 Mon Sep 17 00:00:00 2001 From: Rahim Packir Saibo Date: Sun, 7 Apr 2013 12:00:57 +0100 Subject: [PATCH] Added expandr script for recursively applying the ruby 2 space convention to rubyish files --- bin/expandr | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bin/expandr diff --git a/bin/expandr b/bin/expandr new file mode 100755 index 0000000..24e5ae5 --- /dev/null +++ b/bin/expandr @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Iteratively replaces tabs in rubyish files with 2 spaces. +# + +if [[ -n "$1" ]]; then + find $1 -name \*.rb -o -name \*.erb -o -name \*.scss -o -name \*.js -o -name \*.coffee -o -name \*.yml -o -name \*.md -o -name "Gemfile" -o -name "config.ru" | while read line + do + expand -t 2 $line > $line.new + mv $line.new $line + done +else + echo "Path required" + exit 1 +fi