Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
95 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(ns leiningen.new.app | ||
"Generate a basic application project." | ||
(:use [leiningen.new.templates :only [renderer year project-name | ||
->files sanitize-ns name-to-path]])) | ||
|
||
(defn app | ||
"An application project template." | ||
[name] | ||
(let [render (renderer "app") | ||
data {:raw-name name | ||
:name (project-name name) | ||
:namespace (sanitize-ns name) | ||
:nested-dirs (name-to-path name) | ||
:year (year)}] | ||
(println "Generating a project called" name "based on the 'app' template.") | ||
(->files data | ||
["project.clj" (render "project.clj" data)] | ||
["README.md" (render "README.md" data)] | ||
[".gitignore" (render "gitignore" data)] | ||
["src/{{nested-dirs}}/core.clj" (render "core.clj" data)] | ||
["test/{{nested-dirs}}/core_test.clj" (render "test.clj" data)]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# {{name}} | ||
|
||
FIXME: description | ||
|
||
## Installation | ||
|
||
Download from http://example.com/FIXME. | ||
|
||
## Usage | ||
|
||
FIXME: explanation | ||
|
||
$ java -jar {{name}}-0.1.0-standalone.jar [args] | ||
|
||
## Options | ||
|
||
FIXME: listing of options this app accepts. | ||
|
||
## Examples | ||
|
||
... | ||
|
||
### Bugs | ||
|
||
... | ||
|
||
### Any Other Sections | ||
### That You Think | ||
### Might be Useful | ||
|
||
## License | ||
|
||
Copyright © {{year}} FIXME | ||
|
||
Distributed under the Eclipse Public License, the same as Clojure. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(ns {{namespace}}.core | ||
(:gen-class)) | ||
|
||
(defn -main | ||
"I don't do a whole lot ... yet." | ||
[& args] | ||
(println "Hello, World!")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/target | ||
/lib | ||
/classes | ||
/checkouts | ||
pom.xml | ||
*.jar | ||
*.class | ||
.lein-deps-sum | ||
.lein-failures | ||
.lein-plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(defproject {{raw-name}} "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 [[org.clojure/clojure "1.3.0"]] | ||
:main {{raw-name}}.core) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
(ns {{namespace}}.core-test | ||
(:use clojure.test | ||
{{name}}.core)) | ||
|
||
(deftest a-test | ||
(testing "FIXME, I fail." | ||
(is (= 0 1)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters