From 3ae8712bbc3d9ebf486d2f01a82280b2a0e4e52a Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sun, 8 Jan 2017 05:20:04 -0800 Subject: [PATCH] rename data/ to examples/ --- Makefile | 52 ++++---- dev.hs | 6 +- {data => examples}/.gitignore | 0 {data => examples}/alias.journal | 0 {data => examples}/ascii.journal | 0 {data => examples}/balance-multicol.journal | 0 {data => examples}/bcexample.hledger | 0 {data => examples}/business.journal | 0 {data => examples}/chinese.journal | 0 {data => examples}/personal.journal | 0 {data => examples}/sample.csv | 0 {data => examples}/sample.journal | 0 {data => examples}/sample.timeclock | 0 {data => examples}/sample.timedot | 0 {data => examples}/unicode.journal | 0 hledger-lib/Hledger/Data/Journal.hs | 2 +- hledger-lib/doc/hledger_timeclock.5.m4.md | 2 +- hledger-lib/doc/hledger_timedot.5.m4.md | 2 +- hledger/Hledger/Cli/Balance.hs | 2 +- hledger/Hledger/Cli/Main.hs | 2 +- hledger/doc/commands.m4.md | 4 +- hledger/doc/hledger.1 | 4 +- hledger/doc/hledger.1.info | 136 ++++++++++---------- hledger/doc/hledger.1.txt | 4 +- site/developer-guide.md | 20 +-- tests/balance/balance-multicol.journal | 2 +- tests/balance/sample.journal | 2 +- tests/cli/alias.journal | 2 +- tests/cli/business.journal | 2 +- tests/cli/personal.journal | 2 +- tests/i18n/chinese.journal | 2 +- 31 files changed, 124 insertions(+), 124 deletions(-) rename {data => examples}/.gitignore (100%) rename {data => examples}/alias.journal (100%) rename {data => examples}/ascii.journal (100%) rename {data => examples}/balance-multicol.journal (100%) rename {data => examples}/bcexample.hledger (100%) rename {data => examples}/business.journal (100%) rename {data => examples}/chinese.journal (100%) rename {data => examples}/personal.journal (100%) rename {data => examples}/sample.csv (100%) rename {data => examples}/sample.journal (100%) rename {data => examples}/sample.timeclock (100%) rename {data => examples}/sample.timedot (100%) rename {data => examples}/unicode.journal (100%) diff --git a/Makefile b/Makefile index 5b158a2a1..8c2d88a37 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ help2: \ export LANG?=en_US.UTF-8 # command to run during profiling (time and heap) -PROFCMD=stack exec -- hledgerprof balance -f data/10000x1000x10.journal >/dev/null +PROFCMD=stack exec -- hledgerprof balance -f examples/10000x1000x10.journal >/dev/null #PROFRTSFLAGS=-p PROFRTSFLAGS=-P @@ -722,7 +722,7 @@ quickbench: samplejournals bench.sh \ quickprof-%: hledgerprof samplejournals \ $(call def-help,quickprof-"CMD", run some command against a sample journal and display the execution profile ) - $(STACK) exec -- hledgerprof +RTS $(PROFRTSFLAGS) -RTS $* -f data/10000x1000x10.journal >/dev/null + $(STACK) exec -- hledgerprof +RTS $(PROFRTSFLAGS) -RTS $* -f examples/10000x1000x10.journal >/dev/null profiteur hledgerprof.prof @echo @head -20 hledgerprof.prof @@ -748,7 +748,7 @@ quickprof-%: hledgerprof samplejournals \ quickheap-%: hledgerprof samplejournals \ $(call def-help,quickheap-"CMD", run some command against a sample journal and display the heap profile ) - $(STACK) exec -- hledgerprof +RTS -hc -RTS $* -f data/10000x1000x10.journal >/dev/null + $(STACK) exec -- hledgerprof +RTS -hc -RTS $* -f examples/10000x1000x10.journal >/dev/null hp2ps hledgerprof.hp @echo generated hledgerprof.ps $(VIEWPS) hledgerprof.ps @@ -812,50 +812,50 @@ ghcid-lib-doctest: ghcid --command 'cd hledger-lib; $(STACK) ghci hledger-lib:test:doctests' --test ':main' --reload hledger-lib samplejournals: \ - data/sample.journal \ - data/100x100x10.journal \ - data/1000x1000x10.journal \ - data/1000x10000x10.journal \ - data/10000x1000x10.journal \ - data/10000x10000x10.journal \ - data/100000x1000x10.journal \ - data/1000000x1000x10.journal \ - data/ascii.journal \ - data/chinese.journal \ - data/mixed.journal \ - $(call def-help,samplejournals, regenerate standard sample journals in data/ ) + examples/sample.journal \ + examples/100x100x10.journal \ + examples/1000x1000x10.journal \ + examples/1000x10000x10.journal \ + examples/10000x1000x10.journal \ + examples/10000x10000x10.journal \ + examples/100000x1000x10.journal \ + examples/1000000x1000x10.journal \ + examples/ascii.journal \ + examples/chinese.journal \ + examples/mixed.journal \ + $(call def-help,samplejournals, regenerate standard sample journals in examples/ ) -data/sample.journal: +examples/sample.journal: true # XXX should probably regenerate this -data/100x100x10.journal: tools/generatejournal +examples/100x100x10.journal: tools/generatejournal tools/generatejournal 100 100 10 >$@ -data/1000x1000x10.journal: tools/generatejournal +examples/1000x1000x10.journal: tools/generatejournal tools/generatejournal 1000 1000 10 >$@ -data/1000x10000x10.journal: tools/generatejournal +examples/1000x10000x10.journal: tools/generatejournal tools/generatejournal 1000 10000 10 >$@ -data/10000x1000x10.journal: tools/generatejournal +examples/10000x1000x10.journal: tools/generatejournal tools/generatejournal 10000 1000 10 >$@ -data/10000x10000x10.journal: tools/generatejournal +examples/10000x10000x10.journal: tools/generatejournal tools/generatejournal 10000 10000 10 >$@ -data/100000x1000x10.journal: tools/generatejournal +examples/100000x1000x10.journal: tools/generatejournal tools/generatejournal 100000 1000 10 >$@ -data/1000000x1000x10.journal: tools/generatejournal +examples/1000000x1000x10.journal: tools/generatejournal tools/generatejournal 1000000 1000 10 >$@ -data/ascii.journal: tools/generatejournal +examples/ascii.journal: tools/generatejournal tools/generatejournal 3 5 5 >$@ -data/chinese.journal: tools/generatejournal +examples/chinese.journal: tools/generatejournal tools/generatejournal 3 5 5 --chinese >$@ -data/mixed.journal: tools/generatejournal +examples/mixed.journal: tools/generatejournal tools/generatejournal 3 5 5 --mixed >$@ ############################################################################### diff --git a/dev.hs b/dev.hs index 058ecf40d..29de7f9b5 100755 --- a/dev.hs +++ b/dev.hs @@ -33,10 +33,10 @@ import Hledger -- instance NFData Regex journal = - -- "data/10000x1000x10.journal" - "data/10000x1000x10.journal" + -- "examples/10000x1000x10.journal" + "examples/10000x1000x10.journal" -timeclock = "data/sample.timeclock" +timeclock = "examples/sample.timeclock" timeit :: String -> IO a -> IO (Double, a) timeit name action = do diff --git a/data/.gitignore b/examples/.gitignore similarity index 100% rename from data/.gitignore rename to examples/.gitignore diff --git a/data/alias.journal b/examples/alias.journal similarity index 100% rename from data/alias.journal rename to examples/alias.journal diff --git a/data/ascii.journal b/examples/ascii.journal similarity index 100% rename from data/ascii.journal rename to examples/ascii.journal diff --git a/data/balance-multicol.journal b/examples/balance-multicol.journal similarity index 100% rename from data/balance-multicol.journal rename to examples/balance-multicol.journal diff --git a/data/bcexample.hledger b/examples/bcexample.hledger similarity index 100% rename from data/bcexample.hledger rename to examples/bcexample.hledger diff --git a/data/business.journal b/examples/business.journal similarity index 100% rename from data/business.journal rename to examples/business.journal diff --git a/data/chinese.journal b/examples/chinese.journal similarity index 100% rename from data/chinese.journal rename to examples/chinese.journal diff --git a/data/personal.journal b/examples/personal.journal similarity index 100% rename from data/personal.journal rename to examples/personal.journal diff --git a/data/sample.csv b/examples/sample.csv similarity index 100% rename from data/sample.csv rename to examples/sample.csv diff --git a/data/sample.journal b/examples/sample.journal similarity index 100% rename from data/sample.journal rename to examples/sample.journal diff --git a/data/sample.timeclock b/examples/sample.timeclock similarity index 100% rename from data/sample.timeclock rename to examples/sample.timeclock diff --git a/data/sample.timedot b/examples/sample.timedot similarity index 100% rename from data/sample.timedot rename to examples/sample.timedot diff --git a/data/unicode.journal b/examples/unicode.journal similarity index 100% rename from data/unicode.journal rename to examples/unicode.journal diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index acfc96cdd..7aa37945f 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -889,7 +889,7 @@ abspat pat = if isnegativepat pat then drop (length negateprefix) pat else pat -- tests --- A sample journal for testing, similar to data/sample.journal: +-- A sample journal for testing, similar to examples/sample.journal: -- -- 2008/01/01 income -- assets:bank:checking $1 diff --git a/hledger-lib/doc/hledger_timeclock.5.m4.md b/hledger-lib/doc/hledger_timeclock.5.m4.md index c7305fe1c..983b450ca 100644 --- a/hledger-lib/doc/hledger_timeclock.5.m4.md +++ b/hledger-lib/doc/hledger_timeclock.5.m4.md @@ -52,7 +52,7 @@ $ hledger -f t.timeclock print ``` Here is a -[sample.timeclock](https://raw.github.com/simonmichael/hledger/master/data/sample.timeclock) to +[sample.timeclock](https://raw.github.com/simonmichael/hledger/master/examples/sample.timeclock) to download and some queries to try: ```shell diff --git a/hledger-lib/doc/hledger_timedot.5.m4.md b/hledger-lib/doc/hledger_timedot.5.m4.md index 7c3fcf7ca..0a886dd05 100644 --- a/hledger-lib/doc/hledger_timedot.5.m4.md +++ b/hledger-lib/doc/hledger_timedot.5.m4.md @@ -110,7 +110,7 @@ $ hledger -f t.timedot --alias /\\./=: bal date:2016/2/4 ``` Here is a -[sample.timedot](https://raw.github.com/simonmichael/hledger/master/data/sample.timedot). +[sample.timedot](https://raw.github.com/simonmichael/hledger/master/examples/sample.timedot). diff --git a/hledger/Hledger/Cli/Balance.hs b/hledger/Hledger/Cli/Balance.hs index f7681855f..33f8cd138 100644 --- a/hledger/Hledger/Cli/Balance.hs +++ b/hledger/Hledger/Cli/Balance.hs @@ -13,7 +13,7 @@ With no report interval (@--monthly@ etc.), hledger's balance command emulates ledger's, showing accounts indented according to hierarchy, along with their total amount posted (including subaccounts). -Here's an example. With @data/sample.journal@, which defines the following account tree: +Here's an example. With @examples/sample.journal@, which defines the following account tree: @ assets diff --git a/hledger/Hledger/Cli/Main.hs b/hledger/Hledger/Cli/Main.hs index 19511d2ef..1822b66d9 100644 --- a/hledger/Hledger/Cli/Main.hs +++ b/hledger/Hledger/Cli/Main.hs @@ -19,7 +19,7 @@ You can use the command line: or ghci: > $ ghci hledger -> > j <- readJournalFile Nothing Nothing "data/sample.journal" +> > j <- readJournalFile Nothing Nothing "examples/sample.journal" > > register [] ["income","expenses"] j > 2008/01/01 income income:salary $-1 $-1 > 2008/06/01 gift income:gifts $-1 $-2 diff --git a/hledger/doc/commands.m4.md b/hledger/doc/commands.m4.md index b4fc77705..6841fd718 100644 --- a/hledger/doc/commands.m4.md +++ b/hledger/doc/commands.m4.md @@ -139,7 +139,7 @@ Example (see the [tutorial](step-by-step.html#record-a-transaction-with-hledger- _shell_({{ $ hledger add -Adding transactions to journal file /src/hledger/data/sample.journal +Adding transactions to journal file /src/hledger/examples/sample.journal Any command line arguments will be used as defaults. Use tab key to complete, readline keys to edit, enter to accept defaults. An optional (CODE) may follow transaction dates. @@ -511,7 +511,7 @@ Show some journal statistics. ```shell $ hledger stats -Main journal file : /src/hledger/data/sample.journal +Main journal file : /src/hledger/examples/sample.journal Included journal files : Transactions span : 2008-01-01 to 2009-01-01 (366 days) Last transaction : 2008-12-31 (2333 days ago) diff --git a/hledger/doc/hledger.1 b/hledger/doc/hledger.1 index 9e239c32e..ab5597377 100644 --- a/hledger/doc/hledger.1 +++ b/hledger/doc/hledger.1 @@ -1128,7 +1128,7 @@ Example (see the tutorial for a detailed explanation): .nf \f[C] $\ hledger\ add -Adding\ transactions\ to\ journal\ file\ /src/hledger/data/sample.journal +Adding\ transactions\ to\ journal\ file\ /src/hledger/examples/sample.journal Any\ command\ line\ arguments\ will\ be\ used\ as\ defaults. Use\ tab\ key\ to\ complete,\ readline\ keys\ to\ edit,\ enter\ to\ accept\ defaults. An\ optional\ (CODE)\ may\ follow\ transaction\ dates. @@ -2030,7 +2030,7 @@ A file extension matching one of the above formats selects that format. .nf \f[C] $\ hledger\ stats -Main\ journal\ file\ \ \ \ \ \ \ \ :\ /src/hledger/data/sample.journal +Main\ journal\ file\ \ \ \ \ \ \ \ :\ /src/hledger/examples/sample.journal Included\ journal\ files\ \ \ :\ Transactions\ span\ \ \ \ \ \ \ \ :\ 2008\-01\-01\ to\ 2009\-01\-01\ (366\ days) Last\ transaction\ \ \ \ \ \ \ \ \ :\ 2008\-12\-31\ (2333\ days\ ago) diff --git a/hledger/doc/hledger.1.info b/hledger/doc/hledger.1.info index ec8f23423..063e02790 100644 --- a/hledger/doc/hledger.1.info +++ b/hledger/doc/hledger.1.info @@ -853,7 +853,7 @@ or press control-d or control-c to exit. $ hledger add -Adding transactions to journal file /src/hledger/data/sample.journal +Adding transactions to journal file /src/hledger/examples/sample.journal Any command line arguments will be used as defaults. Use tab key to complete, readline keys to edit, enter to accept defaults. An optional (CODE) may follow transaction dates. @@ -1672,7 +1672,7 @@ Show some journal statistics. $ hledger stats -Main journal file : /src/hledger/data/sample.journal +Main journal file : /src/hledger/examples/sample.journal Included journal files : Transactions span : 2008-01-01 to 2009-01-01 (366 days) Last transaction : 2008-12-31 (2333 days ago) @@ -2259,71 +2259,71 @@ Node: activity24597 Ref: #activity24709 Node: add25068 Ref: #add25169 -Node: balance27828 -Ref: #balance27941 -Node: Flat mode30954 -Ref: #flat-mode31081 -Node: Depth limited balance reports31500 -Ref: #depth-limited-balance-reports31703 -Node: Multicolumn balance reports32124 -Ref: #multicolumn-balance-reports32326 -Node: Market value36975 -Ref: #market-value37139 -Node: Custom balance output38440 -Ref: #custom-balance-output38613 -Node: Output destination40717 -Ref: #output-destination40882 -Node: CSV output41152 -Ref: #csv-output41271 -Node: balancesheet41668 -Ref: #balancesheet41796 -Node: cashflow42448 -Ref: #cashflow42565 -Node: help43255 -Ref: #help43367 -Node: incomestatement44204 -Ref: #incomestatement44334 -Node: info45061 -Ref: #info45168 -Node: man45530 -Ref: #man45627 -Node: print46030 -Ref: #print46135 -Node: register47481 -Ref: #register47594 -Node: Custom register output52086 -Ref: #custom-register-output52217 -Node: stats53514 -Ref: #stats53620 -Node: test54496 -Ref: #test54583 -Node: ADD-ON COMMANDS54950 -Ref: #add-on-commands55086 -Node: api56374 -Ref: #api56466 -Node: autosync56500 -Ref: #autosync56615 -Node: diff58930 -Ref: #diff59040 -Node: equity59704 -Ref: #equity59818 -Node: interest61146 -Ref: #interest61263 -Node: irr64347 -Ref: #irr64460 -Node: print-unique66835 -Ref: #print-unique66965 -Node: rewrite67223 -Ref: #rewrite67342 -Node: ui67871 -Ref: #ui67971 -Node: web68012 -Ref: #web68100 -Node: TROUBLESHOOTING68133 -Ref: #troubleshooting68252 -Node: Run-time problems68306 -Ref: #run-time-problems68449 -Node: Known limitations70393 -Ref: #known-limitations70536 +Node: balance27832 +Ref: #balance27945 +Node: Flat mode30958 +Ref: #flat-mode31085 +Node: Depth limited balance reports31504 +Ref: #depth-limited-balance-reports31707 +Node: Multicolumn balance reports32128 +Ref: #multicolumn-balance-reports32330 +Node: Market value36979 +Ref: #market-value37143 +Node: Custom balance output38444 +Ref: #custom-balance-output38617 +Node: Output destination40721 +Ref: #output-destination40886 +Node: CSV output41156 +Ref: #csv-output41275 +Node: balancesheet41672 +Ref: #balancesheet41800 +Node: cashflow42452 +Ref: #cashflow42569 +Node: help43259 +Ref: #help43371 +Node: incomestatement44208 +Ref: #incomestatement44338 +Node: info45065 +Ref: #info45172 +Node: man45534 +Ref: #man45631 +Node: print46034 +Ref: #print46139 +Node: register47485 +Ref: #register47598 +Node: Custom register output52090 +Ref: #custom-register-output52221 +Node: stats53518 +Ref: #stats53624 +Node: test54504 +Ref: #test54591 +Node: ADD-ON COMMANDS54958 +Ref: #add-on-commands55094 +Node: api56382 +Ref: #api56474 +Node: autosync56508 +Ref: #autosync56623 +Node: diff58938 +Ref: #diff59048 +Node: equity59712 +Ref: #equity59826 +Node: interest61154 +Ref: #interest61271 +Node: irr64355 +Ref: #irr64468 +Node: print-unique66843 +Ref: #print-unique66973 +Node: rewrite67231 +Ref: #rewrite67350 +Node: ui67879 +Ref: #ui67979 +Node: web68020 +Ref: #web68108 +Node: TROUBLESHOOTING68141 +Ref: #troubleshooting68260 +Node: Run-time problems68314 +Ref: #run-time-problems68457 +Node: Known limitations70401 +Ref: #known-limitations70544  End Tag Table diff --git a/hledger/doc/hledger.1.txt b/hledger/doc/hledger.1.txt index 50cfdd87f..1de8d18b2 100644 --- a/hledger/doc/hledger.1.txt +++ b/hledger/doc/hledger.1.txt @@ -746,7 +746,7 @@ COMMANDS Example (see the tutorial for a detailed explanation): $ hledger add - Adding transactions to journal file /src/hledger/data/sample.journal + Adding transactions to journal file /src/hledger/examples/sample.journal Any command line arguments will be used as defaults. Use tab key to complete, readline keys to edit, enter to accept defaults. An optional (CODE) may follow transaction dates. @@ -1419,7 +1419,7 @@ COMMANDS above formats selects that format. $ hledger stats - Main journal file : /src/hledger/data/sample.journal + Main journal file : /src/hledger/examples/sample.journal Included journal files : Transactions span : 2008-01-01 to 2009-01-01 (366 days) Last transaction : 2008-12-31 (2333 days ago) diff --git a/site/developer-guide.md b/site/developer-guide.md index 847efb881..8254c2aed 100644 --- a/site/developer-guide.md +++ b/site/developer-guide.md @@ -525,7 +525,7 @@ Finally, for quick, fine-grained performance measurements when troubleshooting o ### Generate sample journal files -Synthetic data files like `data/100x100x10.journal` are useful for benchmarks and testing. +Synthetic data files like `examples/100x100x10.journal` are useful for benchmarks and testing. The numbers describe the number of transactions, number of accounts, and maximum account depth respectively. They are generated by [`tools/generatejournal.hs`](https://github.com/simonmichael/hledger/blob/master/tools/generatejournal.hs). They should be built as needed, if not you can use `make samplejournals` rule: @@ -535,15 +535,15 @@ $ make samplejournals ghc tools/generatejournal.hs [1 of 1] Compiling Main ( tools/generatejournal.hs, tools/generatejournal.o ) Linking tools/generatejournal ... -tools/generatejournal 100 100 10 >data/100x100x10.journal -tools/generatejournal 1000 1000 10 >data/1000x1000x10.journal -tools/generatejournal 1000 10000 10 >data/1000x10000x10.journal -tools/generatejournal 10000 1000 10 >data/10000x1000x10.journal -tools/generatejournal 10000 10000 10 >data/10000x10000x10.journal -tools/generatejournal 100000 1000 10 >data/100000x1000x10.journal -tools/generatejournal 3 5 5 >data/ascii.journal -tools/generatejournal 3 5 5 --chinese >data/chinese.journal -tools/generatejournal 3 5 5 --mixed >data/mixed.journal +tools/generatejournal 100 100 10 >examples/100x100x10.journal +tools/generatejournal 1000 1000 10 >examples/1000x1000x10.journal +tools/generatejournal 1000 10000 10 >examples/1000x10000x10.journal +tools/generatejournal 10000 1000 10 >examples/10000x1000x10.journal +tools/generatejournal 10000 10000 10 >examples/10000x10000x10.journal +tools/generatejournal 100000 1000 10 >examples/100000x1000x10.journal +tools/generatejournal 3 5 5 >examples/ascii.journal +tools/generatejournal 3 5 5 --chinese >examples/chinese.journal +tools/generatejournal 3 5 5 --mixed >examples/mixed.journal ``` ### Run tests diff --git a/tests/balance/balance-multicol.journal b/tests/balance/balance-multicol.journal index fdbbf7f97..2778dab4c 120000 --- a/tests/balance/balance-multicol.journal +++ b/tests/balance/balance-multicol.journal @@ -1 +1 @@ -../../data/balance-multicol.journal \ No newline at end of file +../../examples/balance-multicol.journal \ No newline at end of file diff --git a/tests/balance/sample.journal b/tests/balance/sample.journal index 8f14a625d..6fcdfce0e 120000 --- a/tests/balance/sample.journal +++ b/tests/balance/sample.journal @@ -1 +1 @@ -../../data/sample.journal \ No newline at end of file +../../examples/sample.journal \ No newline at end of file diff --git a/tests/cli/alias.journal b/tests/cli/alias.journal index 1b7f296b0..68aaf3749 120000 --- a/tests/cli/alias.journal +++ b/tests/cli/alias.journal @@ -1 +1 @@ -../../data/alias.journal \ No newline at end of file +../../examples/alias.journal \ No newline at end of file diff --git a/tests/cli/business.journal b/tests/cli/business.journal index d8ae20f52..4c0fd57ac 120000 --- a/tests/cli/business.journal +++ b/tests/cli/business.journal @@ -1 +1 @@ -../../data/business.journal \ No newline at end of file +../../examples/business.journal \ No newline at end of file diff --git a/tests/cli/personal.journal b/tests/cli/personal.journal index 9e94c310a..0cce22bf9 120000 --- a/tests/cli/personal.journal +++ b/tests/cli/personal.journal @@ -1 +1 @@ -../../data/personal.journal \ No newline at end of file +../../examples/personal.journal \ No newline at end of file diff --git a/tests/i18n/chinese.journal b/tests/i18n/chinese.journal index 89c0a7bcd..72539a882 120000 --- a/tests/i18n/chinese.journal +++ b/tests/i18n/chinese.journal @@ -1 +1 @@ -../../data/chinese.journal \ No newline at end of file +../../examples/chinese.journal \ No newline at end of file