Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add 'lein new speclj' template #23

Merged
merged 1 commit into from

2 participants

@bmcgavin

Adds support for "lein new speclj project_name"

@slagyr
Owner

Coincidentally, another Mr. Jones created virtually the same template as you: https://github.com/trptcolin/speclj-template
The major difference is that Colin's works with Lein2.

I'll merge your pull request and make a release, but we'll likely remove it when Lein2 is officially released.

@slagyr slagyr merged commit d3ddacf into from
@slagyr
Owner

Released in 2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 17, 2012
  1. @bmcgavin
This page is out of date. Refresh to see the latest.
View
16 src/leiningen/new/speclj.clj
@@ -0,0 +1,16 @@
+(ns leiningen.new.speclj
+ (:use [leiningen.new.templates :only [renderer name-to-path ->files]]))
+
+(def render (renderer "speclj"))
+
+(defn speclj
+ "FIXME: write documentation"
+ [name]
+ (let [data {:name name
+ :sanitized (name-to-path name)}]
+ (->files data
+ ["project.clj" (render "project.clj" data)]
+ ["README.md" (render "README.md" data)]
+ [".gitignore" (render ".gitignore" data)]
+ ["src/{{sanitized}}/core.clj" (render "core.clj" data)]
+ ["spec/{{sanitized}}/core_spec.clj" (render "core_spec.clj" data)])))
View
0  src/leiningen/new/speclj/.gitignore
No changes.
View
15 src/leiningen/new/speclj/README.md
@@ -0,0 +1,15 @@
+# {{sanitized}}
+
+A Clojure library designed to ... well, that part is up to you.
+
+Includes speclj.
+
+## Usage
+
+FIXME
+
+## License
+
+Copyright 2012 FIXME
+
+
View
10 src/leiningen/new/speclj/core.clj
@@ -0,0 +1,10 @@
+(ns {{name}}.core)
+
+(defn -main
+ "I don't do a whole lot."
+ [& args]
+ println ("Hello, World!"))
+
+(defn testSpec
+ []
+ true)
View
15 src/leiningen/new/speclj/core_spec.clj
@@ -0,0 +1,15 @@
+(ns {{name}}.core-spec
+ (:use
+ [speclj.core]
+ [{{name}}.core]))
+
+(describe "Truth"
+
+ (it "is true"
+ (should true))
+
+ (it "is false"
+ (should-not false))
+
+ (it "calls functions"
+ (should (testSpec))))
View
8 src/leiningen/new/speclj/project.clj
@@ -0,0 +1,8 @@
+(defproject {{sanitized}} "0.1.0-SNAPSHOT"
+ :description "FIXME: write description"
+ :url "http://example.com/FIXME"
+ :license {:name "Eclipse Public License"
+ :url "http://www.eclipse.org/legal/epl-v10.html"}
+ :dependencies [[speclj "2.1.2"] [org.clojure/clojure "1.4.0"]]
+ :plugins [[speclj "2.1.2"]]
+ :test-paths ["spec/"])
Something went wrong with that request. Please try again.