Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

-main can take multiple files/dirs #28

Merged
merged 3 commits into from

2 participants

@AlexBaranosky

No description provided.

@AlexBaranosky

This also includes a fix so that clojure.test is always :require/:refer/:all'ed

@technomancy technomancy merged commit 12e3b50 into from
@technomancy
Owner

Sorry for the delay. Looks good; thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 12, 2013
  1. @AlexBaranosky
Commits on Jan 24, 2013
  1. @AlexBaranosky
  2. @AlexBaranosky
This page is out of date. Refresh to see the latest.
View
2  project.clj
@@ -7,6 +7,7 @@
:dependencies [[org.clojure/clojure "1.4.0"]]
:profiles {:dev {:dependencies [[org.clojure/tools.trace "0.7.3"]
[org.clojars.runa/clj-schema "0.7.0"]
+ [gui-diff "0.3.9"]
[korma "0.3.0-beta11"]]}}
:test-selectors {:default (constantly true)
:integration :integration
@@ -14,6 +15,7 @@
;; retain compatibility with lein1 for now
:dev-dependencies [[org.clojure/tools.trace "0.7.3"]
[org.clojars.runa/clj-schema "0.7.0"]
+ [gui-diff "0.3.9"]
[korma "0.3.0-beta11"]]
:dev-resource-paths "dev-resources")
View
5 src/slam/hound.clj
@@ -28,8 +28,9 @@
(defn -main
"Takes a file or dir and rewrites the .clj files with reconstructed ns forms."
- [file-or-dir]
- (doseq [file (file-seq (io/file file-or-dir))
+ [& file-or-dirs]
+ (doseq [file-or-dir file-or-dirs
+ file (file-seq (io/file file-or-dir))
:when (re-find #"/[^\./]+\.clj" (str file))]
(try
(swap-in-reconstructed-ns-form file)
View
4 src/slam/hound/regrow.clj
@@ -75,7 +75,9 @@
:require-refer (for [n (all-ns)
[sym var] (ns-publics n)
:when (= missing (name sym))]
- [(ns-name n) :refer [sym]])))
+ (if (= (ns-name n) 'clojure.test)
+ ['clojure.test :refer :all]
+ [(ns-name n) :refer [sym]]))))
(defn- butlast-regex [candidate]
(if (symbol? candidate)
View
9 src/slam/hound/stitch.clj
@@ -15,9 +15,12 @@
(-> c resolve .getName (.split "\\.") last symbol))))))
(defn- group-by-namespace [uses]
- (for [[namespace subclause] (group-by first uses)]
- [namespace :refer (vec (sort (for [[_ _ [var]] subclause]
- var)))]))
+ (for [[namespace subclause] (group-by first uses)
+ :let [[[_require_ _refer_ referred]] subclause]]
+ (if (= :all referred)
+ [namespace :refer :all]
+ [namespace :refer (vec (sort (for [[_ _ [var]] subclause]
+ var)))])))
(defn collapse-clause [ns-map clause]
(case clause
View
3  test/slam/hound/regrow_test.clj
@@ -19,8 +19,7 @@
:gen-class nil
:require-as '[[clojure.java.io :as io] [clojure.set :as set]]
:require-refer '[[slam.hound.stitch :refer [ns-from-map]]
- [clojure.test :refer [is]]
- [clojure.test :refer [deftest]]]
+ [clojure.test :refer :all]]
:import '(java.io.File java.io.ByteArrayInputStream
clojure.lang.Compiler$BodyExpr
java.util.UUID)
View
2  test/slam/hound_test.clj
@@ -31,7 +31,7 @@
\"Testing some things going on here.\"
(:require [clojure.java.io :as io]
[clojure.set :as set]
- [clojure.test :refer [deftest is]]
+ [clojure.test :refer :all]
[slam.hound.stitch :refer [ns-from-map]])
(:import (clojure.lang Compiler$BodyExpr)
(java.io ByteArrayInputStream File)
Something went wrong with that request. Please try again.