mkvtoolnix/tests/new_test

31 lines
423 B
Plaintext
Raw Normal View History

#!/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
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
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
echo "New file is $new_file"