Skip to content

Commit

Permalink
Added expandr script for recursively applying the ruby 2 space conven…
Browse files Browse the repository at this point in the history
…tion to rubyish files
  • Loading branch information
rahim committed Apr 7, 2013
1 parent 57629c9 commit 09badf7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions 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

0 comments on commit 09badf7

Please sign in to comment.