Browse files

Compojure is grandfathered in. Fixes #164. (close enough)

With the regex factored out into its own def, it can be overcome in

(require '
(alter-var-root #' (constantly #"^$"))
  • Loading branch information...
technomancy committed Jan 29, 2011
1 parent e3bbd88 commit f4e4c1958d9f9d07d46f7e1c2d3ea11f6b660f72
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/leiningen/new.clj
@@ -1,6 +1,6 @@
"Create a new project skeleton."
- (:use [leiningen.core :only [ns->path]]
+ (:use [leiningen.core :only [ns->path abort]]
[ :only [file]]
[clojure.string :only [join]])
(:import (java.util Calendar)))
@@ -38,13 +38,15 @@
(str "Distributed under the Eclipse Public"
" License, the same as Clojure.\n")])))
+(def project-name-blacklist #"(?i)(?<!(clo|compo))jure")
(defn new
"Create a new project skeleton."
( project-name (name (symbol project-name))))
([project-name project-dir]
- (when (re-find #"(?i)(?<!clo)jure" project-name)
- (throw (IllegalArgumentException. "*jure names are no longer allowed.")))
+ (when (re-find project-name-blacklist project-name)
+ (abort "Sorry, *jure names are no longer allowed."))
(let [project-name (symbol project-name)
group-id (namespace project-name)
artifact-id (name project-name)

0 comments on commit f4e4c19

Please sign in to comment.