Skip to content

Commit

Permalink
Compojure is grandfathered in. Fixes technomancy#164. (close enough)
Browse files Browse the repository at this point in the history
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
technomancy committed Jan 29, 2011
1 parent e3bbd88 commit f4e4c19
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions 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)))
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f4e4c19

Please sign in to comment.