A lein-generate plugin to generate test, paragraph or exercise files useful when studying SICP in Clojure. This plugin assumes you created the usual leiningen project to solve the SICP exercises or simply to follow along paragraph.
Just add:
:plugins [[lein-gen "0.2.1"]]
to your projet file and a generators section:
:generators [[sicp-generators "0.1.0"]]
Then create a test/paragraph version or test/exercise version with the following:
lein generate exercise 1-1
lein generate paragraph counting-change
The first example will create two files, src/sicp/exercises/1_1.clj and related test/sicp/exercises/1_1_test.clj. The second example will create two files, src/sicp/paragraphs/counting_change.clj and related test/sicp/paragraphs/counting_changes_test.clj
By default "sicp" is the name of the initial classpath root for generated files. To change that into something else use:
lein generate exercise 1-1 my-sicp
The additional "my-sicp" argument changes the root package of generated files (and ns declaration into: src/my_sicp/ and test/my_sicp.
By default the generated test stub uses clojure.test. You can also use midje stubs using:
lein generate exercise 1-1 my-sicp midje
resulting in the generation of a midje test stub requiring the related src file.
Type
lein help generate
to see what templates and options are available.
Copyright © 2015 Renzo Borgatti http://reborg.net Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.