Browse files

Initial commit

  • Loading branch information...
0 parents commit 5a4d14ce90b4fc15acec54473c513662c9867854 @michalmarczyk committed Dec 2, 2011
Showing with 53 additions and 0 deletions.
  1. +8 −0 .gitignore
  2. +25 −0 README.md
  3. +3 −0 project.clj
  4. +11 −0 src/leiningen/hooks/local_repos.clj
  5. +6 −0 test/lein_local_repos/test/core.clj
8 .gitignore
@@ -0,0 +1,8 @@
+/pom.xml
+*jar
+/lib
+/classes
+/native
+/.lein-failures
+/checkouts
+/.lein-deps-sum
25 README.md
@@ -0,0 +1,25 @@
+# lein-local-repos
+
+A kludge to force Leiningen to use repositories specified under a
+`:local-repositories` key in the `settings` map in `~/.lein/init.clj`.
+
+## Usage
+
+ ;;; in ~/.lein/init.clj
+ (def settings
+ ...
+ :hooks [... leiningen.hooks.local-repos ...]
+ ...)
+
+## Fablo
+
+This work was sponsored by Fablo (http://fablo.eu/). Fablo provides a
+set of tools for building modern e-commerce storefronts. Tools include
+a search engine, product and search result navigation, accelerators,
+personalized recommendations, and real-time statistics and analytics.
+
+## License
+
+Copyright (C) 2011 Michał Marczyk
+
+Distributed under the Eclipse Public License, the same as Clojure.
3 project.clj
@@ -0,0 +1,3 @@
+(defproject lein-local-repos "0.0.1"
+ :description "Coerce Leiningen into reading repository information from the user settings for all projects."
+ :dev-dependencies [[org.clojure/clojure "[1.2.0,1.3.0]"]])
11 src/leiningen/hooks/local_repos.clj
@@ -0,0 +1,11 @@
+(ns leiningen.hooks.local-repos
+ (:use [robert.hooke :only [add-hook]]
+ [leiningen.core :only [user-settings]]))
+
+(defn local-repositories []
+ ((user-settings) :local-repositories))
+
+(alter-var-root #'leiningen.core/default-repos
+ merge (local-repositories))
+(alter-var-root #'leiningen.core/default-repos
+ merge (dissoc (local-repositories) "central"))
6 test/lein_local_repos/test/core.clj
@@ -0,0 +1,6 @@
+(ns lein-local-repos.test.core
+ (:use [lein-local-repos.core])
+ (:use [clojure.test]))
+
+(deftest replace-me ;; FIXME: write
+ (is false "No tests have been written."))

0 comments on commit 5a4d14c

Please sign in to comment.