summaryrefslogtreecommitdiff
path: root/tools/rename.sh
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-23 18:39:54 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-23 18:45:41 -0400
commit057506ab6dddbfb75d1bb29289602f375ca57df5 (patch)
tree359075596eb231f462d3decb8f5cd7cf1e5e2ec2 /tools/rename.sh
parent310e339464d972bba9a66caa55f6409248a0f419 (diff)
downloadfork-ledger-057506ab6dddbfb75d1bb29289602f375ca57df5.tar.gz
fork-ledger-057506ab6dddbfb75d1bb29289602f375ca57df5.tar.bz2
fork-ledger-057506ab6dddbfb75d1bb29289602f375ca57df5.zip
The Great Renaming
To better follow naming standards used in the accounting community -- particularly those relating to double-entry accounting -- the following technical terms in Ledger have been changed: - what was "entry" is now "transaction" - what was "transaction" is now "posting" Correspondingly, the shorthand names "entry" and "xact" have been changed to "xact" and "post", respectively.
Diffstat (limited to 'tools/rename.sh')
-rwxr-xr-xtools/rename.sh67
1 files changed, 67 insertions, 0 deletions
diff --git a/tools/rename.sh b/tools/rename.sh
new file mode 100755
index 00000000..7d27d8f8
--- /dev/null
+++ b/tools/rename.sh
@@ -0,0 +1,67 @@
+#!/bin/zsh
+
+git reset --hard
+
+rm -f src/system.hh.gch ledger
+
+for file in *(.) contrib/*(.) doc/*(.) plan/*(.) python/*(.) src/*(.) test/*(.) test/*/*(.) tools/*(.)
+do
+ echo Renaming items in $file ...
+
+ perl -i -pe 's/xact/fazole/g;' $file 2> /dev/null
+ perl -i -pe 's/XACT/FAZOLE/g;' $file 2> /dev/null
+ perl -i -pe 's/Xact/Fazole/g;' $file 2> /dev/null
+ perl -i -pe 's/xacts/fazoles/g;' $file 2> /dev/null
+ perl -i -pe 's/XACTS/FAZOLES/g;' $file 2> /dev/null
+ perl -i -pe 's/Xacts/Fazoles/g;' $file 2> /dev/null
+
+ perl -i -pe 's/transaction/brazole/g;' $file 2> /dev/null
+ perl -i -pe 's/TRANSACTION/BRAZOLE/g;' $file 2> /dev/null
+ perl -i -pe 's/Transaction/Brazole/g;' $file 2> /dev/null
+ perl -i -pe 's/transactions/brazoles/g;' $file 2> /dev/null
+ perl -i -pe 's/TRANSACTIONS/BRAZOLES/g;' $file 2> /dev/null
+ perl -i -pe 's/Transactions/Brazoles/g;' $file 2> /dev/null
+
+ perl -i -pe 's/entry/xact/g;' $file 2> /dev/null
+ perl -i -pe 's/ENTRY/XACT/g;' $file 2> /dev/null
+ perl -i -pe 's/Entry/Xact/g;' $file 2> /dev/null
+ perl -i -pe 's/entries/xacts/g;' $file 2> /dev/null
+ perl -i -pe 's/ENTRIES/XACTS/g;' $file 2> /dev/null
+ perl -i -pe 's/Entries/Xacts/g;' $file 2> /dev/null
+ perl -i -pe 's/entrys/xacts/g;' $file 2> /dev/null
+ perl -i -pe 's/ENTRYS/XACTS/g;' $file 2> /dev/null
+ perl -i -pe 's/Entrys/Xacts/g;' $file 2> /dev/null
+
+ perl -i -pe 's/fazoles/posts/g;' $file 2> /dev/null
+ perl -i -pe 's/FAZOLES/POSTS/g;' $file 2> /dev/null
+ perl -i -pe 's/Fazoles/Posts/g;' $file 2> /dev/null
+ perl -i -pe 's/fazole/post/g;' $file 2> /dev/null
+ perl -i -pe 's/FAZOLE/POST/g;' $file 2> /dev/null
+ perl -i -pe 's/Fazole/Post/g;' $file 2> /dev/null
+
+ perl -i -pe 's/brazoles/postings/g;' $file 2> /dev/null
+ perl -i -pe 's/BRAZOLES/POSTINGS/g;' $file 2> /dev/null
+ perl -i -pe 's/Brazoles/Postings/g;' $file 2> /dev/null
+ perl -i -pe 's/brazole/posting/g;' $file 2> /dev/null
+ perl -i -pe 's/BRAZOLE/POSTING/g;' $file 2> /dev/null
+ perl -i -pe 's/Brazole/Posting/g;' $file 2> /dev/null
+
+ perl -i -pe 's/\@dirxact/\@direntry/g;' $file 2> /dev/null
+ perl -i -pe 's/\@end dirxact/\@end direntry/g;' $file 2> /dev/null
+done
+
+mv src/xact.h src/fazole.h
+mv src/xact.cc src/fazole.cc
+mv src/entry.h src/xact.h
+mv src/entry.cc src/xact.cc
+mv src/fazole.h src/post.h
+mv src/fazole.cc src/post.cc
+
+mv src/py_xact.py src/fazole.py
+mv src/py_entry.py src/py_xact.py
+mv src/fazole.py src/py_post.py
+
+ln -sf ~/Products/ledger/ledger .
+
+tools/myacprep
+