Skip to content
Browse files

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

With the regex factored out into its own def, it can be overcome in
~/.lein/init.clj:

(require 'leiningen.new)
(alter-var-root #'leiningen.new/project-name-blacklist (constantly #"^$"))
  • Loading branch information...
1 parent e3bbd88 commit f4e4c1958d9f9d07d46f7e1c2d3ea11f6b660f72 @technomancy technomancy committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/leiningen/new.clj
View
8 src/leiningen/new.clj
@@ -1,6 +1,6 @@
(ns leiningen.new
"Create a new project skeleton."
- (:use [leiningen.core :only [ns->path]]
+ (:use [leiningen.core :only [ns->path abort]]
[clojure.java.io :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]
(leiningen.new/new 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.
Something went wrong with that request. Please try again.