2009-06-20 14:28:39 +00:00
|
|
|
#!/bin/zsh
|
2004-08-19 19:37:07 +00:00
|
|
|
|
2007-02-20 09:20:38 +00:00
|
|
|
if [ "$1" = "" ]; then
|
2004-08-19 19:37:07 +00:00
|
|
|
echo 'Name?'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2009-06-20 14:28:39 +00:00
|
|
|
name="${1%.rb}"
|
|
|
|
max_num=$(ls | grep test- | sort -r | head -n 1 | cut -c 6-8)
|
|
|
|
let next_num=$max_num+1
|
|
|
|
|
|
|
|
new_file="test-${next_num}${name}.rb"
|
|
|
|
|
|
|
|
cat > "$new_file" <<EOF
|
2004-08-19 19:37:07 +00:00
|
|
|
#!/usr/bin/ruby -w
|
|
|
|
|
2009-06-20 14:30:50 +00:00
|
|
|
class T_${next_num}${name} < Test
|
2004-08-25 17:23:07 +00:00
|
|
|
def description
|
2010-09-01 21:02:38 +00:00
|
|
|
"INSERT DESCRIPTION"
|
2004-08-19 19:37:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
# INSERT COMMANDS
|
2010-09-01 21:02:38 +00:00
|
|
|
hash_tmp
|
2004-08-19 19:37:07 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
EOF
|
2009-06-20 14:28:39 +00:00
|
|
|
|
|
|
|
echo "New file is $new_file"
|